Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

[Linux] add GTest printer for FlValue #32652

Merged
merged 1 commit into from
Apr 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions shell/platform/linux/testing/fl_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,8 @@ FlEngine* make_mock_engine_with_project(FlDartProject* project) {

return static_cast<FlEngine*>(g_object_ref(engine));
}

void PrintTo(FlValue* v, std::ostream* os) {
g_autofree gchar* s = fl_value_to_string(v);
*os << s;
}
5 changes: 5 additions & 0 deletions shell/platform/linux/testing/fl_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
#define FLUTTER_SHELL_PLATFORM_LINUX_FL_TEST_H_

#include "flutter/shell/platform/linux/public/flutter_linux/fl_engine.h"
#include "flutter/shell/platform/linux/public/flutter_linux/fl_value.h"

#include <glib.h>
#include <stdint.h>
#include <ostream>

G_BEGIN_DECLS

Expand All @@ -27,6 +29,9 @@ FlEngine* make_mock_engine();
// platform messages.
FlEngine* make_mock_engine_with_project(FlDartProject* project);

// GTest printer for FlValue.
void PrintTo(FlValue* v, std::ostream* os);

G_END_DECLS

#endif // FLUTTER_SHELL_PLATFORM_LINUX_FL_TEST_H_