diff options
Diffstat (limited to 'test/entity.cpp')
-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 |