forked from BigfootDev/flatbuffers
Implemented the file identifier functionality for Java.
Also fixed flatc not outputting these identifiers for files compiled on the command-line. Bug: 16983987 Change-Id: I8b714cfea3a8e144fa52133f62b2f7eda6eb044a Tested: on Linux
This commit is contained in:
@@ -85,7 +85,7 @@ class JavaTest {
|
||||
Monster.addTestarrayofstring(fbb, testArrayOfString);
|
||||
int mon = Monster.endMonster(fbb);
|
||||
|
||||
fbb.finish(mon);
|
||||
Monster.finishMonsterBuffer(fbb, mon);
|
||||
|
||||
// Write the result to a file for debugging purposes:
|
||||
// Note that the binaries are not necessarily identical, since the JSON
|
||||
@@ -113,6 +113,8 @@ class JavaTest {
|
||||
}
|
||||
|
||||
static void TestBuffer(ByteBuffer bb, int start) {
|
||||
TestEq(Monster.MonsterBufferHasIdentifier(bb, start), true);
|
||||
|
||||
Monster monster = Monster.getRootAsMonster(bb, start);
|
||||
|
||||
TestEq(monster.hp(), (short)80);
|
||||
|
||||
Reference in New Issue
Block a user