summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJoshua Haberman <joshua@reverberate.org>2009-11-26 20:03:07 -0800
committerJoshua Haberman <joshua@reverberate.org>2009-11-26 20:03:07 -0800
commit9e3f5e343b8a729331dd6448bddb9150ae60d63c (patch)
treec37742bb66ec8782e684c0f031a8ab7615fa9f8c /tests
parentf231856c48ced0b95027c58fbf7bdd5569d02e75 (diff)
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.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_vs_proto2.cc11
1 files changed, 4 insertions, 7 deletions
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)) {
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback