Update issue 112
Status: FixedInGit
* If this extension does not match a field, the next handler is
* automatically called. */
pb_extension_t *next;
+
+ /* The decoder sets this to true if the extension was found.
+ * Ignored for encoding. */
+ bool found;
};
/* Memory allocation functions to use. You can define pb_realloc and
{
const pb_field_t *field = (const pb_field_t*)extension->type->arg;
pb_field_iterator_t iter;
- bool dummy;
if (field->tag != tag)
return true;
iter.required_field_index = 0;
iter.dest_struct = extension->dest;
iter.pData = extension->dest;
- iter.pSize = &dummy;
+ iter.pSize = &extension->found;
return decode_field(stream, wire_type, &iter);
}
}
/* Check that the extensions decoded properly */
+ TEST(ext1.found)
TEST(extensionfield1 == 12345)
+ TEST(ext2.found)
TEST(strcmp(extensionfield2.test1, "test") == 0)
TEST(extensionfield2.test2 == 54321)
-dependenttrans
-kepttrans
-branchstate
+-immediatetrans
# These tests give false positives, compiler typically has
# better warnings for these.