util/IntrusiveSortedList: remove unused class
This commit is contained in:

committed by
Max Kellermann

parent
1ee25b4234
commit
99da022775
@@ -279,48 +279,3 @@ TEST(IntrusiveList, Sort)
|
||||
ASSERT_EQ(&*std::next(list.begin(), 1), &items[2]);
|
||||
ASSERT_EQ(&*std::next(list.begin(), 2), &items[4]);
|
||||
}
|
||||
|
||||
#include "util/IntrusiveSortedList.hxx"
|
||||
|
||||
TEST(IntrusiveSortedList, Basic)
|
||||
{
|
||||
using Item = CharItem<IntrusiveHookMode::NORMAL>;
|
||||
|
||||
struct Compare {
|
||||
constexpr bool operator()(const Item &a, const Item &b) noexcept {
|
||||
return a.ch < b.ch;
|
||||
}
|
||||
};
|
||||
|
||||
Item items[]{'z', 'a', 'b', 'q', 'b', 'c', 't', 'm', 'y'};
|
||||
|
||||
IntrusiveSortedList<Item, Compare> list;
|
||||
ASSERT_EQ(ToString(list, list.begin(), 2), "__");
|
||||
|
||||
list.insert(items[0]);
|
||||
ASSERT_EQ(ToString(list, list.begin(), 3), "z_z");
|
||||
|
||||
list.insert(items[1]);
|
||||
ASSERT_EQ(ToString(list, list.begin(), 4), "az_a");
|
||||
|
||||
list.insert(items[2]);
|
||||
ASSERT_EQ(ToString(list, list.begin(), 5), "abz_a");
|
||||
|
||||
list.insert(items[3]);
|
||||
ASSERT_EQ(ToString(list, list.begin(), 6), "abqz_a");
|
||||
|
||||
list.insert(items[4]);
|
||||
ASSERT_EQ(ToString(list, list.begin(), 7), "abbqz_a");
|
||||
|
||||
list.insert(items[5]);
|
||||
ASSERT_EQ(ToString(list, list.begin(), 8), "abbcqz_a");
|
||||
|
||||
list.insert(items[6]);
|
||||
ASSERT_EQ(ToString(list, list.begin(), 9), "abbcqtz_a");
|
||||
|
||||
list.insert(items[7]);
|
||||
ASSERT_EQ(ToString(list, list.begin(), 10), "abbcmqtz_a");
|
||||
|
||||
list.insert(items[8]);
|
||||
ASSERT_EQ(ToString(list, list.begin(), 11), "abbcmqtyz_a");
|
||||
}
|
||||
|
Reference in New Issue
Block a user