Use correct logging labels binary tree test

This commit is contained in:
2019-05-18 13:04:18 +02:00
parent 09bda3cfa8
commit 2ce294c40b

View File

@@ -86,7 +86,7 @@ bool TestDeletion()
{
if(!tree.Contains(num))
{
std::puts("[INFO] Tree does not contain a value that it should.");
std::puts("[ERROR] Tree does not contain a value that it should.");
//std::printf("Value %u inserted but cannot be found!\n", num);
return false;
}
@@ -96,7 +96,7 @@ bool TestDeletion()
{
if(tree.Contains(num))
{
std::puts("[INFO] Tree contains deleted value that it should not.");
std::puts("[ERROR] Tree contains deleted value that it should not.");
return false;
}
}
@@ -125,7 +125,7 @@ bool TestDeletionCase(
{
if(!tree.Contains(n))
{
std::printf("\tError, tree does not contain value %u.\n", n);
std::printf("[ERROR] Tree does not contain value %u.\n", n);
ok = false;
}
}
@@ -134,7 +134,7 @@ bool TestDeletionCase(
{
if(tree.Contains(n))
{
std::printf("\tError, tree contains deleted value %u.\n", n);
std::printf("[ERROR] Tree contains deleted value %u.\n", n);
ok = false;
}
}
@@ -144,25 +144,25 @@ bool TestDeletionCase(
bool TestDeletionCases()
{
std::puts("Testing deleting root with single child right.");
std::puts("[INFO] Testing deleting root with single child right.");
TestDeletionCase(
std::vector<unsigned> { 10, 12, 11, 13},
std::vector<unsigned> { 10 },
std::vector<unsigned> { 12, 11, 13 });
std::puts("Testing deleting root with single child left.");
std::puts("[INFO] Testing deleting root with single child left.");
TestDeletionCase(
std::vector<unsigned> { 15, 12, 11, 13},
std::vector<unsigned> { 15 },
std::vector<unsigned> { 12, 11, 13 });
std::puts("Testing deleting root with 2 children but no child right left.");
std::puts("[INFO] Testing deleting root with 2 children but no child right left.");
TestDeletionCase(
std::vector<unsigned> { 15, 10, 20, 22, 25, 18, 5},
std::vector<unsigned> { 20 },
std::vector<unsigned> { 15, 10, 22, 25, 18, 5 });
std::puts("Testing deleting root with 2 children.");
std::puts("[INFO] Testing deleting root with 2 children.");
TestDeletionCase(
std::vector<unsigned> { 50, 40, 60, 75, 55, 45, 42, 58 },
std::vector<unsigned> { 50 },