2020-03-27 08:08:54 +08:00
|
|
|
// This file is not part of our main, regular tests.
|
2019-02-28 10:04:06 +08:00
|
|
|
#include "../singleheader/simdjson.h"
|
2019-06-27 07:48:51 +08:00
|
|
|
#include <iostream>
|
2019-02-28 10:04:06 +08:00
|
|
|
|
2019-07-03 04:24:56 +08:00
|
|
|
using namespace simdjson;
|
|
|
|
|
2019-02-28 10:04:06 +08:00
|
|
|
int main() {
|
2019-06-27 07:48:51 +08:00
|
|
|
const char *filename = JSON_TEST_PATH;
|
2019-05-10 05:59:51 +08:00
|
|
|
padded_string p = get_corpus(filename);
|
2020-03-27 08:08:54 +08:00
|
|
|
document::parser parser;
|
|
|
|
auto [pj, errorcode] = parser.parse(p);
|
|
|
|
if(errorcode != error_code::SUCCESS) {
|
|
|
|
std::cerr << error_message(errorcode) << std::endl;
|
2019-02-28 10:04:06 +08:00
|
|
|
return EXIT_FAILURE;
|
|
|
|
}
|
2020-03-27 08:08:54 +08:00
|
|
|
if(!pj.is_valid()) {
|
2019-03-03 06:18:45 +08:00
|
|
|
return EXIT_FAILURE;
|
|
|
|
}
|
2019-02-28 10:04:06 +08:00
|
|
|
return EXIT_SUCCESS;
|
2019-05-10 05:59:51 +08:00
|
|
|
}
|