blob: ac5a3bed1fe8da9060c8b29c1c4d702c6384fc56 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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();
}
|