/* * For fuzzing all of the implementations (haswell/fallback/westmere), * finding any difference between the output of each which would * indicate inconsistency. Also, it gets the non-default backend * some fuzzing love. * * Copyright Paul Dreik 20200912 for the simdjson project. */ #include "simdjson.h" #include #include #include "supported_implementations.h" extern "C" int VerboseTestOneInput(const uint8_t *Data, size_t Size) { static const auto supported_implementations=get_runtime_supported_implementations(); for(size_t i = 0; i <= Size; i++) { std::cout<<"size: "<supported_by_runtime_system()) { continue; } const bool current=e->validate_utf8((const char*)Data,i); std::cout<name()<<" returns "< bool { return impl->validate_utf8((const char*)Data,Size); }; auto first = supported_implementations.begin(); auto last = supported_implementations.end(); const bool reference=utf8verify(*first); bool failed=false; for(auto it=first+1; it != last; ++it) { const bool current=utf8verify(*it); if(current!=reference) { failed=true; } } if(failed) { std::cerr<supported_by_runtime_system()) { continue; } const bool current=utf8verify(e); std::cerr<name()<<" returns "<