@@ -143,20 +143,23 @@ BOOST_AUTO_TEST_CASE(rpc_parse_monetary_values)
143
143
144
144
BOOST_AUTO_TEST_CASE (json_parse_errors)
145
145
{
146
- Value value;
146
+ UniValue value;
147
147
// Valid
148
- BOOST_CHECK_EQUAL (read_string (std::string (" 1.0" ), value), true );
148
+ BOOST_CHECK_EQUAL (value.read (std::string (" 1.0" )), false );
149
+ BOOST_CHECK_EQUAL (value.read (std::string (" [1.0]" )), true );
149
150
// Valid, with trailing whitespace
150
- BOOST_CHECK_EQUAL (read_string (std::string (" 1.0 " ), value), true );
151
+ BOOST_CHECK_EQUAL (value.read (std::string (" 1.0 " )), false );
152
+ BOOST_CHECK_EQUAL (value.read (std::string (" [1.0 ] " )), true );
151
153
// Invalid, initial garbage
152
- BOOST_CHECK_EQUAL (read_string (std::string (" [1.0" ), value), false );
153
- BOOST_CHECK_EQUAL (read_string (std::string (" a1.0" ), value), false );
154
+ BOOST_CHECK_EQUAL (value.read (std::string (" [1.0" )), false );
155
+ BOOST_CHECK_EQUAL (value.read (std::string (" [a1.0]" )), false );
156
+ BOOST_CHECK_EQUAL (value.read (std::string (" [\" a1.0\" ]" )), true );
154
157
// Invalid, trailing garbage
155
- BOOST_CHECK_EQUAL (read_string (std::string (" 1.0sds" ), value ), false );
156
- BOOST_CHECK_EQUAL (read_string (std::string (" 1.0]" ), value ), false );
158
+ BOOST_CHECK_EQUAL (value. read (std::string (" 1.0sds" )), false );
159
+ BOOST_CHECK_EQUAL (value. read (std::string (" 1.0]" )), false );
157
160
// BTC addresses should fail parsing
158
- BOOST_CHECK_EQUAL (read_string (std::string (" 175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W" ), value ), false );
159
- BOOST_CHECK_EQUAL (read_string (std::string (" 3J98t1WpEZ73CNmQviecrnyiWrnqRhWNL" ), value ), false );
161
+ BOOST_CHECK_EQUAL (value. read (std::string (" 175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W" )), false );
162
+ BOOST_CHECK_EQUAL (value. read (std::string (" 3J98t1WpEZ73CNmQviecrnyiWrnqRhWNL" )), false );
160
163
}
161
164
162
165
BOOST_AUTO_TEST_CASE (rpc_boostasiotocnetaddr)
0 commit comments