summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-02-21 04:18:06 +0100
committerStanislaw Halik <sthalik@misaki.pl>2023-02-21 04:18:06 +0100
commiteabcbed30df8ff5fdb63b5a4f844d01f436f9a2d (patch)
tree02e4bb4bad1381e61402c68592fb5cff3f53dfbf /test
parent91467e77de6ac3acff4326f4cd9d5a4390ccc3ce (diff)
wip inspector stuff
Diffstat (limited to 'test')
-rw-r--r--test/entity.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/test/entity.cpp b/test/entity.cpp
index ce7af58b..a7810863 100644
--- a/test/entity.cpp
+++ b/test/entity.cpp
@@ -168,14 +168,17 @@ void test_predicate()
constexpr auto foo = entity::type<int>::field{"foo"_s, &TestAccessors::foo, &TestAccessors::foo,
[](const TestAccessors&) { return field_status::hidden; }};
static_assert(foo.is_enabled(x) == field_status::hidden);
- fm_assert(foo.erased().is_enabled(x) == field_status::hidden);
+ fm_assert(foo.erased().is_enabled(&x) == field_status::hidden);
+
+ foo.erased().do_asserts<TestAccessors>();
+
constexpr auto foo2 = entity::type<int>::field{"foo"_s, &TestAccessors::foo, &TestAccessors::foo,
[](const TestAccessors&) { return field_status::readonly; }};
static_assert(foo2.is_enabled(x) == field_status::readonly);
- fm_assert(foo2.erased().is_enabled(x) == field_status::readonly);
+ fm_assert(foo2.erased().is_enabled(&x) == field_status::readonly);
constexpr auto foo3 = entity::type<int>::field{"foo"_s, &TestAccessors::foo, &TestAccessors::foo};
static_assert(foo3.is_enabled(x) == field_status::enabled);
- fm_assert(foo3.erased().is_enabled(x) == field_status::enabled);
+ fm_assert(foo3.erased().is_enabled(&x) == field_status::enabled);
}
constexpr bool test_names()
@@ -232,9 +235,10 @@ void test_erased_constraints()
static constexpr auto erased = foo.erased();
const auto x = TestAccessors{};
- fm_assert(erased.get_range(x) == constraints::range<int>{37, 42});
- fm_assert(erased.get_max_length(x) == 42);
- fm_assert(erased.get_group(x) == "foo"_s);
+ erased.do_asserts<TestAccessors>();
+ fm_assert(erased.get_range(&x) == constraints::range<int>{37, 42});
+ fm_assert(erased.get_max_length(&x) == 42);
+ fm_assert(erased.get_group(&x) == "foo"_s);
}
} // namespace