diff --git a/flow/flat_buffers.cpp b/flow/flat_buffers.cpp index 570873ab2d..f049e98524 100644 --- a/flow/flat_buffers.cpp +++ b/flow/flat_buffers.cpp @@ -507,20 +507,47 @@ TEST_CASE("/flow/FlatBuffers/EmptyStrings") { rd.deserialize(xs); ASSERT(xs.size() == kSize); for (const auto& x : xs) { - ASSERT(x == StringRef()); + ASSERT(x.size() == 0); } return Void(); } TEST_CASE("/flow/FlatBuffers/EmptyVectors") { int kSize = deterministicRandom()->randomInt(0, 100); - Standalone msg = ObjectWriter::toValue(std::vector>(kSize), Unversioned()); + Standalone msg = ObjectWriter::toValue(std::vector>(kSize), Unversioned()); ObjectReader rd(msg.begin(), Unversioned()); - std::vector> xs; + std::vector> xs; rd.deserialize(xs); ASSERT(xs.size() == kSize); for (const auto& x : xs) { - ASSERT(x == std::vector()); + ASSERT(x.size() == 0); + } + return Void(); +} + +TEST_CASE("/flow/FlatBuffers/EmptyVectorRefs") { + int kSize = deterministicRandom()->randomInt(0, 100); + Standalone msg = ObjectWriter::toValue(std::vector>(kSize), Unversioned()); + ObjectReader rd(msg.begin(), Unversioned()); + std::vector> xs; + rd.deserialize(xs); + ASSERT(xs.size() == kSize); + for (const auto& x : xs) { + ASSERT(x.size() == 0); + } + return Void(); +} + +TEST_CASE("/flow/FlatBuffers/EmptyPreSerVectorRefs") { + int kSize = deterministicRandom()->randomInt(0, 100); + Standalone msg = + ObjectWriter::toValue(std::vector>(kSize), Unversioned()); + ObjectReader rd(msg.begin(), Unversioned()); + std::vector> xs; + rd.deserialize(xs); + ASSERT(xs.size() == kSize); + for (const auto& x : xs) { + ASSERT(x.size() == 0); } return Void(); }