summaryrefslogtreecommitdiff
path: root/tests/test_def.c
blob: 1f014f62fd163c2d4790d46005609e690c91c4ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

#undef NDEBUG  /* ensure tests always assert. */
#include "upb/def.h"
#include <stdlib.h>

int main() {
  upb_symtab *s = upb_symtab_new();

  // Will be empty atm since we haven't added anything to the symtab.
  int count;
  upb_def **defs = upb_symtab_getdefs(s, &count, UPB_DEF_ANY);
  for (int i = 0; i < count; i++) {
    upb_def_unref(defs[i]);
  }
  free(defs);

  upb_symtab_unref(s);
  return 0;
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback