55# if __cplusplus >= 201103L
61# elif defined(__INTEL_COMPILER)
69# ifndef PICOJSON_USE_RVALUE_REFERENCE
70# if (defined(__cpp_rvalue_references) && __cpp_rvalue_references >= 200610) || \
71 (defined(_MSC_VER) && _MSC_VER >= 1600)
72# define PICOJSON_USE_RVALUE_REFERENCE 1
74# define PICOJSON_USE_RVALUE_REFERENCE 0
78# ifndef PICOJSON_NOEXCEPT
79# if PICOJSON_USE_RVALUE_REFERENCE
80# define PICOJSON_NOEXCEPT noexcept
82# define PICOJSON_NOEXCEPT throw()
87# ifdef PICOJSON_USE_INT64
88# define __STDC_FORMAT_MACROS
94# ifndef PICOJSON_USE_LOCALE
95# define PICOJSON_USE_LOCALE 1
97# if PICOJSON_USE_LOCALE
103# ifndef PICOJSON_ASSERT
104# define PICOJSON_ASSERT(e) \
107 throw std::runtime_error(#e); \
112# define SNPRINTF _snprintf_s
113# pragma warning(push)
114# pragma warning(disable : 4244)
115# pragma warning(disable : 4127)
116# pragma warning(disable : 4702)
118# define SNPRINTF snprintf
130# ifdef PICOJSON_USE_INT64
143 typedef std::map<std::string, value>
object;
147# ifdef PICOJSON_USE_INT64
161 value(
int type,
bool);
162 explicit value(
bool b);
163# ifdef PICOJSON_USE_INT64
166 explicit value(
double n);
167 explicit value(
const std::string&
s);
169 explicit value(
const object& o);
170# if PICOJSON_USE_RVALUE_REFERENCE
171 explicit value(std::string&&
s);
173 explicit value(
object&& o);
175 explicit value(
const char*
s);
180# if PICOJSON_USE_RVALUE_REFERENCE
185 template <
typename T>
187 template <
typename T>
189 template <
typename T>
191 template <
typename T>
193# if PICOJSON_USE_RVALUE_REFERENCE
194 template <
typename T>
198 const value&
get(
const size_t idx)
const;
199 const value&
get(
const std::string& key)
const;
203 bool contains(
const size_t idx)
const;
204 bool contains(
const std::string& key)
const;
205 std::string
to_str()
const;
206 template <
typename Iter>
207 void serialize(Iter
os,
bool prettify =
false)
const;
208 std::string
serialize(
bool prettify =
false)
const;
211 template <
typename T>
213 template <
typename Iter>
214 static void _indent(Iter
os,
int indent);
215 template <
typename Iter>
216 void _serialize(Iter
os,
int indent)
const;
217 std::string _serialize(
int indent)
const;
229 case p##type: u_.p = v; break
230 INIT(boolean_,
false);
232# ifdef PICOJSON_USE_INT64
235 INIT(string_,
new std::string());
237 INIT(object_,
new object());
245# ifdef PICOJSON_USE_INT64
253# elif __cplusplus >= 201103L
254 std::isnan(n) || std::isinf(n)
259 throw std::overflow_error(
"");
270# if PICOJSON_USE_RVALUE_REFERENCE
282inline void value::clear() {
285 case p##type: delete u_.p; break
299 case p##type: u_.p = v; break
304 default:
u_ = x.
u_;
break;
316# if PICOJSON_USE_RVALUE_REFERENCE
328# define IS(ctype, jtype) \
330 inline bool value::is<ctype>() const { \
331 return type_ == jtype##_type; \
335# ifdef PICOJSON_USE_INT64
338IS(std::string,
string)
345# ifdef PICOJSON_USE_INT64
346 ||
type_ == int64_type
351# define GET(ctype, var) \
353 inline const ctype& value::get<ctype>() const { \
354 PICOJSON_ASSERT("type mismatch! call is<type>() before get<type>()" && is<ctype>()); \
358 inline ctype& value::get<ctype>() { \
359 PICOJSON_ASSERT("type mismatch! call is<type>() before get<type>()" && is<ctype>()); \
362GET(
bool, u_.boolean_)
363GET(
std::
string, *u_.string_)
365GET(
object, *u_.object_)
366# ifdef PICOJSON_USE_INT64
367GET(
double, (type_ == int64_type &&
372GET(
double, u_.number_)
376# define SET(ctype, jtype, setter) \
378 inline void value::set<ctype>(const ctype& _val) { \
380 type_ = jtype##_type; \
383SET(
bool,
boolean, u_.boolean_ = _val;)
384SET(std::string,
string, u_.string_ =
new std::string(_val);)
386SET(
object,
object, u_.object_ =
new object(_val);)
387SET(
double, number, u_.number_ = _val;)
388# ifdef PICOJSON_USE_INT64
393# if PICOJSON_USE_RVALUE_REFERENCE
394# define MOVESET(ctype, jtype, setter) \
396 inline void value::set<ctype>(ctype && _val) { \
398 type_ = jtype##_type; \
401MOVESET(std::string,
string, u_.string_ =
new std::string(std::move(_val));)
403MOVESET(
object,
object, u_.object_ =
new object(std::move(_val));)
412# ifdef PICOJSON_USE_INT64
413 case int64_type:
return u_.int64_ != 0;
416 default:
return true;
435 object::const_iterator i =
u_.
object_->find(key);
436 return i !=
u_.
object_->end() ? i->second : s_null;
442 object::iterator i =
u_.
object_->find(key);
443 return i !=
u_.
object_->end() ? i->second : s_null;
453 object::const_iterator i =
u_.
object_->find(key);
461# ifdef PICOJSON_USE_INT64
463 char buf[
sizeof(
"-9223372036854775808")];
473# if PICOJSON_USE_LOCALE
474 char* decimal_point = localeconv()->decimal_point;
475 if (strcmp(decimal_point,
".") != 0) {
476 size_t decimal_point_len = strlen(decimal_point);
477 for (
char*
p =
buf; *
p !=
'\0'; ++
p) {
478 if (strncmp(
p, decimal_point, decimal_point_len) == 0) {
479 return std::string(
buf,
p) +
"." + (
p + decimal_point_len);
494 return std::string();
497template <
typename Iter>
498void copy(
const std::string&
s, Iter oi) {
499 std::copy(
s.begin(),
s.end(), oi);
502template <
typename Iter>
507# define MAP(val, sym) \
508 case val: copy(sym, oi); break
519 if (
static_cast<unsigned char>(c) < 0x20 || c == 0x7f) {
531template <
typename Iter>
535 std::for_each(
s.begin(),
s.end(), process_char);
539template <
typename Iter>
541 return _serialize(oi, prettify ? 0 : -1);
544inline std::string
value::serialize(
bool prettify)
const {
return _serialize(prettify ? 0 : -1); }
546template <
typename Iter>
547void value::_indent(Iter oi,
int indent) {
549 for (
int i = 0; i < indent *
INDENT_WIDTH; ++i) { *oi++ =
' '; }
552template <
typename Iter>
553void value::_serialize(Iter oi,
int indent)
const {
561 for (array::const_iterator i =
u_.
array_->begin(); i !=
u_.
array_->end(); ++i) {
568 i->_serialize(oi, indent);
596 i->second._serialize(oi, indent);
614inline std::string value::_serialize(
int indent)
const {
616 _serialize(std::back_inserter(
s), indent);
620template <
typename Iter>
647 self->consumed_ =
false;
656 if (!(ch ==
' ' || ch ==
'\t' || ch ==
'\n' || ch ==
'\r')) {
664 if (
getc() != expected) {
670 bool match(
const std::string& pattern) {
671 for (std::string::const_iterator pi(pattern.begin()); pi != pattern.end(); ++pi) {
681template <
typename Iter>
684 for (
int i = 0; i < 4; i++) {
685 if ((hex = in.getc()) == -1) {
688 if (
'0' <= hex && hex <=
'9') {
690 }
else if (
'A' <= hex && hex <=
'F') {
692 }
else if (
'a' <= hex && hex <=
'f') {
698 uni_ch = uni_ch * 16 + hex;
703template <
typename String,
typename Iter>
709 if (0xd800 <= uni_ch && uni_ch <= 0xdfff) {
710 if (0xdc00 <= uni_ch) {
715 if (in.getc() !=
'\\' || in.getc() !=
'u') {
720 if (!(0xdc00 <= second && second <= 0xdfff)) {
723 uni_ch = ((uni_ch - 0xd800) << 10) | ((second - 0xdc00) & 0x3ff);
727 out.push_back(
static_cast<char>(uni_ch));
729 if (uni_ch < 0x800) {
730 out.push_back(
static_cast<char>(0xc0 | (uni_ch >> 6)));
732 if (uni_ch < 0x10000) {
733 out.push_back(
static_cast<char>(0xe0 | (uni_ch >> 12)));
735 out.push_back(
static_cast<char>(0xf0 | (uni_ch >> 18)));
736 out.push_back(
static_cast<char>(0x80 | ((uni_ch >> 12) & 0x3f)));
738 out.push_back(
static_cast<char>(0x80 | ((uni_ch >> 6) & 0x3f)));
740 out.push_back(
static_cast<char>(0x80 | (uni_ch & 0x3f)));
745template <
typename String,
typename Iter>
752 }
else if (ch ==
'"') {
754 }
else if (ch ==
'\\') {
755 if ((ch = in.getc()) == -1) {
759# define MAP(sym, val) \
760 case sym: out.push_back(val); break
775 default:
return false;
778 out.push_back(
static_cast<char>(ch));
784template <
typename Context,
typename Iter>
786 if (!ctx.parse_array_start()) {
790 if (in.expect(
']')) {
791 return ctx.parse_array_stop(idx);
794 if (!ctx.parse_array_item(in, idx)) {
798 }
while (in.expect(
','));
799 return in.expect(
']') && ctx.parse_array_stop(idx);
802template <
typename Context,
typename Iter>
804 if (!ctx.parse_object_start()) {
807 if (in.expect(
'}')) {
812 if (!in.expect(
'"') || !
_parse_string(key, in) || !in.expect(
':')) {
815 if (!ctx.parse_object_item(in, key)) {
818 }
while (in.expect(
','));
819 return in.expect(
'}');
822template <
typename Iter>
827 if ((
'0' <= ch && ch <=
'9') || ch ==
'+' || ch ==
'-' || ch ==
'e' || ch ==
'E') {
828 num_str.push_back(
static_cast<char>(ch));
829 }
else if (ch ==
'.') {
830# if PICOJSON_USE_LOCALE
831 num_str += localeconv()->decimal_point;
833 num_str.push_back(
'.');
843template <
typename Context,
typename Iter>
848# define IS(ch, text, op) \
850 if (in.match(text) && op) { \
855 IS(
'n',
"ull", ctx.set_null());
856 IS(
'f',
"alse", ctx.set_bool(
false));
857 IS(
't',
"rue", ctx.set_bool(
true));
859 case '"':
return ctx.parse_string(in);
863 if ((
'0' <= ch && ch <=
'9') || ch ==
'-') {
868 if (num_str.empty()) {
871# ifdef PICOJSON_USE_INT64
875 if (errno == 0 && std::numeric_limits<int64_t>::min() <= ival &&
876 ival <= std::numeric_limits<int64_t>::max() && endp == num_str.c_str() + num_str.size()) {
882 f =
strtod(num_str.c_str(), &endp);
883 if (endp == num_str.c_str() + num_str.size()) {
899# ifdef PICOJSON_USE_INT64
900 bool set_int64(
int64_t) {
return false; }
903 template <
typename Iter>
908 template <
typename Iter>
914 template <
typename Iter>
934# ifdef PICOJSON_USE_INT64
944 template <
typename Iter>
953 template <
typename Iter>
965 template <
typename Iter>
967 object& o =
out_->
get<
object>();
987# ifdef PICOJSON_USE_INT64
988 bool set_int64(
int64_t) {
return true; }
991 template <
typename Iter>
997 template <
typename Iter>
1003 template <
typename Iter>
1005 return _parse(*
this, in);
1014template <
typename Iter>
1015inline std::string
parse(
value& out, Iter& pos,
const Iter& last) {
1017 pos =
parse(out, pos, last, &err);
1021template <
typename Context,
typename Iter>
1022inline Iter
_parse(Context& ctx,
const Iter& first,
const Iter& last, std::string* err) {
1024 if (!
_parse(ctx, in) && err != NULL) {
1026 SNPRINTF(
buf,
sizeof(
buf),
"syntax error at line %d near: ", in.line());
1030 if (ch == -1 || ch ==
'\n') {
1032 }
else if (ch >=
' ') {
1033 err->push_back(
static_cast<char>(ch));
1040template <
typename Iter>
1041inline Iter
parse(
value& out,
const Iter& first,
const Iter& last, std::string* err) {
1043 return _parse(ctx, first, last, err);
1048 parse(out,
s.begin(),
s.end(), &err);
1054 parse(out, std::istreambuf_iterator<char>(is.rdbuf()), std::istreambuf_iterator<char>(), &err);
1058template <
typename T>
1060 static std::string
s;
1062template <
typename T>
1071 return y.is<
null>();
1072# define PICOJSON_CMP(type) \
1074 return y.is<type>() && x.get<type>() == y.get<type>()
1091# if !PICOJSON_USE_RVALUE_REFERENCE
1105 is.setstate(std::ios::failbit);
1115# pragma warning(pop)
1122const string test_includes =
"// Generated by spec_test_generator. DO NOT MODIFY THIS FILE.\n\n"
1123 "#include <algorithm>\n#include <vector>\n#include <iostream>\n#include "
1124 "<iterator>\n#include <cmath>\n#include <cstdlib>\n#include <catch2/catch.hpp>\n"
1125 "#include <utils.hpp>\n#include <wasm_config.hpp>\n#include "
1126 "<sysio/vm/backend.hpp>\n\nusing namespace sysio;\nusing namespace sysio::vm;\n"
1127 "extern wasm_allocator wa;\n\n";
1128const string test_preamble_0 =
"using backend_t = backend<standalone_function_t, TestType>;\n auto code = read_wasm( ";
1132 std::string result =
"\"";
1133 std::string original = x.
to_str();
1134 for(
unsigned char ch : original) {
1135 if ((
unsigned char)ch < 0x20 || (
unsigned char)ch > 0x7F) {
1139 result += (((
unsigned char)ch >> 6) & 0x07) +
'0';
1140 result += (((
unsigned char)ch >> 3) & 0x07) +
'0';
1141 result += (((
unsigned char)ch >> 0) & 0x07) +
'0';
1142 }
else if(ch ==
'\\' || ch ==
'\"') {
1151 if(original.find(
'\0') == std::string::npos)
1154 return "std::string(" + result +
", " + std::to_string(original.size()) +
")";
1160 if (expected_t ==
"i32") {
1161 ss <<
"bkend.call_with_return(\"env\", ";
1162 }
else if (expected_t ==
"i64") {
1163 ss <<
"bkend.call_with_return(\"env\", ";
1164 }
else if (expected_t ==
"f32") {
1165 ss <<
"bit_cast<uint32_t>(bkend.call_with_return(\"env\", ";
1166 }
else if (expected_t ==
"f64") {
1167 ss <<
"bit_cast<uint64_t>(bkend.call_with_return(\"env\", ";
1169 ss <<
"!bkend.call_with_return(\"env\", ";
1177 if (arg[
"type"].to_str() ==
"i32")
1178 ss <<
"UINT32_C(" << arg[
"value"].to_str() <<
")";
1179 else if (arg[
"type"].to_str() ==
"i64")
1180 ss <<
"UINT64_C(" << arg[
"value"].to_str() <<
")";
1181 else if (arg[
"type"].to_str() ==
"f32")
1182 ss <<
"bit_cast<float>(UINT32_C(" << arg[
"value"].to_str() <<
"))";
1184 ss <<
"bit_cast<double>(UINT64_C(" << arg[
"value"].to_str() <<
"))";
1186 if (expected_t ==
"i32") {
1187 ss <<
")->to_ui32() == ";
1188 ss <<
"UINT32_C(" << expected_v <<
")";
1189 }
else if (expected_t ==
"i64") {
1190 ss <<
")->to_ui64() == ";
1191 ss <<
"UINT32_C(" << expected_v <<
")";
1192 }
else if (expected_t ==
"f32") {
1193 ss <<
")->to_f32()) == ";
1194 ss <<
"UINT32_C(" << expected_v <<
")";
1195 }
else if (expected_t ==
"f64") {
1196 ss <<
")->to_f64()) == ";
1197 ss <<
"UINT64_C(" << expected_v <<
")";
1208 ss <<
"check_nan(bkend.call_with_return(\"env\", ";
1215 if (arg[
"type"].to_str() ==
"i32")
1216 ss <<
"UINT32_C(" << arg[
"value"].to_str() <<
")";
1217 else if (arg[
"type"].to_str() ==
"i64")
1218 ss <<
"UINT64_C(" << arg[
"value"].to_str() <<
")";
1219 else if (arg[
"type"].to_str() ==
"f32")
1220 ss <<
"bit_cast<float>(UINT32_C(" << arg[
"value"].to_str() <<
"))";
1222 ss <<
"bit_cast<double>(UINT64_C(" << arg[
"value"].to_str() <<
"))";
1231 ss <<
"bkend(\"env\", ";
1237 if (arg[
"type"].to_str() ==
"i32")
1238 ss <<
"UINT32_C(" << arg[
"value"].to_str() <<
")";
1239 else if (arg[
"type"].to_str() ==
"i64")
1240 ss <<
"UINT64_C(" << arg[
"value"].to_str() <<
")";
1241 else if (arg[
"type"].to_str() ==
"f32")
1242 ss <<
"bit_cast<float>(UINT32_C(" << arg[
"value"].to_str() <<
"))";
1244 ss <<
"bit_cast<double>(UINT64_C(" << arg[
"value"].to_str() <<
"))";
1246 ss <<
"), std::exception";
1253 ss <<
"bkend(\"env\", ";
1259 if (arg[
"type"].to_str() ==
"i32")
1260 ss <<
"UINT32_C(" << arg[
"value"].to_str() <<
")";
1261 else if (arg[
"type"].to_str() ==
"i64")
1262 ss <<
"UINT64_C(" << arg[
"value"].to_str() <<
")";
1263 else if (arg[
"type"].to_str() ==
"f32")
1264 ss <<
"bit_cast<float>(UINT32_C(" << arg[
"value"].to_str() <<
"))";
1266 ss <<
"bit_cast<double>(UINT64_C(" << arg[
"value"].to_str() <<
"))";
1273const std::set<std::string> blacklist = {
1275 "data.4.wasm",
"data.5.wasm",
"data.6.wasm",
"data.7.wasm",
"data.8.wasm",
"data.10.wasm",
1276 "data.13.wasm",
"data.17.wasm",
"data.19.wasm",
"data.20.wasm",
"data.21.wasm",
1277 "data.22.wasm",
"data.23.wasm",
"data.24.wasm",
"data.30.wasm",
"data.32.wasm",
"data.36.wasm",
"data.38.wasm",
1278 "elem.2.wasm",
"elem.4.wasm",
"elem.5.wasm",
"elem.6.wasm",
"elem.9.wasm",
1279 "elem.11.wasm",
"elem.14.wasm",
"elem.15.wasm",
"elem.16.wasm",
"elem.17.wasm",
"elem.23.wasm",
1280 "elem.25.wasm",
"elem.27.wasm",
"elem.29.wasm",
"elem.37.wasm",
"elem.39.wasm",
"elem.40.wasm",
1281 "func_ptrs.0.wasm",
"globals.14.wasm",
"names.3.wasm",
1282 "start.5.wasm",
"start.6.wasm",
"start.7.wasm"
1286 stringstream unit_tests;
1287 string exp_t, exp_v;
1289 auto grab_expected = [&](
auto obj) {
1290 exp_t = obj[
"type"].to_str();
1291 exp_v = obj[
"value"].to_str();
1294 for (
const auto& [tsn_file, cmds] : mappings) {
1295 if(tsn_file.empty() || blacklist.count(tsn_file))
continue;
1296 auto tsn = tsn_file;
1297 std::replace(tsn.begin(), tsn.end(),
'.',
'_');
1298 unit_tests <<
"BACKEND_TEST_CASE( \"Testing wasm <" << tsn <<
">\", \"[" << tsn <<
"_tests]\" ) {\n";
1299 unit_tests <<
" " <<
test_preamble_0 <<
"std::string(wasm_directory) + \"" << tsn_file <<
"\");\n";
1302 return (cmd[
"type"].to_str() ==
"assert_invalid" ||
1303 cmd[
"type"].to_str() ==
"assert_malformed" ||
1304 cmd[
"type"].to_str() ==
"assert_unlinkable") &&
1305 cmd[
"module_type"].to_str() ==
"binary"; }(cmds.front())) {
1306 if (
picojson::object(cmds.front())[
"type"].to_str() ==
"assert_unlinkable") {
1308 unit_tests <<
" CHECK_THROWS_AS(backend_t(code, &wa), std::exception);\n";
1310 unit_tests <<
" CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);\n";
1316 if (cmd[
"type"].to_str() ==
"assert_return") {
1317 unit_tests <<
" CHECK(";
1320 if (cmd[
"expected"].get<picojson::array>().size() > 0) {
1321 grab_expected(cmd[
"expected"].get<picojson::array>()[0].get<picojson::object>());
1322 unit_tests <<
generate_test_call(cmd[
"action"].get<picojson::object>(), exp_t, exp_v) <<
");\n";
1324 unit_tests <<
generate_test_call(cmd[
"action"].get<picojson::object>(), exp_t, exp_v) <<
");\n";
1326 }
else if (cmd[
"type"].to_str() ==
"assert_trap") {
1327 unit_tests <<
" CHECK_THROWS_AS(";
1329 }
else if (cmd[
"type"].to_str() ==
"action") {
1330 unit_tests <<
generate_call(cmd[
"action"].get<picojson::object>()) <<
";\n";
1331 }
else if (cmd[
"type"].to_str() ==
"assert_return_canonical_nan" ||
1332 cmd[
"type"].to_str() ==
"assert_return_arithmetic_nan") {
1333 unit_tests <<
" CHECK(";
1338 unit_tests <<
"}\n\n";
1339 cout << unit_tests.str();
1345 std::cerr <<
"Usage:\n"
1346 <<
" " <<
name <<
" [json file created by wast2json]\n";
1353 if(argc != 2 || !strcmp(
argv[1],
"-h") || !strcmp(
argv[1],
"--help")) {
1354 usage(argc?
argv[0]:
"spec_test_generator");
1358 std::cerr <<
"Cannot open file: " <<
argv[1] << std::endl;
1359 return EXIT_FAILURE;
1362 while (getline(ifs,
s)) ss <<
s;
1367 string test_suite_name;
1369 map<string, vector<picojson::object>> test_mappings;
1371 for (picojson::value::object::const_iterator i = obj.begin(); i != obj.end(); i++)
1372 if (i->first ==
"commands") {
1375 if (obj[
"type"].to_str() ==
"module" || obj[
"type"].to_str() ==
"assert_invalid" || (obj[
"type"].to_str() ==
"assert_malformed" && obj[
"module_type"].to_str() ==
"binary") || obj[
"type"].to_str() ==
"assert_unlinkable" ) {
1376 test_suite_name = obj[
"filename"].to_str();
1377 test_mappings[test_suite_name] = {};
1379 test_mappings[test_suite_name].push_back(obj);
bool parse_string(input< Iter > &in)
bool parse_object_start()
bool parse_array_item(input< Iter > &in, size_t)
bool set_number(double f)
bool parse_array_stop(size_t)
default_parse_context(value *out)
bool parse_object_item(input< Iter > &in, const std::string &key)
bool parse_object_item(input< Iter > &, const std::string &)
bool parse_string(input< Iter > &)
bool parse_object_start()
bool parse_array_stop(size_t)
bool parse_array_item(input< Iter > &, size_t)
bool parse_array_item(input< Iter > &in, size_t)
bool parse_array_stop(size_t)
bool parse_object_start()
bool parse_object_item(input< Iter > &in, const std::string &)
bool parse_string(input< Iter > &in)
std::string to_str() const
void serialize(Iter os, bool prettify=false) const
std::vector< value > array
bool evaluate_as_boolean() const
void swap(value &x) PICOJSON_NOEXCEPT
bool contains(const size_t idx) const
value & operator=(const value &x)
std::map< std::string, value > object
#define SET(a, b, c, d, k, s, Ti)
bool _parse_codepoint(String &out, input< Iter > &in)
void serialize_str(const std::string &s, Iter oi)
std::string parse(value &out, Iter &pos, const Iter &last)
bool _parse_object(Context &ctx, input< Iter > &in)
bool operator==(const value &x, const value &y)
void set_last_error(const std::string &s)
const std::string & get_last_error()
std::string _parse_number(input< Iter > &in)
int _parse_quadhex(input< Iter > &in)
bool _parse_string(String &out, input< Iter > &in)
void copy(const std::string &s, Iter oi)
bool _parse_array(Context &ctx, input< Iter > &in)
bool operator!=(const value &x, const value &y)
bool _parse(Context &ctx, input< Iter > &in)
std::ostream & operator<<(std::ostream &st, const std::variant< fc::alt_bn128_error, bytes > &err)
void swap(picojson::value &x, picojson::value &y)
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
#define T(meth, val, expected)
#define PICOJSON_ASSERT(e)
const string test_includes
void generate_tests(const map< string, vector< picojson::object > > &mappings)
std::string cpp_string(const picojson::value &x)
string generate_call(picojson::object obj)
string generate_test_call_nan(picojson::object obj)
string generate_test_call(picojson::object obj, string expected_t, string expected_v)
void usage(const char *name)
const string test_preamble_0
std::istream & operator>>(std::istream &is, picojson::value &x)
string generate_trap_call(picojson::object obj)
const string test_preamble_1
#define PICOJSON_CMP(type)
#define PICOJSON_NOEXCEPT