simdjson/tests/singleheadertest.cpp

21 lines
507 B
C++
Raw Normal View History

2020-03-27 08:08:54 +08:00
// This file is not part of our main, regular tests.
#include "../singleheader/simdjson.h"
#include <iostream>
using namespace simdjson;
int main() {
const char *filename = JSON_TEST_PATH;
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;
return EXIT_FAILURE;
}
2020-03-27 08:08:54 +08:00
if(!pj.is_valid()) {
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}