Format source files

This commit is contained in:
2023-02-18 10:37:38 +01:00
parent 76d93bb1cf
commit d09d4d3d92
12 changed files with 793 additions and 850 deletions

View File

@@ -4,32 +4,32 @@
bool TestStack()
{
std::size_t testSize = 512ul;
std::size_t testSize = 512ul;
std::stack<unsigned> truth;
Stack<unsigned> stack;
std::stack<unsigned> truth;
Stack<unsigned> stack;
for(std::size_t i = 0; i < testSize; ++i)
{
unsigned const toInsert = Util::GetRandomNumber();
truth.push(toInsert);
stack.Push(toInsert);
}
for(std::size_t i = 0; i < testSize; ++i)
{
unsigned const toInsert = Util::GetRandomNumber();
truth.push(toInsert);
stack.Push(toInsert);
}
while(!truth.empty())
{
if(truth.top() != stack.Pop())
{
return false;
}
truth.pop();
}
while(!truth.empty())
{
if(truth.top() != stack.Pop())
{
return false;
}
truth.pop();
}
return true;
return true;
}
int main()
{
Test::Execute(TestStack, "Pop push test");
return 0;
Test::Execute(TestStack, "Pop push test");
return 0;
}