🛠️🐜 Antkeeper superbuild with dependencies included https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
375 B

  1. #include <gtest/gtest.h>
  2. #include <entt/core/attribute.h>
  3. #include <entt/signal/emitter.hpp>
  4. #include "types.h"
  5. ENTT_API void emit(test_emitter &);
  6. TEST(Lib, Emitter) {
  7. test_emitter emitter;
  8. int value{};
  9. ASSERT_EQ(value, 0);
  10. emitter.once<message>([&](message msg, test_emitter &) { value = msg.payload; });
  11. emit(emitter);
  12. ASSERT_EQ(value, 42);
  13. }