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:
Wouter van Oortmerssen
2014-09-04 16:31:44 -07:00
parent 96592d5dbb
commit 09a2999c66
16 changed files with 113 additions and 17 deletions

View File

@@ -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);