Files
simdjson-simdjson/tests/singleheadertest.cpp
T
Daniel Lemire e370a65383 Fix for issues 32, 50, 131, 137
* Improving portability.

* Revisiting faulty logic regarding same-page overruns.

* Disabling same-page overruns under VS.

* Clarifying the documentation

* Fix for issue 131 + being more explicit regarding memory realloc.

* Fix for issue 137.

* removing "using namespace std" throughout. Fix for 50

* Introducing typed malloc/free.

* Introducing a custom class (padded_string) that solves several minor usability issues.

* Updating amalgamation for testing.
2019-05-09 17:59:51 -04:00

21 lines
499 B
C++

#include <iostream>
#include "../singleheader/simdjson.h"
int main() {
const char * filename = JSON_TEST_PATH;
padded_string p = get_corpus(filename);
ParsedJson pj = build_parsed_json(p); // do the parsing
if( ! pj.isValid() ) {
return EXIT_FAILURE;
}
if( ! pj.allocateCapacity(p.size()) ) {
return EXIT_FAILURE;
}
const int res = json_parse(p, pj);
if (res) {
std::cerr << simdjson::errorMsg(res) << std::endl;
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}