cleanup after #207

This commit is contained in:
Niels 2016-02-14 18:38:29 +01:00
parent ec098ffcc2
commit 153e105164
4 changed files with 30 additions and 26 deletions

View file

@ -4,8 +4,7 @@
| | |__ | | | | | | version 2.0.0
|_____|_____|_____|_|___| https://github.com/nlohmann/json
To run under afl:
afl-fuzz -i testcases -o output ./fuzz
Run "make fuzz_testing" and follow the instructions.
Licensed under the MIT License <http://opensource.org/licenses/MIT>.
*/
@ -16,27 +15,19 @@ using json = nlohmann::json;
int main()
{
json *jp;
#ifdef __AFL_HAVE_MANUAL_CONTROL
while (__AFL_LOOP(1000)) {
while (__AFL_LOOP(1000))
{
#endif
jp = new json();
json j = *jp;
try {
j << std::cin;
} catch (std::invalid_argument e) {
std::cout << "Invalid argument in parsing" << e.what() << '\n';
}
if (j.find("foo") != j.end()) {
std::cout << "Found a foo";
}
std::cout << j.type() << j << std::endl;
delete jp;
try
{
json j(std::cin);
}
catch (std::invalid_argument &e)
{
std::cout << "Invalid argument in parsing" << e.what() << '\n';
}
#ifdef __AFL_HAVE_MANUAL_CONTROL
}
}
#endif
}