From 87a18f37743efde6f66f77209c98400cdec67cbe Mon Sep 17 00:00:00 2001 From: Chris Fallin Date: Wed, 14 Jan 2015 11:18:20 -0800 Subject: Support oneof defs in upb. This change adds support for a OneofDef (upb_oneofdef), which represents a 'oneof' as introduced by Protocol Buffers. This is semantically a union type that contains fields and in turn may be added to a MessageDef. This change does not alter parsing or the handler abstraction in any way, because a oneof has impact only at a higher semantic level (i.e., any sort of storage of the fields in a message object), which is user-specific with respect to upb. --- tests/bindings/googlepb/test_vs_proto2.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/bindings/googlepb') diff --git a/tests/bindings/googlepb/test_vs_proto2.cc b/tests/bindings/googlepb/test_vs_proto2.cc index c89339a..49dfe49 100644 --- a/tests/bindings/googlepb/test_vs_proto2.cc +++ b/tests/bindings/googlepb/test_vs_proto2.cc @@ -40,8 +40,8 @@ const unsigned char message2_data[] = { void compare_metadata(const google::protobuf::Descriptor* d, const upb::MessageDef *upb_md) { ASSERT(d->field_count() == upb_md->field_count()); - for (upb::MessageDef::const_iterator i = upb_md->begin(); i != upb_md->end(); - ++i) { + for (upb::MessageDef::const_field_iterator i = upb_md->field_begin(); + i != upb_md->field_end(); ++i) { const upb::FieldDef* upb_f = *i; const google::protobuf::FieldDescriptor *proto2_f = d->FindFieldByNumber(upb_f->number()); -- cgit v1.2.3