summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Pipping <sebastian@pipping.org>2021-03-29 23:30:16 +0200
committerGitHub <noreply@github.com>2021-03-29 23:30:16 +0200
commitf5682fb6dd688e6469befb7319d30e17afa6420f (patch)
tree81c6080aa413a5c130febbb516435e3b939fea8a
parent38241abd60f6a61d1d2e6ee3c0a27a22a3567434 (diff)
parenta53cbbef018d3a0ca9771a626cdfe472c8e2769f (diff)
downloaduriparser-f5682fb6dd688e6469befb7319d30e17afa6420f.tar.gz
Merge pull request #113 from uriparser/issue-113-testrunner-address-msvc-compiler-warnings
Address MSVC compiler warnings
-rw-r--r--CMakeLists.txt14
-rw-r--r--ChangeLog5
-rw-r--r--test/MemoryManagerSuite.cpp8
3 files changed, 6 insertions, 21 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 217d48a..fce0cf9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -319,19 +319,7 @@ endif()
#
if(URIPARSER_WARNINGS_AS_ERRORS)
if(MSVC)
- # NOTE: We cannot use global "add_definitions(/WX)" currently because:
- # - it would affect target "testrunner"
- # - testrunner depends on googletest
- # - googletest is not free of warnings
- # - CMake's "target_include_directories([..] SYSTEM PRIVATE [..])"
- # is not showing any effect with MSVC
- # - The equivalent of Clang's "-isystem <includedir>" is
- # marked as experimental and a dead-end street according to
- # https://developercommunity.visualstudio.com/t/fully-support-c-externali-flag-instead-of-making-i/1191080
- # so that is not used, either.
- # As a result, warnings are fatal for all target but "testrunner" as of today.
- target_compile_definitions(uriparser PRIVATE /WX) # the library
- target_compile_definitions(uriparse PRIVATE /WX) # the CLI
+ add_definitions(/WX)
else()
set(URIPARSER_EXTRA_COMPILE_FLAGS "${URIPARSER_EXTRA_COMPILE_FLAGS} -Werror")
endif()
diff --git a/ChangeLog b/ChangeLog
index 3609a07..3e7a898 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,10 +8,7 @@ XXXX-XX-XX -- X.X.X
CMAKE_CXX_* variables (GitHub #110)
Thanks to Alexander Richardson for the patch (originally at libexpat)
* Fixed: Windows: Address MSVC compiler warnings (GitHub #111)
- * Improved: Windows: Exclude target "testrunner" from
- -DURIPARSER_WARNINGS_AS_ERRORS=ON because dependency googletest
- is not free of warnings and MSVC seems to lack an equivalent
- of Clang's -isystem that is not marked experimental (GitHub #110)
+ * Fixed: Addressed MSVC compiler warnings in test suite code (GitHub #113)
2021-03-18 -- 0.9.5
diff --git a/test/MemoryManagerSuite.cpp b/test/MemoryManagerSuite.cpp
index a828d76..26e002e 100644
--- a/test/MemoryManagerSuite.cpp
+++ b/test/MemoryManagerSuite.cpp
@@ -318,11 +318,11 @@ TEST(FailingMemoryManagerSuite, DissectQueryMallocExMm) {
TEST(FailingMemoryManagerSuite, FreeQueryListMm) {
UriQueryListA * const queryList = parseQueryList("k1=v1");
FailingMemoryManager failingMemoryManager;
- ASSERT_EQ(failingMemoryManager.getCallCountFree(), 0);
+ ASSERT_EQ(failingMemoryManager.getCallCountFree(), 0U);
uriFreeQueryListMmA(queryList, &failingMemoryManager);
- ASSERT_GE(failingMemoryManager.getCallCountFree(), 1);
+ ASSERT_GE(failingMemoryManager.getCallCountFree(), 1U);
}
@@ -330,11 +330,11 @@ TEST(FailingMemoryManagerSuite, FreeQueryListMm) {
TEST(FailingMemoryManagerSuite, FreeUriMembersMm) {
UriUriA uri = parse("http://example.org/");
FailingMemoryManager failingMemoryManager;
- ASSERT_EQ(failingMemoryManager.getCallCountFree(), 0);
+ ASSERT_EQ(failingMemoryManager.getCallCountFree(), 0U);
uriFreeUriMembersMmA(&uri, &failingMemoryManager);
- ASSERT_GE(failingMemoryManager.getCallCountFree(), 1);
+ ASSERT_GE(failingMemoryManager.getCallCountFree(), 1U);
uriFreeUriMembersA(&uri);
}