| 21 | ACTOR_TEST_SETUP() |
| 22 | |
| 23 | TEST(PluginManagerTest, Test) { |
| 24 | fixture f; |
| 25 | |
| 26 | start_logger(spdlog::level::debug); |
| 27 | |
| 28 | PluginManager pm(std::list<std::string>({{PLUGIN_DIR}})); |
| 29 | pm.load_plugins(); |
| 30 | |
| 31 | utility::Uuid test_uuid1("17e4323c-8ee7-4d9c-b74a-57ba805c10e8"); |
| 32 | utility::Uuid test_uuid2("e4e1d569-2338-4e6e-b127-5a9688df161a"); |
| 33 | |
| 34 | for (auto &i : pm.factories()) { |
| 35 | if (i.first == test_uuid1) { |
| 36 | EXPECT_EQ(i.second.factory()->uuid(), test_uuid1); |
| 37 | EXPECT_EQ(i.second.factory()->name(), "hello"); |
| 38 | } |
| 39 | if (i.first == test_uuid2) { |
| 40 | EXPECT_EQ(i.second.factory()->uuid(), test_uuid2); |
| 41 | EXPECT_EQ(i.second.factory()->name(), "template_test"); |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | auto actor1 = pm.spawn(*(f.self), test_uuid1); |
| 46 | EXPECT_TRUE(actor1); |
| 47 | if (actor1) { |
| 48 | auto name = request_receive<std::string>(*(f.self), actor1, name_atom_v); |
| 49 | EXPECT_EQ(name, "hello"); |
| 50 | } |
| 51 | |
| 52 | auto actor2 = pm.spawn(*(f.self), test_uuid2); |
| 53 | EXPECT_TRUE(actor2); |
| 54 | if (actor2) { |
| 55 | auto name = request_receive<std::string>(*(f.self), actor2, name_atom_v); |
| 56 | EXPECT_EQ(name, "hello"); |
| 57 | } |
| 58 | } |
nothing calls this directly
no test coverage detected