Initial
This commit is contained in:
parent
d4c558a59a
commit
db05d963be
74 changed files with 4473 additions and 3231 deletions
31
Containers/tests/AvlTest.cpp
Normal file
31
Containers/tests/AvlTest.cpp
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
|
||||
#include "Tests.hpp"
|
||||
|
||||
#include "AvlTree.hpp"
|
||||
|
||||
#include "Testing.hpp"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
using namespace tp;
|
||||
|
||||
TEST_DEF_STATIC(Simple) {
|
||||
AvlTree<AvlNumericKey<alni>, TestClass, TestAllocator> tree;
|
||||
|
||||
TEST(tree.size() == 0);
|
||||
TEST(tree.head() == nullptr);
|
||||
|
||||
tree.insert(6, TestClass(6));
|
||||
TEST(tree.isValid());
|
||||
TEST(tree.size() == 1);
|
||||
TEST(tree.head()->data == TestClass(6));
|
||||
|
||||
tree.remove(6);
|
||||
TEST(tree.isValid());
|
||||
TEST(tree.size() == 0);
|
||||
TEST(tree.head() == nullptr);
|
||||
}
|
||||
|
||||
TEST_DEF(Avl) {
|
||||
testSimple();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue