🛠️🐜 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.

26 lines
474 B

  1. #define CR_HOST
  2. #include <gtest/gtest.h>
  3. #include <cr.h>
  4. #include <entt/signal/emitter.hpp>
  5. #include "types.h"
  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. cr_plugin ctx;
  12. cr_plugin_load(ctx, PLUGIN);
  13. ctx.userdata = &emitter;
  14. cr_plugin_update(ctx);
  15. ASSERT_EQ(value, 42);
  16. emitter = {};
  17. cr_plugin_close(ctx);
  18. }