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

#define CR_HOST
#include <gtest/gtest.h>
#include <cr.h>
#include <entt/signal/emitter.hpp>
#include "types.h"
TEST(Lib, Emitter) {
test_emitter emitter;
int value{};
ASSERT_EQ(value, 0);
emitter.once<message>([&](message msg, test_emitter &) { value = msg.payload; });
cr_plugin ctx;
cr_plugin_load(ctx, PLUGIN);
ctx.userdata = &emitter;
cr_plugin_update(ctx);
ASSERT_EQ(value, 42);
emitter = {};
cr_plugin_close(ctx);
}