|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Exhaustive tests for Dlink class. More...
#include <gtest/gtest.h>#include <vector>#include <algorithm>#include <random>#include <dlink.H>Go to the source code of this file.
Classes | |
| class | DlinkBasicTest |
| class | DlinkStackTest |
| class | DlinkInsertAppendTest |
| class | DlinkSwapTest |
| class | DlinkListOperationsTest |
| class | DlinkReverseTest |
| class | DlinkRotationTest |
| class | DlinkIteratorTest |
Functions | |
| TEST_F (DlinkBasicTest, DefaultConstructorCreatesEmptyList) | |
| TEST_F (DlinkBasicTest, CopyConstructorOfEmptyList) | |
| TEST_F (DlinkBasicTest, MoveConstructorOfEmptyList) | |
| TEST_F (DlinkBasicTest, ResetClearsNode) | |
| TEST_F (DlinkBasicTest, InitIsAliasForReset) | |
| TEST_F (DlinkStackTest, TopOnEmptyStackThrowsCorrectMessage) | |
| TEST_F (DlinkStackTest, PopOnEmptyStackThrowsCorrectMessage) | |
| TEST_F (DlinkStackTest, PushAndPopSequence) | |
| TEST_F (DlinkStackTest, AlternatingPushPop) | |
| TEST_F (DlinkInsertAppendTest, InsertOnEmptyList) | |
| TEST_F (DlinkInsertAppendTest, AppendOnEmptyList) | |
| TEST_F (DlinkInsertAppendTest, InsertMaintainsOrder) | |
| TEST_F (DlinkInsertAppendTest, AppendMaintainsOrder) | |
| TEST_F (DlinkInsertAppendTest, MixedInsertAndAppend) | |
| TEST_F (DlinkSwapTest, SwapBetweenEmptyLists) | |
| TEST_F (DlinkSwapTest, SwapEmptyWithNonEmpty) | |
| TEST_F (DlinkSwapTest, SwapNonEmptyWithEmpty) | |
| TEST_F (DlinkSwapTest, SwapBetweenNonEmptyLists) | |
| TEST_F (DlinkSwapTest, SwapWithReferenceOverload) | |
| TEST_F (DlinkListOperationsTest, ConcatListEmptyToEmpty) | |
| TEST_F (DlinkListOperationsTest, ConcatListNonEmptyToEmpty) | |
| TEST_F (DlinkListOperationsTest, ConcatListEmptyToNonEmpty) | |
| TEST_F (DlinkListOperationsTest, ConcatListBothNonEmpty) | |
| TEST_F (DlinkListOperationsTest, InsertListEmpty) | |
| TEST_F (DlinkListOperationsTest, InsertListInMiddle) | |
| TEST_F (DlinkListOperationsTest, AppendListEmpty) | |
| TEST_F (DlinkListOperationsTest, SplitEmptyList) | |
| TEST_F (DlinkListOperationsTest, SplitUnitaryList) | |
| TEST_F (DlinkListOperationsTest, SplitEvenList) | |
| TEST_F (DlinkListOperationsTest, SplitOddList) | |
| TEST_F (DlinkListOperationsTest, CutListAtFirst) | |
| TEST_F (DlinkListOperationsTest, CutListAtLast) | |
| TEST_F (DlinkListOperationsTest, CutListInMiddle) | |
| TEST_F (DlinkReverseTest, ReverseEmptyList) | |
| TEST_F (DlinkReverseTest, ReverseUnitaryList) | |
| TEST_F (DlinkReverseTest, ReverseTwoElements) | |
| TEST_F (DlinkReverseTest, ReverseMultipleElements) | |
| TEST_F (DlinkReverseTest, DoubleReverseRestoresOrder) | |
| TEST_F (DlinkRotationTest, RotateLeftZero) | |
| TEST_F (DlinkRotationTest, RotateLeftOne) | |
| TEST_F (DlinkRotationTest, RotateLeftFullCycle) | |
| TEST_F (DlinkRotationTest, RotateRightOne) | |
| TEST_F (DlinkRotationTest, RotateEmptyListThrows) | |
| TEST_F (DlinkIteratorTest, IteratorOnEmptyList) | |
| TEST_F (DlinkIteratorTest, IteratorForwardTraversal) | |
| TEST_F (DlinkIteratorTest, IteratorBackwardTraversal) | |
| TEST_F (DlinkIteratorTest, IteratorDeleteAllElements) | |
| TEST_F (DlinkIteratorTest, IteratorDeleteMiddleElement) | |
| TEST_F (DlinkIteratorTest, IteratorIsFirstAndIsLast) | |
| TEST_F (DlinkIteratorTest, IteratorEqualityOperators) | |
| TEST (DlinkConsistency, CheckEmptyList) | |
| TEST (DlinkConsistency, CheckAfterOperations) | |
| TEST (DlinkStress, LargeListOperations) | |
| TEST (DlinkStress, RandomOperations) | |
| TEST (DlinkMoveSemantics, MoveConstructor) | |
| TEST (DlinkMoveSemantics, MoveAssignment) | |
| TEST (DlinkEdgeCases, SelfSwap) | |
| TEST (DlinkEdgeCases, RemoveOnlyElement) | |
| TEST (DlinkEdgeCases, IteratorOnUnitaryList) | |
| TEST (DlinkStress, MassiveListOperations) | |
| TEST (DlinkStress, RepeatedSplitConcat) | |
| TEST (DlinkFuzz, RandomInsertRemoveOperations) | |
| TEST (DlinkStress, RotationStress) | |
| TEST (DlinkStress, IteratorDeletionUnderStress) | |
Exhaustive tests for Dlink class.
These tests cover all operations of Dlink including edge cases and the bug fixes made to the class.
Definition in file dlink_test.cc.
| TEST | ( | DlinkConsistency | , |
| CheckAfterOperations | |||
| ) |
Definition at line 811 of file dlink_test.cc.
References Aleph::Dlink::append(), Aleph::Dlink::check(), l, Aleph::maps(), nodes, Aleph::Dlink::reverse_list(), Aleph::Dlink::rotate_left(), and Aleph::Dlink::split_list().
| TEST | ( | DlinkConsistency | , |
| CheckEmptyList | |||
| ) |
Definition at line 805 of file dlink_test.cc.
References Aleph::Dlink::check(), and Aleph::maps().
| TEST | ( | DlinkEdgeCases | , |
| IteratorOnUnitaryList | |||
| ) |
Definition at line 1002 of file dlink_test.cc.
References Aleph::Dlink::append(), Aleph::Dlink::Iterator::get_curr(), Aleph::Dlink::Iterator::has_curr(), Aleph::Dlink::Iterator::is_in_first(), Aleph::Dlink::Iterator::is_last(), Aleph::maps(), and Aleph::Dlink::Iterator::next().
| TEST | ( | DlinkEdgeCases | , |
| RemoveOnlyElement | |||
| ) |
Definition at line 989 of file dlink_test.cc.
References Aleph::Dlink::append(), Aleph::Dlink::is_empty(), Aleph::Dlink::is_unitarian(), Aleph::maps(), and Aleph::Dlink::remove_first().
| TEST | ( | DlinkEdgeCases | , |
| SelfSwap | |||
| ) |
Definition at line 974 of file dlink_test.cc.
References Aleph::Dlink::append(), Aleph::Dlink::get_first(), Aleph::Dlink::get_last(), Aleph::Dlink::is_empty(), Aleph::maps(), and Aleph::Dlink::swap().
| TEST | ( | DlinkFuzz | , |
| RandomInsertRemoveOperations | |||
| ) |
Definition at line 1094 of file dlink_test.cc.
References Aleph::Dlink::append(), Aleph::Dlink::check(), Aleph::Dlink::Iterator::has_curr(), Aleph::Dlink::insert(), Aleph::Dlink::is_empty(), Aleph::maps(), N, nodes, Aleph::Dlink::remove_first(), Aleph::Dlink::remove_last(), Aleph::Dlink::reverse_list(), and rng.
| TEST | ( | DlinkMoveSemantics | , |
| MoveAssignment | |||
| ) |
Definition at line 954 of file dlink_test.cc.
References Aleph::Dlink::append(), Aleph::Dlink::get_first(), Aleph::Dlink::get_last(), Aleph::Dlink::is_empty(), and Aleph::maps().
| TEST | ( | DlinkMoveSemantics | , |
| MoveConstructor | |||
| ) |
Definition at line 938 of file dlink_test.cc.
References Aleph::Dlink::append(), Aleph::DynList< T >::get_first(), Aleph::DynList< T >::get_last(), Aleph::Dlink::is_empty(), Aleph::HTList::is_empty(), and Aleph::maps().
| TEST | ( | DlinkStress | , |
| IteratorDeletionUnderStress | |||
| ) |
Definition at line 1206 of file dlink_test.cc.
References Aleph::Dlink::append(), Aleph::Dlink::check(), Aleph::count(), Aleph::Dlink::Iterator::del(), Aleph::Dlink::Iterator::has_curr(), Aleph::maps(), N, Aleph::Dlink::Iterator::next(), and nodes.
| TEST | ( | DlinkStress | , |
| LargeListOperations | |||
| ) |
Definition at line 837 of file dlink_test.cc.
References Aleph::Dlink::append(), Aleph::Dlink::check(), Aleph::HTList::concat_list(), Aleph::count(), Aleph::Dlink::is_empty(), l, Aleph::maps(), N, nodes, Aleph::Dlink::reverse_list(), and Aleph::Dlink::split_list().
| TEST | ( | DlinkStress | , |
| MassiveListOperations | |||
| ) |
Definition at line 1022 of file dlink_test.cc.
References Aleph::Dlink::append(), Aleph::Dlink::check(), Aleph::count(), Aleph::Dlink::get_first(), Aleph::Dlink::get_last(), Aleph::Dlink::Iterator::has_curr(), Aleph::Dlink::is_empty(), Aleph::maps(), N, nodes, Aleph::Dlink::remove_first(), and Aleph::Dlink::reverse_list().
| TEST | ( | DlinkStress | , |
| RandomOperations | |||
| ) |
Definition at line 866 of file dlink_test.cc.
References Aleph::Dlink::append(), Aleph::Dlink::check(), Aleph::Dlink::insert(), Aleph::Dlink::is_empty(), Aleph::maps(), N, nodes, Aleph::Dlink::remove_first(), Aleph::Dlink::remove_last(), and rng.
| TEST | ( | DlinkStress | , |
| RepeatedSplitConcat | |||
| ) |
Definition at line 1056 of file dlink_test.cc.
References Aleph::Dlink::append(), Aleph::Dlink::check(), Aleph::Dlink::concat_list(), Aleph::HTList::concat_list(), Aleph::Dlink::is_empty(), l, Aleph::maps(), N, nodes, rng, Aleph::Dlink::split_list(), and Aleph::Dlink::swap().
| TEST | ( | DlinkStress | , |
| RotationStress | |||
| ) |
Definition at line 1181 of file dlink_test.cc.
References Aleph::Dlink::append(), Aleph::Dlink::check(), Aleph::maps(), N, nodes, Aleph::Dlink::rotate_left(), and Aleph::Dlink::rotate_right().
| TEST_F | ( | DlinkBasicTest | , |
| CopyConstructorOfEmptyList | |||
| ) |
Definition at line 70 of file dlink_test.cc.
References Aleph::copy(), and Aleph::maps().
| TEST_F | ( | DlinkBasicTest | , |
| DefaultConstructorCreatesEmptyList | |||
| ) |
Definition at line 61 of file dlink_test.cc.
References Aleph::maps().
| TEST_F | ( | DlinkBasicTest | , |
| InitIsAliasForReset | |||
| ) |
Definition at line 94 of file dlink_test.cc.
References Aleph::Dlink::get_next(), Aleph::Dlink::get_prev(), Aleph::Dlink::init(), Aleph::Dlink::is_empty(), and Aleph::maps().
| TEST_F | ( | DlinkBasicTest | , |
| MoveConstructorOfEmptyList | |||
| ) |
Definition at line 78 of file dlink_test.cc.
References Aleph::HTList::is_empty(), and Aleph::maps().
| TEST_F | ( | DlinkBasicTest | , |
| ResetClearsNode | |||
| ) |
Definition at line 85 of file dlink_test.cc.
References Aleph::Dlink::get_next(), Aleph::Dlink::get_prev(), Aleph::Dlink::is_empty(), Aleph::maps(), and Aleph::Dlink::reset().
| TEST_F | ( | DlinkInsertAppendTest | , |
| AppendMaintainsOrder | |||
| ) |
Definition at line 238 of file dlink_test.cc.
References Aleph::Dlink::Iterator::get_curr(), Aleph::maps(), Aleph::Dlink::Iterator::next(), and nodes.
| TEST_F | ( | DlinkInsertAppendTest | , |
| AppendOnEmptyList | |||
| ) |
Definition at line 217 of file dlink_test.cc.
References Aleph::maps(), and nodes.
| TEST_F | ( | DlinkInsertAppendTest | , |
| InsertMaintainsOrder | |||
| ) |
Definition at line 226 of file dlink_test.cc.
References Aleph::Dlink::Iterator::get_curr(), Aleph::maps(), Aleph::Dlink::Iterator::next(), and nodes.
| TEST_F | ( | DlinkInsertAppendTest | , |
| InsertOnEmptyList | |||
| ) |
Definition at line 208 of file dlink_test.cc.
References Aleph::maps(), and nodes.
| TEST_F | ( | DlinkInsertAppendTest | , |
| MixedInsertAndAppend | |||
| ) |
Definition at line 250 of file dlink_test.cc.
References Aleph::Dlink::Iterator::get_curr(), Aleph::maps(), Aleph::Dlink::Iterator::next(), and nodes.
| TEST_F | ( | DlinkIteratorTest | , |
| IteratorBackwardTraversal | |||
| ) |
Definition at line 720 of file dlink_test.cc.
References Aleph::count(), Aleph::Dlink::Iterator::get_curr(), Aleph::Dlink::Iterator::has_curr(), Aleph::maps(), nodes, Aleph::Dlink::Iterator::prev(), and Aleph::Dlink::Iterator::reset_last().
| TEST_F | ( | DlinkIteratorTest | , |
| IteratorDeleteAllElements | |||
| ) |
Definition at line 738 of file dlink_test.cc.
References Aleph::Dlink::Iterator::del(), Aleph::Dlink::Iterator::has_curr(), Aleph::maps(), and nodes.
| TEST_F | ( | DlinkIteratorTest | , |
| IteratorDeleteMiddleElement | |||
| ) |
Definition at line 750 of file dlink_test.cc.
References Aleph::Dlink::Iterator::del(), Aleph::Dlink::Iterator::get_curr(), Aleph::Dlink::Iterator::has_curr(), Aleph::maps(), Aleph::Dlink::Iterator::next(), and nodes.
| TEST_F | ( | DlinkIteratorTest | , |
| IteratorEqualityOperators | |||
| ) |
Definition at line 785 of file dlink_test.cc.
References Aleph::maps(), Aleph::Dlink::Iterator::next(), and nodes.
| TEST_F | ( | DlinkIteratorTest | , |
| IteratorForwardTraversal | |||
| ) |
Definition at line 708 of file dlink_test.cc.
References Aleph::count(), Aleph::Dlink::Iterator::has_curr(), Aleph::maps(), and nodes.
| TEST_F | ( | DlinkIteratorTest | , |
| IteratorIsFirstAndIsLast | |||
| ) |
Definition at line 767 of file dlink_test.cc.
References Aleph::Dlink::Iterator::is_in_first(), Aleph::Dlink::Iterator::is_last(), Aleph::maps(), Aleph::Dlink::Iterator::next(), and nodes.
| TEST_F | ( | DlinkIteratorTest | , |
| IteratorOnEmptyList | |||
| ) |
Definition at line 699 of file dlink_test.cc.
References Aleph::Dlink::Iterator::get_curr(), Aleph::Dlink::Iterator::has_curr(), Aleph::maps(), Aleph::Dlink::Iterator::next(), and Aleph::Dlink::Iterator::prev().
| TEST_F | ( | DlinkListOperationsTest | , |
| AppendListEmpty | |||
| ) |
Definition at line 446 of file dlink_test.cc.
References Aleph::maps(), and nodes.
| TEST_F | ( | DlinkListOperationsTest | , |
| ConcatListBothNonEmpty | |||
| ) |
Definition at line 394 of file dlink_test.cc.
References Aleph::Dlink::Iterator::get_curr(), Aleph::maps(), Aleph::Dlink::Iterator::next(), and nodes.
| TEST_F | ( | DlinkListOperationsTest | , |
| ConcatListEmptyToEmpty | |||
| ) |
Definition at line 363 of file dlink_test.cc.
References Aleph::maps().
| TEST_F | ( | DlinkListOperationsTest | , |
| ConcatListEmptyToNonEmpty | |||
| ) |
Definition at line 382 of file dlink_test.cc.
References Aleph::maps(), and nodes.
| TEST_F | ( | DlinkListOperationsTest | , |
| ConcatListNonEmptyToEmpty | |||
| ) |
Definition at line 370 of file dlink_test.cc.
References Aleph::maps(), and nodes.
| TEST_F | ( | DlinkListOperationsTest | , |
| CutListAtFirst | |||
| ) |
Definition at line 504 of file dlink_test.cc.
References Aleph::Dlink::cut_list(), Aleph::Dlink::get_first(), Aleph::Dlink::get_last(), Aleph::maps(), and nodes.
| TEST_F | ( | DlinkListOperationsTest | , |
| CutListAtLast | |||
| ) |
Definition at line 515 of file dlink_test.cc.
References Aleph::Dlink::cut_list(), Aleph::Dlink::get_first(), Aleph::Dlink::is_unitarian(), Aleph::maps(), and nodes.
| TEST_F | ( | DlinkListOperationsTest | , |
| CutListInMiddle | |||
| ) |
Definition at line 528 of file dlink_test.cc.
References Aleph::Dlink::cut_list(), Aleph::Dlink::get_first(), Aleph::Dlink::get_last(), Aleph::maps(), and nodes.
| TEST_F | ( | DlinkListOperationsTest | , |
| InsertListEmpty | |||
| ) |
Definition at line 411 of file dlink_test.cc.
References Aleph::maps(), and nodes.
| TEST_F | ( | DlinkListOperationsTest | , |
| InsertListInMiddle | |||
| ) |
Definition at line 422 of file dlink_test.cc.
References Aleph::Dlink::Iterator::get_curr(), Aleph::maps(), Aleph::Dlink::Iterator::next(), and nodes.
| TEST_F | ( | DlinkListOperationsTest | , |
| SplitEmptyList | |||
| ) |
Definition at line 457 of file dlink_test.cc.
References Aleph::count(), Aleph::Dlink::is_empty(), Aleph::HTList::is_empty(), l, Aleph::maps(), and Aleph::HTList::split_list().
| TEST_F | ( | DlinkListOperationsTest | , |
| SplitEvenList | |||
| ) |
Definition at line 480 of file dlink_test.cc.
References Aleph::count(), Aleph::Dlink::is_empty(), Aleph::HTList::is_empty(), l, Aleph::maps(), and Aleph::HTList::split_list().
| TEST_F | ( | DlinkListOperationsTest | , |
| SplitOddList | |||
| ) |
Definition at line 493 of file dlink_test.cc.
References Aleph::count(), l, Aleph::maps(), and Aleph::HTList::split_list().
| TEST_F | ( | DlinkListOperationsTest | , |
| SplitUnitaryList | |||
| ) |
Definition at line 467 of file dlink_test.cc.
References Aleph::count(), Aleph::Dlink::is_empty(), Aleph::HTList::is_empty(), l, Aleph::maps(), nodes, and Aleph::HTList::split_list().
| TEST_F | ( | DlinkReverseTest | , |
| DoubleReverseRestoresOrder | |||
| ) |
Definition at line 599 of file dlink_test.cc.
References Aleph::Dlink::Iterator::get_curr(), Aleph::maps(), Aleph::Dlink::Iterator::next(), and nodes.
| TEST_F | ( | DlinkReverseTest | , |
| ReverseEmptyList | |||
| ) |
Definition at line 556 of file dlink_test.cc.
References Aleph::count(), and Aleph::maps().
| TEST_F | ( | DlinkReverseTest | , |
| ReverseMultipleElements | |||
| ) |
Definition at line 582 of file dlink_test.cc.
References Aleph::count(), Aleph::Dlink::Iterator::get_curr(), Aleph::maps(), Aleph::Dlink::Iterator::next(), and nodes.
| TEST_F | ( | DlinkReverseTest | , |
| ReverseTwoElements | |||
| ) |
Definition at line 571 of file dlink_test.cc.
References Aleph::maps(), and nodes.
| TEST_F | ( | DlinkReverseTest | , |
| ReverseUnitaryList | |||
| ) |
Definition at line 563 of file dlink_test.cc.
References Aleph::count(), Aleph::maps(), and nodes.
| TEST_F | ( | DlinkRotationTest | , |
| RotateEmptyListThrows | |||
| ) |
Definition at line 674 of file dlink_test.cc.
References Aleph::maps(), Aleph::Dlink::rotate_left(), and Aleph::Dlink::rotate_right().
| TEST_F | ( | DlinkRotationTest | , |
| RotateLeftFullCycle | |||
| ) |
Definition at line 655 of file dlink_test.cc.
References Aleph::Dlink::Iterator::get_curr(), Aleph::maps(), Aleph::Dlink::Iterator::next(), and nodes.
| TEST_F | ( | DlinkRotationTest | , |
| RotateLeftOne | |||
| ) |
Definition at line 639 of file dlink_test.cc.
References Aleph::Dlink::Iterator::get_curr(), Aleph::maps(), Aleph::Dlink::Iterator::next(), and nodes.
| TEST_F | ( | DlinkRotationTest | , |
| RotateLeftZero | |||
| ) |
Definition at line 630 of file dlink_test.cc.
References Aleph::Dlink::Iterator::get_curr(), Aleph::maps(), Aleph::Dlink::Iterator::next(), and nodes.
| TEST_F | ( | DlinkRotationTest | , |
| RotateRightOne | |||
| ) |
Definition at line 664 of file dlink_test.cc.
References Aleph::Dlink::Iterator::get_curr(), Aleph::maps(), Aleph::Dlink::Iterator::next(), and nodes.
| TEST_F | ( | DlinkStackTest | , |
| AlternatingPushPop | |||
| ) |
Definition at line 176 of file dlink_test.cc.
References Aleph::maps().
| TEST_F | ( | DlinkStackTest | , |
| PopOnEmptyStackThrowsCorrectMessage | |||
| ) |
Definition at line 133 of file dlink_test.cc.
References FAIL, and Aleph::maps().
| TEST_F | ( | DlinkStackTest | , |
| PushAndPopSequence | |||
| ) |
Definition at line 152 of file dlink_test.cc.
References Aleph::maps(), and Aleph::DynList< T >::push().
| TEST_F | ( | DlinkStackTest | , |
| TopOnEmptyStackThrowsCorrectMessage | |||
| ) |
Definition at line 114 of file dlink_test.cc.
References FAIL, and Aleph::maps().
| TEST_F | ( | DlinkSwapTest | , |
| SwapBetweenEmptyLists | |||
| ) |
Definition at line 278 of file dlink_test.cc.
References Aleph::maps(), and Aleph::Dlink::swap().
| TEST_F | ( | DlinkSwapTest | , |
| SwapBetweenNonEmptyLists | |||
| ) |
Definition at line 312 of file dlink_test.cc.
References Aleph::maps().
| TEST_F | ( | DlinkSwapTest | , |
| SwapEmptyWithNonEmpty | |||
| ) |
Definition at line 285 of file dlink_test.cc.
References Aleph::maps().
| TEST_F | ( | DlinkSwapTest | , |
| SwapNonEmptyWithEmpty | |||
| ) |
Definition at line 299 of file dlink_test.cc.
References Aleph::maps().
| TEST_F | ( | DlinkSwapTest | , |
| SwapWithReferenceOverload | |||
| ) |
Definition at line 330 of file dlink_test.cc.
References Aleph::maps().