Merge pull request #470 from haberman/listfield-fix

Two small bugfixes
pull/13171/head
Joshua Haberman 3 years ago committed by GitHub
commit 1e5f684aea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      python/message.c
  2. 6
      python/pb_unit_tests/json_format_test_wrapper.py
  3. 1
      python/pb_unit_tests/message_test_wrapper.py
  4. 21
      python/pb_unit_tests/text_format_test_wrapper.py
  5. 9
      upb/def.c

@ -930,7 +930,7 @@ static PyObject* PyUpb_CMessage_ListFields(PyObject* _self, PyObject* arg) {
field_desc = NULL;
py_val = NULL;
if (!tuple) goto err;
if (!PyList_Append(list, tuple)) goto err;
if (PyList_Append(list, tuple)) goto err;
Py_DECREF(tuple);
tuple = NULL;
}

@ -42,7 +42,6 @@ json_format_test.JsonFormatTest.testFieldMaskMessage.__unittest_expecting_failur
json_format_test.JsonFormatTest.testFloatPrecision.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testFormatEnumsAsInts.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testIgnoreUnknownField.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testIndent.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testInvalidAny.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testInvalidMap.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testInvalidTimestamp.__unittest_expecting_failure__ = True
@ -51,17 +50,12 @@ json_format_test.JsonFormatTest.testJsonName.__unittest_expecting_failure__ = Tr
json_format_test.JsonFormatTest.testJsonParseDictToAnyDoesNotAlterInput.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testListValueMessage.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testMapFields.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testMessageToDict.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testNanFloat.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testNullValue.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testOneofFields.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testParseDictAnyDescriptorPoolMissingType.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testParseDoubleToFloat.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testParseNull.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testPartialMessageToJson.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testPreservingProtoFieldNames.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testProto3Optional.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testSortKeys.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testStructMessage.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testTimestampMessage.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testUnknownEnumToJsonAndBack.__unittest_expecting_failure__ = True

@ -185,7 +185,6 @@ message_test.Proto3Test.testMessageMapValidAfterFieldCleared.__unittest_expectin
message_test.Proto3Test.testModifyMapWhileIterating.__unittest_expecting_failure__ = True
message_test.Proto3Test.testNestedMessageMapItemDelete.__unittest_expecting_failure__ = True
message_test.Proto3Test.testProto3Optional.__unittest_expecting_failure__ = True
message_test.Proto3Test.testProto3ParserDropDefaultScalar.__unittest_expecting_failure__ = True
message_test.Proto3Test.testScalarMap.__unittest_expecting_failure__ = True
message_test.Proto3Test.testScalarMapDefaults.__unittest_expecting_failure__ = True
message_test.Proto3Test.testStringUnicodeConversionInMap.__unittest_expecting_failure__ = True

@ -85,7 +85,6 @@ text_format_test.Proto3Tests.testPrintMessageExpandAnyPointyBrackets.__unittest_
text_format_test.Proto3Tests.testPrintMessageExpandAnyRepeated.__unittest_expecting_failure__ = True
text_format_test.Proto3Tests.testProto3Optional.__unittest_expecting_failure__ = True
text_format_test.Proto3Tests.testTopAnyMessage.__unittest_expecting_failure__ = True
text_format_test.Proto3Tests.testUnknownEnums.__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMergeTests, "testMergeDuplicateNestedMessageScalars" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMergeTests, "testMergeDuplicateNestedMessageScalars" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMergeTests, "testMergeDuplicateNestedMessageScalars" + sep + "0").__unittest_expecting_failure__ = True
@ -98,14 +97,6 @@ getattr(text_format_test.TextFormatMessageToStringTests, "testCustomOptions" + s
getattr(text_format_test.TextFormatMessageToStringTests, "testCustomOptions" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testCustomOptions" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testCustomOptions" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testMessageToStringASCII" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testMessageToStringASCII" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testMessageToStringASCII" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testMessageToStringASCII" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testMessageToStringUnicode" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testMessageToStringUnicode" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testMessageToStringUnicode" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testMessageToStringUnicode" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testPrintExoticAsOneLine" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testPrintExoticAsOneLine" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testPrintExoticAsOneLine" + sep + "0").__unittest_expecting_failure__ = True
@ -130,10 +121,6 @@ getattr(text_format_test.TextFormatMessageToStringTests, "testPrintNestedMessage
getattr(text_format_test.TextFormatMessageToStringTests, "testPrintNestedMessageAsOneLine" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testPrintNestedMessageAsOneLine" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testPrintNestedMessageAsOneLine" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testPrintNestedNewLineInStringAsOneLine" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testPrintNestedNewLineInStringAsOneLine" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testPrintNestedNewLineInStringAsOneLine" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testPrintNestedNewLineInStringAsOneLine" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testPrintRawUtf8String" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testPrintRawUtf8String" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testPrintRawUtf8String" + sep + "0").__unittest_expecting_failure__ = True
@ -158,10 +145,6 @@ getattr(text_format_test.TextFormatMessageToTextBytesTests, "testEscapedUtf8ASCI
getattr(text_format_test.TextFormatMessageToTextBytesTests, "testEscapedUtf8ASCIIRoundTrip" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToTextBytesTests, "testEscapedUtf8ASCIIRoundTrip" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToTextBytesTests, "testEscapedUtf8ASCIIRoundTrip" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToTextBytesTests, "testMessageToBytes" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToTextBytesTests, "testMessageToBytes" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToTextBytesTests, "testMessageToBytes" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToTextBytesTests, "testMessageToBytes" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToTextBytesTests, "testRawUtf8RoundTrip" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToTextBytesTests, "testRawUtf8RoundTrip" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToTextBytesTests, "testRawUtf8RoundTrip" + sep + "0").__unittest_expecting_failure__ = True
@ -206,10 +189,6 @@ getattr(text_format_test.TextFormatParserTests, "testParseExotic" + sep + "0")._
getattr(text_format_test.TextFormatParserTests, "testParseExotic" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatParserTests, "testParseExotic" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatParserTests, "testParseExotic" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatParserTests, "testParseOneof" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatParserTests, "testParseOneof" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatParserTests, "testParseOneof" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatParserTests, "testParseOneof" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatParserTests, "testParseRepeatedMessageShortFormat" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatParserTests, "testParseRepeatedMessageShortFormat" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatParserTests, "testParseRepeatedMessageShortFormat" + sep + "0").__unittest_expecting_failure__ = True

@ -47,8 +47,11 @@ typedef struct {
/* The upb core does not generally have a concept of default instances. However
* for descriptor options we make an exception since the max size is known and
* modest (<200 bytes). All types can share a default instance since it is
* initialized to zeroes. */
static const char opt_default[_UPB_MAXOPT_SIZE] = {0};
* initialized to zeroes.
*
* We have to allocate an extra pointer for upb's internal metadata. */
static const char opt_default_buf[_UPB_MAXOPT_SIZE + sizeof(void*)] = {0};
static const char *opt_default = &opt_default_buf[sizeof(void*)];
struct upb_fielddef {
const google_protobuf_FieldOptions *opts;
@ -1443,7 +1446,7 @@ void *symtab_alloc(symtab_addctx *ctx, size_t bytes) {
target = google_protobuf_##options_type##_parse(pb, size, ctx->arena); \
CHK_OOM(target); \
} else { \
target = (const google_protobuf_##options_type *)&opt_default; \
target = (const google_protobuf_##options_type *)opt_default; \
}
static void check_ident(symtab_addctx *ctx, upb_strview name, bool full) {

Loading…
Cancel
Save