MCPcopy Create free account
hub / github.com/MITK/MITK / usModuleTest

Function usModuleTest

Modules/CppMicroServices/test/usModuleTest.cpp:267–319  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

265} // end unnamed namespace
266
267int usModuleTest(int /*argc*/, char* /*argv*/[])
268{
269 //US_TEST_BEGIN("ModuleTest");
270
271 std::vector<Module*> modules = ModuleRegistry::GetModules();
272 for (std::vector<Module*>::iterator iter = modules.begin(), iterEnd = modules.end();
273 iter != iterEnd; ++iter)
274 {
275 std::cout << "----- " << (*iter)->GetName() << std::endl;
276 }
277
278 frame01();
279 frame02a();
280
281 ModuleContext* mc = GetModuleContext();
282 TestModuleListener listener;
283
284 try
285 {
286 mc->AddModuleListener(&listener, &TestModuleListener::ModuleChanged);
287 }
288 catch (const std::logic_error& ise)
289 {
290 US_TEST_OUTPUT( << "module listener registration failed " << ise.what() );
291 throw;
292 }
293
294 try
295 {
296 mc->AddServiceListener(&listener, &TestModuleListener::ServiceChanged);
297 }
298 catch (const std::logic_error& ise)
299 {
300 US_TEST_OUTPUT( << "service listener registration failed " << ise.what() );
301 throw;
302 }
303
304 frame005a(mc);
305 frame010a(mc);
306 frame018a(mc);
307
308 SharedLibrary libA(LIB_PATH, "TestModuleA");
309 frame020a(mc, listener, libA);
310 frame030b(mc, listener, libA);
311
312 frame045a(mc);
313
314 mc->RemoveModuleListener(&listener, &TestModuleListener::ModuleChanged);
315 mc->RemoveServiceListener(&listener, &TestModuleListener::ServiceChanged);
316
317 //US_TEST_END()
318 return 0;
319}

Callers

nothing calls this directly

Calls 15

frame02aFunction · 0.85
GetModuleContextFunction · 0.85
frame005aFunction · 0.85
frame010aFunction · 0.85
frame018aFunction · 0.85
frame045aFunction · 0.85
whatMethod · 0.80
frame020aFunction · 0.70
frame030bFunction · 0.70
beginMethod · 0.45
endMethod · 0.45
GetNameMethod · 0.45

Tested by

no test coverage detected