Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: mojo/public/cpp/bindings/tests/struct_unittest.cc

Issue 469393004: Mojo: Add warning of invalid serialization results (in debug build). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: mojo/public/cpp/bindings/tests/struct_unittest.cc
diff --git a/mojo/public/cpp/bindings/tests/struct_unittest.cc b/mojo/public/cpp/bindings/tests/struct_unittest.cc
index 7636057c4ffa4ed158ea3fecc75e437047f6be5f..61ef96f02a03105b5885637d910179e0fa273ee6 100644
--- a/mojo/public/cpp/bindings/tests/struct_unittest.cc
+++ b/mojo/public/cpp/bindings/tests/struct_unittest.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "mojo/public/cpp/bindings/lib/fixed_buffer.h"
+#include "mojo/public/cpp/environment/environment.h"
#include "mojo/public/interfaces/bindings/tests/test_structs.mojom.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -26,9 +27,17 @@ void CheckRect(const Rect& rect, int32_t factor = 1) {
EXPECT_EQ(20 * factor, rect.height);
}
+class StructTest : public testing::Test {
+ public:
+ virtual ~StructTest() {}
+
+ private:
+ Environment env_;
+};
+
} // namespace
-TEST(StructTest, Rect) {
+TEST_F(StructTest, Rect) {
RectPtr rect;
EXPECT_TRUE(rect.is_null());
EXPECT_TRUE(!rect);
@@ -43,7 +52,7 @@ TEST(StructTest, Rect) {
}
// Serialization test of a struct with no pointer or handle members.
-TEST(StructTest, Serialization_Basic) {
+TEST_F(StructTest, Serialization_Basic) {
RectPtr rect(MakeRect());
size_t size = GetSerializedSize_(rect);
@@ -60,7 +69,7 @@ TEST(StructTest, Serialization_Basic) {
}
// Serialization test of a struct with struct pointers.
-TEST(StructTest, Serialization_StructPointers) {
+TEST_F(StructTest, Serialization_StructPointers) {
RectPairPtr pair(RectPair::New());
pair->first = MakeRect();
pair->second = MakeRect();
@@ -80,7 +89,7 @@ TEST(StructTest, Serialization_StructPointers) {
}
// Serialization test of a struct with an array member.
-TEST(StructTest, Serialization_ArrayPointers) {
+TEST_F(StructTest, Serialization_ArrayPointers) {
NamedRegionPtr region(NamedRegion::New());
region->name = "region";
region->rects = Array<RectPtr>::New(4);
@@ -114,7 +123,7 @@ TEST(StructTest, Serialization_ArrayPointers) {
}
// Serialization test of a struct with null array pointers.
-TEST(StructTest, Serialization_NullArrayPointers) {
+TEST_F(StructTest, Serialization_NullArrayPointers) {
NamedRegionPtr region(NamedRegion::New());
EXPECT_TRUE(region->name.is_null());
EXPECT_TRUE(region->rects.is_null());
« no previous file with comments | « mojo/public/cpp/bindings/tests/serialization_warning_unittest.cc ('k') | mojo/public/interfaces/bindings/tests/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698