| 265 | } // end unnamed namespace |
| 266 | |
| 267 | int 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 | } |
nothing calls this directly
no test coverage detected