diff options
author | Joshua Haberman <jhaberman@gmail.com> | 2011-09-03 11:14:18 -0700 |
---|---|---|
committer | Joshua Haberman <jhaberman@gmail.com> | 2011-09-03 11:14:18 -0700 |
commit | 8f2758dda2ba12b78ae8f8c7170decc5e88dd28c (patch) | |
tree | f9d03ca10244181f27591a0e8102ccb555d378de /tests/test_cpp.cc | |
parent | 4a8b9be46c9485a35383b52d400ba086d3f40ace (diff) |
Work on C++ wrappers, added C++ test.
Diffstat (limited to 'tests/test_cpp.cc')
-rw-r--r-- | tests/test_cpp.cc | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/test_cpp.cc b/tests/test_cpp.cc new file mode 100644 index 0000000..ac5a3be --- /dev/null +++ b/tests/test_cpp.cc @@ -0,0 +1,22 @@ + +#include <iostream> +#include "upb/def.hpp" +#include "upb/pb/glue.hpp" + +static void TestSymbolTable() { + upb::SymbolTable *s = upb::SymbolTable::New(); + upb::Status status; + if (!upb::LoadDescriptorFileIntoSymtab(s, "tests/test.proto.pb", &status)) { + std::cerr << "Couldn't load descriptor: " << status; + exit(1); + } + upb::MessageDef *md = s->LookupMessage("A"); + assert(md); + + s->Unref(); + md->Unref(); +} + +int main() { + TestSymbolTable(); +} |