StackVector: Test destruction
Before this commit, only clear() was checked, destructor was not
This commit is contained in:
parent
76812510a1
commit
489e3e0b5e
|
|
@ -99,6 +99,8 @@ class DestructionCounter
|
||||||
SCENARIO("StackVector", "[CORE][STACKVECTOR]")
|
SCENARIO("StackVector", "[CORE][STACKVECTOR]")
|
||||||
{
|
{
|
||||||
GIVEN("A StackVector to contain multiple int")
|
GIVEN("A StackVector to contain multiple int")
|
||||||
|
{
|
||||||
|
std::size_t counter = 0;
|
||||||
{
|
{
|
||||||
volatile std::size_t capacity = 50;
|
volatile std::size_t capacity = 50;
|
||||||
#if USE_STD_VECTOR
|
#if USE_STD_VECTOR
|
||||||
|
|
@ -107,7 +109,6 @@ SCENARIO("StackVector", "[CORE][STACKVECTOR]")
|
||||||
#else
|
#else
|
||||||
Nz::StackVector<DestructionCounter> vector = NazaraStackVector(DestructionCounter, capacity);
|
Nz::StackVector<DestructionCounter> vector = NazaraStackVector(DestructionCounter, capacity);
|
||||||
#endif
|
#endif
|
||||||
std::size_t counter = 0;
|
|
||||||
|
|
||||||
WHEN("At construction, the vector is empty but has capacity")
|
WHEN("At construction, the vector is empty but has capacity")
|
||||||
{
|
{
|
||||||
|
|
@ -175,6 +176,7 @@ SCENARIO("StackVector", "[CORE][STACKVECTOR]")
|
||||||
|
|
||||||
CHECK(vector.empty());
|
CHECK(vector.empty());
|
||||||
CHECK(vector.size() == 0);
|
CHECK(vector.size() == 0);
|
||||||
|
CHECK(counter == 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -313,8 +315,8 @@ SCENARIO("StackVector", "[CORE][STACKVECTOR]")
|
||||||
std::array<int, 10> expectedValues = { 1, 3, 5, 7, 9, 8, 6, 4, 2, 0 };
|
std::array<int, 10> expectedValues = { 1, 3, 5, 7, 9, 8, 6, 4, 2, 0 };
|
||||||
CHECK(std::equal(vector.begin(), vector.end(), expectedValues.begin(), expectedValues.end()));
|
CHECK(std::equal(vector.begin(), vector.end(), expectedValues.begin(), expectedValues.end()));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
vector.clear();
|
|
||||||
CHECK(counter == 0);
|
CHECK(counter == 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue