diff --git a/cfg/boost.cfg b/cfg/boost.cfg index fc6836da757..3a09f2a778d 100644 --- a/cfg/boost.cfg +++ b/cfg/boost.cfg @@ -35,7 +35,7 @@ - + @@ -43,7 +43,7 @@ - + @@ -51,7 +51,7 @@ - + @@ -84,6 +84,7 @@ + diff --git a/cfg/windows.cfg b/cfg/windows.cfg index a4a1a18ddc7..e061752ca66 100644 --- a/cfg/windows.cfg +++ b/cfg/windows.cfg @@ -7119,8 +7119,8 @@ HFONT CreateFont( - - + + @@ -14182,6 +14182,10 @@ HFONT CreateFont( + + + + diff --git a/test/cfg/boost.cpp b/test/cfg/boost.cpp index eb4e742227a..52d2e1be80b 100644 --- a/test/cfg/boost.cpp +++ b/test/cfg/boost.cpp @@ -17,6 +17,7 @@ #include #include #include +#include BOOST_FORCEINLINE void boost_forceinline_test() {} @@ -104,4 +105,25 @@ void lock_guard_finiteLifetime(boost::mutex& m) { // cppcheck-suppress unusedScopedObject boost::lock_guard{ m }; -} \ No newline at end of file +} + +BOOST_AUTO_TEST_SUITE(my_auto_test_suite) + +BOOST_AUTO_TEST_CASE(test_message_macros) +{ + bool my_bool = false; + BOOST_WARN_MESSAGE(my_bool, "warn"); + BOOST_CHECK_MESSAGE(my_bool, "check"); + BOOST_REQUIRE_MESSAGE(my_bool, "require"); + + BOOST_WARN_MESSAGE(my_bool, "my_bool was: " << my_bool); +} + +using test_types_w_tuples = std::tuple; +BOOST_AUTO_TEST_CASE_TEMPLATE(my_tuple_test, T, test_types_w_tuples) +{ + // cppcheck-suppress valueFlowBailoutIncompleteVar + BOOST_TEST(sizeof(T) == 4U); +} + +BOOST_AUTO_TEST_SUITE_END() \ No newline at end of file diff --git a/test/cfg/windows.cpp b/test/cfg/windows.cpp index a4885195ac9..1e25ccfd5e5 100644 --- a/test/cfg/windows.cpp +++ b/test/cfg/windows.cpp @@ -22,6 +22,26 @@ #include #include +void invalidHandle_CreateFile(LPCWSTR lpFileName) +{ + HANDLE file = CreateFile(lpFileName, GENERIC_READ, 0, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr); + + // INVALID_HANDLE_VALUE is not the same as 0 + if (file != INVALID_HANDLE_VALUE && file) {} + + // cppcheck-suppress resourceLeak +} + +void invalid_socket() +{ + SOCKET sock = socket(AF_INET, SOCK_RAW, IPPROTO_TCP); + + // INVALID_SOCKET is not the same as 0 + if (sock != INVALID_SOCKET && sock) {} + + // cppcheck-suppress resourceLeak +} + void resourceLeak_OpenThread(const DWORD dwDesiredAccess, const BOOL bInheritHandle, const DWORD dwThreadId) { HANDLE proc = OpenThread(dwDesiredAccess, bInheritHandle, dwThreadId);