Index: mojo/public/cpp/bindings/tests/array_unittest.cc |
diff --git a/mojo/public/cpp/bindings/tests/array_unittest.cc b/mojo/public/cpp/bindings/tests/array_unittest.cc |
index 133fa8b32436c455b6bc8a6d779bc2d36b8a9b11..0b083c72088d0e77c346cdf0ad2caf71f418fd30 100644 |
--- a/mojo/public/cpp/bindings/tests/array_unittest.cc |
+++ b/mojo/public/cpp/bindings/tests/array_unittest.cc |
@@ -171,6 +171,21 @@ TEST_F(ArrayTest, Serialization_ArrayOfPOD) { |
EXPECT_EQ(static_cast<int32_t>(i), array2[i]); |
} |
+TEST_F(ArrayTest, Serialization_EmptyArrayOfPOD) { |
+ Array<int32_t> array(0); |
+ size_t size = GetSerializedSize_(array); |
+ EXPECT_EQ(8U, size); |
+ |
+ FixedBuffer buf(size); |
+ Array_Data<int32_t>* data; |
+ SerializeArray_<ArrayValidateParams<0, false, NoValidateParams>>( |
+ array.Pass(), &buf, &data); |
+ |
+ Array<int32_t> array2; |
+ Deserialize_(data, &array2); |
+ EXPECT_EQ(0U, array2.size()); |
+} |
+ |
TEST_F(ArrayTest, Serialization_ArrayOfArrayOfPOD) { |
Array<Array<int32_t>> array(2); |
for (size_t j = 0; j < array.size(); ++j) { |