diff options
-rw-r--r-- | tests/pb/test_encoder.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/pb/test_encoder.cc b/tests/pb/test_encoder.cc index 78a779f..6cc9a2a 100644 --- a/tests/pb/test_encoder.cc +++ b/tests/pb/test_encoder.cc @@ -24,12 +24,13 @@ void test_pb_roundtrip() { google_protobuf_FileDescriptorSet_parsenew( upb_stringview_make(input.c_str(), input.size()), &arena); ASSERT(set); - const upb_array *arr = google_protobuf_FileDescriptorSet_file(set); - const google_protobuf_FileDescriptorProto *file_proto = - static_cast<const google_protobuf_FileDescriptorProto *>( - upb_msgval_getptr(upb_array_get(arr, 0))); + size_t n; + const google_protobuf_FileDescriptorProto *const *files = + google_protobuf_FileDescriptorSet_file(set, &n); + fprintf(stderr, "n: %d\n", (int)n); + ASSERT(n == 1); upb::Status status; - bool ok = symtab->AddFile(file_proto, &status); + bool ok = symtab->AddFile(files[0], &status); ASSERT(ok); const upb::MessageDef *md = symtab->LookupMessage("google.protobuf.FileDescriptorSet"); |