fixinf maybe_unused in unit test
This commit is contained in:
parent
04a5ec12f9
commit
0a3b42fdf9
@ -292,14 +292,12 @@ struct NAlloc
|
||||
|
||||
pointer allocate(std::size_t n)
|
||||
{
|
||||
|
||||
m_alloc_size = n;
|
||||
|
||||
return static_cast<pointer>(alloc.allocate(n)); // get memory from pool
|
||||
}
|
||||
void deallocate(pointer p, [[maybe_unused]] std::size_t n)
|
||||
{
|
||||
|
||||
|
||||
m_alloc_size = n;
|
||||
alloc.deallocate(static_cast<pointer>(p), 1); // return memory to pool
|
||||
}
|
||||
|
||||
@ -344,15 +342,7 @@ TEST_CASE("controlled bad_alloc_rt_string")
|
||||
|
||||
SECTION("json_value(value_t)")
|
||||
{
|
||||
SECTION("object")
|
||||
{
|
||||
next_construct_fails = false;
|
||||
auto t = my_json::value_t::object;
|
||||
CHECK_NOTHROW(my_allocator_clean_up(my_json::json_value(t).object));
|
||||
next_construct_fails = true;
|
||||
CHECK_THROWS_AS(my_json::json_value(t), std::bad_alloc&);
|
||||
next_construct_fails = false;
|
||||
}
|
||||
|
||||
SECTION("array")
|
||||
{
|
||||
next_construct_fails = false;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user