Skip to content

Commit

Permalink
✅ added progress output for Unicode tests
Browse files Browse the repository at this point in the history
Travis aborts tests if they do not produce output for 10 minutes. This commit shall fix this.
  • Loading branch information
nlohmann committed Jun 21, 2017
1 parent 6f3bebf commit 4b54335
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12914,7 +12914,7 @@ class basic_json

default:
{
// we expected a value
// the last token was unexpected; we expected a value
expect(lexer::token_type::literal_or_value);
}
}
Expand Down
7 changes: 7 additions & 0 deletions test/src/unit-unicode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,18 @@ using nlohmann::json;

#include <fstream>

size_t calls = 0;

void check_utf8string(bool success_expected, int byte1, int byte2, int byte3, int byte4);

// create and check a JSON string with up to four UTF-8 bytes
void check_utf8string(bool success_expected, int byte1, int byte2 = -1, int byte3 = -1, int byte4 = -1)
{
if (++calls % 100000 == 0)
{
std::cout << calls << " UTF-8 strings checked" << std::endl;
}

std::string json_string = "\"";

CAPTURE(byte1);
Expand Down

0 comments on commit 4b54335

Please sign in to comment.