diff options
Diffstat (limited to 'tests')
-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(); +} |