Fix two JSON conformance tests that did not test what they claim.
FloatFieldMinNegativeValue sent and expected 3.402823e+38, a copy of the
FloatFieldMaxPositiveValue value, so the most negative finite float was
never exercised. RepeatedFieldWrongElementTypeExpectingStringsGotMessage
sent ["1", 2, "3", {"a": 4}], where the 2 is already a wrong element type
(the case ExpectingStringsGotInt covers), so a parser that rejects ints
but accepts an object for a string field passed it for the wrong reason.
Use -3.402823e+38 and "2" respectively.
Failure lists match on the recorded failure message, so the one entry
that records a message for FloatFieldMinNegativeValue is updated to the
new value.
PiperOrigin-RevId: 1002674327
diff --git a/conformance/binary_json_conformance_suite.cc b/conformance/binary_json_conformance_suite.cc
index 6d3c285..24a9a52 100644
--- a/conformance/binary_json_conformance_suite.cc
+++ b/conformance/binary_json_conformance_suite.cc
@@ -3078,8 +3078,8 @@
R"({"optionalFloat": 3.402823e+38})",
"optional_float: 3.402823e+38");
RunValidJsonTest("FloatFieldMinNegativeValue", REQUIRED,
- R"({"optionalFloat": 3.402823e+38})",
- "optional_float: 3.402823e+38");
+ R"({"optionalFloat": -3.402823e+38})",
+ "optional_float: -3.402823e+38");
// Values can be quoted.
RunValidJsonTest("FloatFieldQuotedValue", REQUIRED,
R"({"optionalFloat": "1"})", "optional_float: 1");
@@ -3478,7 +3478,7 @@
R"({"repeatedString": ["1", "2", false, "4"]})");
ExpectParseFailureForJson(
"RepeatedFieldWrongElementTypeExpectingStringsGotMessage", REQUIRED,
- R"({"repeatedString": ["1", 2, "3", {"a": 4}]})");
+ R"({"repeatedString": ["1", "2", "3", {"a": 4}]})");
ExpectParseFailureForJson(
"RepeatedFieldWrongElementTypeExpectingMessagesGotInt", REQUIRED,
R"({"repeatedNestedMessage": [{"a": 1}, 2]})");