summaryrefslogtreecommitdiff
path: root/tests/test_cpp.cc
blob: 35526fb7dfd34fb3e765d04372627be78834b454 (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);
  }
  const upb::MessageDef *md = s->LookupMessage("A");
  assert(md);

  s->Unref();
  md->Unref();
}

int main() {
  TestSymbolTable();
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback