diff options
author | Brian Gianforcaro <bgianf@serenityos.org> | 2021-06-03 03:19:23 -0700 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-06-03 13:27:40 +0200 |
commit | ce74fce0df94787b143866c03fe96757adf4c6ce (patch) | |
tree | e41b606b66e903e16b7113a34d41e638bf53c53a /Tests/AK/TestIntrusiveList.cpp | |
parent | ef4fdcf76fd8c53bbdd4f1ad7d9009292b5846b5 (diff) | |
download | serenity-ce74fce0df94787b143866c03fe96757adf4c6ce.zip |
Tests: Add test coverage for AK::IntrusiveList reverse iterator support
Diffstat (limited to 'Tests/AK/TestIntrusiveList.cpp')
-rw-r--r-- | Tests/AK/TestIntrusiveList.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Tests/AK/TestIntrusiveList.cpp b/Tests/AK/TestIntrusiveList.cpp index f75db9afb7..005642a9b6 100644 --- a/Tests/AK/TestIntrusiveList.cpp +++ b/Tests/AK/TestIntrusiveList.cpp @@ -47,6 +47,13 @@ TEST_CASE(enumeration) actual_size++; } EXPECT_EQ(expected_size, actual_size); + + size_t reverse_actual_size = 0; + for (auto it = list.rbegin(); it != list.rend(); ++it) { + reverse_actual_size++; + } + EXPECT_EQ(expected_size, reverse_actual_size); + while (auto elem = list.take_first()) { delete elem; } |