mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-02 04:04:19 +00:00
Made user-defined attributes available in the reflection data.
Tested: on Linux. Bug: 27923233 Change-Id: Ic16675650e4a8e138c163f1e2131a3aad7008ada
This commit is contained in:
@@ -322,6 +322,10 @@ void ReflectionTest(uint8_t *flatbuf, size_t length) {
|
||||
TEST_EQ_STR(hp_field.name()->c_str(), "hp");
|
||||
TEST_EQ(hp_field.id(), 2);
|
||||
TEST_EQ(hp_field.type()->base_type(), reflection::Short);
|
||||
auto friendly_field_ptr = fields->LookupByKey("friendly");
|
||||
TEST_NOTNULL(friendly_field_ptr);
|
||||
TEST_NOTNULL(friendly_field_ptr->attributes());
|
||||
TEST_NOTNULL(friendly_field_ptr->attributes()->LookupByKey("priority"));
|
||||
|
||||
// Now use it to dynamically access a buffer.
|
||||
auto &root = *flatbuffers::GetAnyRoot(flatbuf);
|
||||
|
||||
Reference in New Issue
Block a user