diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2022-11-13 18:57:05 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-11-13 20:43:16 +0100 |
commit | 2f50b70891986bbb434fd211baba472025f92e53 (patch) | |
tree | 13c6d4590f2e438e2fef38ff8228a0e4b32d7d8a | |
parent | f6f16968a703dda7f66212e1527ba177dde26939 (diff) |
a
-rw-r--r-- | test/entity.cpp | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/test/entity.cpp b/test/entity.cpp index 618fb4aa..ae50853c 100644 --- a/test/entity.cpp +++ b/test/entity.cpp @@ -12,9 +12,9 @@ void test_app::test_entity() int foo = 111; int bar() const { return _bar; } void set_bar(int value) { _bar = value; } - int _baz = 222; + int _baz = 333; private: - int _bar = 333; + int _bar = 222; }; using Entity = entity<Test>; @@ -25,13 +25,23 @@ void test_app::test_entity() constexpr const auto m_baz = Entity::Field<int>::make{ "baz"_s, r_baz, w_baz }; auto x = Test{}; - fm_assert(m_foo.read(x) == 111); - fm_assert(m_bar.read(x) == 222); - fm_assert(m_baz.read(x) == 333); - m_foo.write(x, 1111); - m_bar.write(x, 2222); - m_baz.write(x, 3333); + { + auto a = m_foo.read(x); + auto b = m_bar.read(x); + auto c = m_baz.read(x); + fm_assert(a == 111 && b == 222 && c == 333); + } + + { + m_foo.write(x, 1111); + m_bar.write(x, 2222); + m_baz.write(x, 3333); + auto a = m_foo.read(x); + auto b = m_bar.read(x); + auto c = m_baz.read(x); + fm_assert(a == 1111 && b == 2222 && c == 3333); + } } } // namespace floormat |