mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-04 12:43:24 +00:00
Added VectorLength helper function that works on nullptr.
Change-Id: Ie62096f7337a476bee7a6d46d652e594fb3124d2 Tested: on Linux. Bug: 18201051
This commit is contained in:
@@ -137,6 +137,7 @@ void AccessFlatBufferTest(const std::string &flatbuf) {
|
||||
TEST_EQ(pos->test3().b(), 20);
|
||||
|
||||
auto inventory = monster->inventory();
|
||||
TEST_EQ(VectorLength(inventory), 10); // Works even if inventory is null.
|
||||
TEST_NOTNULL(inventory);
|
||||
unsigned char inv_data[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
|
||||
for (auto it = inventory->begin(); it != inventory->end(); ++it)
|
||||
|
||||
Reference in New Issue
Block a user