384 bool works, loadWorks, globWorks, initWorks, runWorks, finWorks, unloadWorks =
false;
386 std::cout <<
"Running Test__ElmerHandlesCheck" << std::endl;
389 std::cout <<
"Loading Elmer Module" << std::endl;
390 COM_LOAD_MODULE_STATIC_DYNAMIC(ElmerCSC,
"ElmerModule");
393 int ElmerHandle = COM_get_window_handle(
"ElmerModule");
395 std::cout <<
"After loading, COM_get_window_handle(\"ElmerModule\") returns "
396 << ElmerHandle << std::endl;
397 std::cout <<
"Error : Could not get window handle." << std::endl;
401 std::cout <<
"Elmer Module Loaded." << std::endl;
405 int globHandle = COM_get_dataitem_handle(
"ElmerModule.global");
407 std::cout <<
"After loading, COM_get_dataitem_handle(\"ElmerModule.global\") returns "
408 << globHandle << std::endl;
409 std::cout <<
"Error : Could not get the data item handle." << std::endl;
413 std::cout <<
"Global data handle accessed." << std::endl;
417 int initHandle = COM_get_function_handle(
"ElmerModule.Initialize");
419 std::cout <<
"After loading, COM_get_function_handle(\"ElmerModule.Initialize\") returns "
420 << initHandle << std::endl;
421 std::cout <<
"Error : Could not get the Initialize function handle." << std::endl;
425 std::cout <<
"Initialize function handle accessed." << std::endl;
429 int runHandle = COM_get_function_handle(
"ElmerModule.Run");
431 std::cout <<
"After loading, COM_get_function_handle(\"ElmerModule.Run\") returns "
432 << runHandle << std::endl;
433 std::cout <<
"Error : Could not get the Run function handle." << std::endl;
437 std::cout <<
"Run function handle accessed." << std::endl;
441 int finHandle = COM_get_function_handle(
"ElmerModule.Finalize");
443 std::cout <<
"After loading, COM_get_function_handle(\"ElmerModule.Finalize\") returns "
444 << finHandle << std::endl;
445 std::cout <<
"Error : Could not get the Finalize function handle." << std::endl;
449 std::cout <<
"Finalize function handle accessed." << std::endl;
453 std::cout <<
"Unloading Elmer Module" << std::endl;
454 COM_UNLOAD_MODULE_STATIC_DYNAMIC(ElmerCSC,
"ElmerModule");
457 ElmerHandle = COM_get_window_handle(
"ElmerModule");
459 std::cout <<
"After unloading, COM_get_window_handle(\"ElmerModule\") returns "
460 << ElmerHandle << std::endl;
461 std::cout <<
"Error : Module was not properly unloaded." << std::endl;
465 std::cout <<
"ElmerModule Unloaded." << std::endl;
468 if(loadWorks & globWorks & initWorks & runWorks & finWorks & unloadWorks) works =
true;
469 result.UpdateResult(
"ElmerHandlesCheck:Works",works);