Skip to content

Commit f22c7d9

Browse files
committed
test: iterator concepts workarounds
1 parent 2edc59d commit f22c7d9

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

test/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,7 @@ SETUP_BASIC_TEST(
367367
NAME stl
368368
SOURCES
369369
entt/stl/functional.cpp
370+
entt/stl/iterator.cpp
370371
entt/stl/memory.cpp
371372
DEFS ENTT_USE_STL
372373
)

test/entt/stl/iterator.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#include <gtest/gtest.h>
2+
#include <entt/entity/sparse_set.hpp>
3+
#include <entt/stl/iterator.hpp>
4+
5+
TEST(Iterator, Concepts) {
6+
using iterator = typename entt::sparse_set::iterator;
7+
8+
ASSERT_TRUE(entt::stl::bidirectional_iterator<iterator>);
9+
ASSERT_TRUE(entt::stl::forward_iterator<iterator>);
10+
ASSERT_TRUE(entt::stl::input_iterator<iterator>);
11+
ASSERT_TRUE(entt::stl::input_or_output_iterator<iterator>);
12+
ASSERT_FALSE((entt::stl::output_iterator<iterator, entt::entity>));
13+
ASSERT_TRUE(entt::stl::random_access_iterator<iterator>);
14+
ASSERT_TRUE((entt::stl::sentinel_for<iterator, iterator>));
15+
}

0 commit comments

Comments
 (0)