diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2022-11-18 10:20:58 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-11-18 10:27:54 +0100 |
commit | 14d316a0261fb2a3541d27790cb7dc58e40de35c (patch) | |
tree | 4a864228a707cde7aa9aa612667751586f49c095 /test | |
parent | 4cf0ac3bcd8a2aa480a29ef43f2cca88c190d874 (diff) |
add template interface to erased accessor
Diffstat (limited to 'test')
-rw-r--r-- | test/entity.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/entity.cpp b/test/entity.cpp index 72b0a598..d8255e26 100644 --- a/test/entity.cpp +++ b/test/entity.cpp @@ -122,6 +122,8 @@ static void test_metadata() int bar_ = 2; bar2.write_fun(&x, bar2.writer, &bar_); fm_assert(x.bar() == 2); + baz2.write<TestAccessors, int>(x, 3); + fm_assert(baz2.read<TestAccessors, int>(x) == 3); } static void test_type_name() @@ -130,6 +132,9 @@ static void test_type_name() struct foobar; constexpr StringView name = name_of<foobar>; fm_assert(name.contains("foobar"_s)); + static_assert(name.data() == name_of<foobar>.data()); + static_assert(name_of<int> != name_of<unsigned>); + static_assert(name_of<foobar*> != name_of<const foobar*>); } void test_app::test_entity() |