Fixed reflection setting string not changing size field.

Change-Id: I3c3e88a79667d1733b6c47e43b55d8b2604ca8e2
Tested: on Linux.
This commit is contained in:
Wouter van Oortmerssen
2015-12-21 16:17:50 -08:00
parent d7d527d154
commit 1891537236
2 changed files with 11 additions and 3 deletions

View File

@@ -404,6 +404,11 @@ void ReflectionTest(uint8_t *flatbuf, size_t length) {
rtestarrayofstring->MutateOffset(2, string_ptr);
TEST_EQ_STR(rtestarrayofstring->Get(0)->c_str(), "bob");
TEST_EQ_STR(rtestarrayofstring->Get(2)->c_str(), "hank");
// Test integrity of all resize operations above.
flatbuffers::Verifier resize_verifier(
reinterpret_cast<const uint8_t *>(resizingbuf.data()),
resizingbuf.size());
TEST_EQ(VerifyMonsterBuffer(resize_verifier), true);
// As an additional test, also set it on the name field.
// Note: unlike the name change above, this just overwrites the offset,
// rather than changing the string in-place.