From f1a44bae005d007102e28d5d9c6dfe4b6d6c444a Mon Sep 17 00:00:00 2001 From: Hans Johnson Date: Mon, 4 Nov 2019 07:35:52 -0600 Subject: [PATCH 1/3] COMP: Fix type mismatch ambiguity jsoncpp/src/test_lib_json/main.cpp:354:31: error: implicit conversion changes signedness: 'int' to 'std::__1::vector >::size_type' aka 'unsigned long') [-Werror,-Wsign-conversion] JSONTEST_ASSERT_EQUAL(vec[i], &array[i]); ~~~ ^ --- src/test_lib_json/main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test_lib_json/main.cpp b/src/test_lib_json/main.cpp index 1d636d8a0..8afed1dde 100644 --- a/src/test_lib_json/main.cpp +++ b/src/test_lib_json/main.cpp @@ -350,7 +350,7 @@ JSONTEST_FIXTURE_LOCAL(ValueTest, arrayInsertAtRandomIndex) { JSONTEST_ASSERT_EQUAL(Json::Value("index1"), array[2]); JSONTEST_ASSERT_EQUAL(Json::Value("index2"), array[3]); // checking address - for (int i = 0; i < 3; i++) { + for (Json::ArrayIndex i = 0; i < 3; i++) { JSONTEST_ASSERT_EQUAL(vec[i], &array[i]); } vec.push_back(&array[3]); @@ -362,7 +362,7 @@ JSONTEST_FIXTURE_LOCAL(ValueTest, arrayInsertAtRandomIndex) { JSONTEST_ASSERT_EQUAL(Json::Value("index1"), array[3]); JSONTEST_ASSERT_EQUAL(Json::Value("index2"), array[4]); // checking address - for (int i = 0; i < 4; i++) { + for (Json::ArrayIndex i = 0; i < 4; i++) { JSONTEST_ASSERT_EQUAL(vec[i], &array[i]); } vec.push_back(&array[4]); @@ -376,7 +376,7 @@ JSONTEST_FIXTURE_LOCAL(ValueTest, arrayInsertAtRandomIndex) { JSONTEST_ASSERT_EQUAL(Json::Value("index2"), array[4]); JSONTEST_ASSERT_EQUAL(Json::Value("index5"), array[5]); // checking address - for (int i = 0; i < 5; i++) { + for (Json::ArrayIndex i = 0; i < 5; i++) { JSONTEST_ASSERT_EQUAL(vec[i], &array[i]); } vec.push_back(&array[5]); From d76492c0e12b34053cb28ca27c729f066a763f9f Mon Sep 17 00:00:00 2001 From: Hans Johnson Date: Mon, 4 Nov 2019 07:37:19 -0600 Subject: [PATCH 2/3] COMP: Remove shadow variable warning jsoncpp/src/test_lib_json/main.cpp:2261:30: warning: declaration shadows a local variable [-Wshadow] Json::StyledStreamWriter writer; ^ jsoncpp/src/test_lib_json/main.cpp:2237:28: note: previous declaration is here Json::StyledStreamWriter writer; ^ --- src/test_lib_json/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test_lib_json/main.cpp b/src/test_lib_json/main.cpp index 8afed1dde..ad34c8ae9 100644 --- a/src/test_lib_json/main.cpp +++ b/src/test_lib_json/main.cpp @@ -2234,7 +2234,6 @@ JSONTEST_FIXTURE_LOCAL(StyledStreamWriterTest, writeNestedObjects) { } JSONTEST_FIXTURE_LOCAL(StyledStreamWriterTest, multiLineArray) { - Json::StyledStreamWriter writer; { // Array member has more than 20 print effect rendering lines const Json::String expected("[\n\t0," @@ -2268,6 +2267,7 @@ JSONTEST_FIXTURE_LOCAL(StyledStreamWriterTest, multiLineArray) { JSONTEST_ASSERT_STRING_EQUAL(expected, result); } { + Json::StyledStreamWriter writer; // Array members do not exceed 21 print effects to render a single line const Json::String expected("[ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ]\n"); Json::Value root; From 50671ddf7083ab79cd9d6e3ef5c14c43e5c16d6a Mon Sep 17 00:00:00 2001 From: Hans Johnson Date: Mon, 4 Nov 2019 07:46:51 -0600 Subject: [PATCH 3/3] ENH: Move to requiring python 3 Resolves #1081 See for more details: https://devguide.python.org/devcycle/#end-of-life-branches https://pythonclock.org/ --- src/jsontestrunner/CMakeLists.txt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/jsontestrunner/CMakeLists.txt b/src/jsontestrunner/CMakeLists.txt index 39c6f4871..210e0900b 100644 --- a/src/jsontestrunner/CMakeLists.txt +++ b/src/jsontestrunner/CMakeLists.txt @@ -1,4 +1,13 @@ -find_package(PythonInterp 2.6) +if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.12.0) + # The new Python3 module is much more robust than the previous PythonInterp + find_package (Python3 COMPONENTS Interpreter) + # Set variables for backwards compatibility with cmake < 3.12.0 + set(PYTHONINTERP_FOUND ${Python3_Interpreter_FOUND}) + set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE}) +else() + set(Python_ADDITIONAL_VERSIONS 3.8) + find_package(PythonInterp 3) +endif() add_executable(jsontestrunner_exe main.cpp