From 9e3f5e343b8a729331dd6448bddb9150ae60d63c Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Thu, 26 Nov 2009 20:03:07 -0800 Subject: Make upb_msgdef own all its data. This is in anticipation of making upb_msgdef's easy to dup. This involved removing all traces of any descriptors from the defs. --- tests/test_vs_proto2.cc | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'tests') diff --git a/tests/test_vs_proto2.cc b/tests/test_vs_proto2.cc index 8674d58..57cf73c 100644 --- a/tests/test_vs_proto2.cc +++ b/tests/test_vs_proto2.cc @@ -135,18 +135,15 @@ void compare(const google::protobuf::Message& proto2_msg, ASSERT((uint32_t)d->field_count() == def->num_fields); for(uint32_t i = 0; i < def->num_fields; i++) { struct upb_fielddef *upb_f = &def->fields[i]; - struct google_protobuf_FieldDescriptorProto *upb_fd = - upb_msg_field_descriptor(upb_f, def); const google::protobuf::FieldDescriptor *proto2_f = - d->FindFieldByNumber(upb_fd->number); + d->FindFieldByNumber(upb_f->number); // Make sure the definitions are equal. ASSERT(upb_f); - ASSERT(upb_fd); ASSERT(proto2_f); - ASSERT(upb_fd->number == proto2_f->number()); - ASSERT(std::string(upb_fd->name->ptr, upb_fd->name->byte_len) == + ASSERT(upb_f->number == proto2_f->number()); + ASSERT(std::string(upb_f->name->ptr, upb_f->name->byte_len) == proto2_f->name()); - ASSERT(upb_fd->type == proto2_f->type()); + ASSERT(upb_f->type == proto2_f->type()); ASSERT(upb_isarray(upb_f) == proto2_f->is_repeated()); if(!upb_msg_isset(upb_msg, upb_f)) { -- cgit v1.2.3