Mon, 18 Apr 2022 14:35:41 +0200
add [[maybe_unused]] attributed to params of mocked function
test/CMakeLists.txt | file | annotate | diff | comparison | revisions | |
test/test_allocator.cpp | file | annotate | diff | comparison | revisions |
1.1 --- a/test/CMakeLists.txt Sat Apr 16 22:12:47 2022 +0200 1.2 +++ b/test/CMakeLists.txt Mon Apr 18 14:35:41 2022 +0200 1.3 @@ -1,5 +1,5 @@ 1.4 # Load Google Test Framework 1.5 -set(CMAKE_CXX_STANDARD 11) 1.6 +set(CMAKE_CXX_STANDARD 17) 1.7 1.8 include(FetchContent) 1.9 FetchContent_Declare(
2.1 --- a/test/test_allocator.cpp Sat Apr 16 22:12:47 2022 +0200 2.2 +++ b/test/test_allocator.cpp Mon Apr 18 14:35:41 2022 +0200 2.3 @@ -76,7 +76,11 @@ 2.4 TEST(Allocator, FailingReallocate) { 2.5 // Mock an allocator that always returns nullptr on realloc 2.6 cx_allocator_class mock_cl; 2.7 - mock_cl.realloc = [](void* p, void* d, size_t n) -> void* { return nullptr; }; 2.8 + mock_cl.realloc = []( 2.9 + [[maybe_unused]]void *p, 2.10 + [[maybe_unused]]void *d, 2.11 + [[maybe_unused]]size_t n 2.12 + ) -> void * { return nullptr; }; 2.13 cx_allocator_s mock{&mock_cl, nullptr}; 2.14 2.15 void *test = calloc(8, 1);