diff options
author | Joshua Haberman <joshua@reverberate.org> | 2009-11-28 15:38:29 -0800 |
---|---|---|
committer | Joshua Haberman <joshua@reverberate.org> | 2009-11-28 15:38:29 -0800 |
commit | a95ab58e79c50b0927eae2b834d3de20a8effc36 (patch) | |
tree | 2cfb873d3a9d0976aca4ba6d9b1208335b725c3d /tests/test_vs_proto2.cc | |
parent | 246a36998bc0e6800959ff76c2a8c76ff8de3561 (diff) |
Overhaul defs to derive from a common base.
Diffstat (limited to 'tests/test_vs_proto2.cc')
-rw-r--r-- | tests/test_vs_proto2.cc | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/tests/test_vs_proto2.cc b/tests/test_vs_proto2.cc index 57cf73c..f1db678 100644 --- a/tests/test_vs_proto2.cc +++ b/tests/test_vs_proto2.cc @@ -204,15 +204,13 @@ int main(int argc, char *argv[]) upb_string_unref(fds); struct upb_string *proto_name = upb_strdupc(MESSAGE_NAME); - struct upb_symtab_entry e; - bool success = upb_context_lookup(c, proto_name, &e); - if(!success || e.type != UPB_SYM_MESSAGE) { + struct upb_msgdef *def = upb_downcast_msgdef(upb_context_lookup(c, proto_name)); + if(!def) { fprintf(stderr, "Error finding symbol '" UPB_STRFMT "'.\n", UPB_STRARG(proto_name)); return 1; } upb_string_unref(proto_name); - struct upb_msgdef *def = e.ref.msg; // Read the message data itself. struct upb_string *str = upb_strreadfile(MESSAGE_FILE); |