Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .DS_Store
Binary file not shown.
9 changes: 2 additions & 7 deletions tests/UnitTests/BSTUnitTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,11 @@ class BSTUnitTest : public testing::Test
{
protected:
DoubleComparator comparator;
BinarySearchTree<double> *bst;
std::unique_ptr<BinarySearchTree<double>> bst;

void SetUp() override
{
bst = new BinarySearchTree<double>(&comparator);
}

void TearDown() override
{
delete bst;
bst = std::make_unique<BinarySearchTree<double>>(&comparator);
}
};

Expand Down
11 changes: 3 additions & 8 deletions tests/UnitTests/RBTUnitTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,11 @@
class RBTUnitTest : public testing::Test
{
protected:
RedBlackTree<double> *rbt;
std::unique_ptr<RedBlackTree<double>> rbt;

void SetUp() override
{
rbt = new RedBlackTree<double>();
}

void TearDown() override
{
delete rbt;
rbt = std::make_unique<RedBlackTree<double>>();
}
};

Expand All @@ -37,7 +32,7 @@ TEST_F(RBTUnitTest, IteratorGeneralTest)
rbt->add(7.0);

auto iter = rbt->iterator();
ASSERT_TRUE(iter != NULL);
ASSERT_TRUE(iter != nullptr);

ASSERT_TRUE(iter->hasNext());
ASSERT_DOUBLE_EQ(iter->next(), 3.0);
Expand Down
Loading