Chromium Code Reviews

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

Issue 1800753005: C++ bindings: A struct's Deserialize() now does validation before deserializing. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: mojo/public/cpp/bindings/tests/union_unittest.cc
diff --git a/mojo/public/cpp/bindings/tests/union_unittest.cc b/mojo/public/cpp/bindings/tests/union_unittest.cc
index 95a2d7fd43bd4dbb322fa1d8483c1036e0495f2a..6be7945227166aa3f5cb253fddb22e7612b0b031 100644
--- a/mojo/public/cpp/bindings/tests/union_unittest.cc
+++ b/mojo/public/cpp/bindings/tests/union_unittest.cc
@@ -661,8 +661,7 @@ TEST(UnionTest, Deserialize_NullableUnion) {
EXPECT_TRUE(small_struct->pod_union.is_null());
SmallStructPtr deserialized_struct = SmallStruct::New();
- deserialized_struct->Deserialize(buf);
-
+ EXPECT_TRUE(deserialized_struct->Deserialize(buf, sizeof(buf)));
viettrungluu 2016/03/14 22:56:23 ... because presumably the actual serialized size
vardhan 2016/03/14 23:11:33 (see comment above -- GetSerializedSize() indicate
EXPECT_TRUE(deserialized_struct->pod_union.is_null());
}

Powered by Google App Engine