MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/xstudio / TEST

Function TEST

src/plugin_manager/test/plugin_manager_test.cpp:23–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21ACTOR_TEST_SETUP()
22
23TEST(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}

Callers

nothing calls this directly

Calls 5

load_pluginsMethod · 0.80
factoryMethod · 0.80
uuidMethod · 0.45
nameMethod · 0.45
spawnMethod · 0.45

Tested by

no test coverage detected