Commit 0fcc4149 authored by Raphael Isemann's avatar Raphael Isemann

More testing and updated CMake to allow calling private functions from the tests

parent 6105ce54
......@@ -4,6 +4,9 @@ project(json)
# Enable C++11 and set flags for coverage testing
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -g -O0 --coverage -fprofile-arcs -ftest-coverage")
# Make everything public for testing purposes
add_definitions(-Dprivate=public)
# If not specified, use Debug as build type (necessary for coverage testing)
if( NOT CMAKE_BUILD_TYPE )
set( CMAKE_BUILD_TYPE Debug CACHE STRING
......
......@@ -1697,6 +1697,12 @@ TEST_CASE("Parser")
CHECK_THROWS_AS(json::parse("\"\\uD80C\\uD80C\""), std::invalid_argument);
CHECK_THROWS_AS(json::parse("\"\\uD80C\\u0000\""), std::invalid_argument);
CHECK_THROWS_AS(json::parse("\"\\uD80C\\uFFFF\""), std::invalid_argument);
// test private code point converter function
CHECK_NOTHROW(json::parser("").codePointToUTF8(0x10FFFE));
CHECK_NOTHROW(json::parser("").codePointToUTF8(0x10FFFF));
CHECK_THROWS_AS(json::parser("").codePointToUTF8(0x110000), std::invalid_argument);
CHECK_THROWS_AS(json::parser("").codePointToUTF8(0x110001), std::invalid_argument);
}
SECTION("boolean")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment