MCPcopy Create free account
hub / github.com/commontk/CTK / testError

Method testError

Libs/CommandLineModules/Testing/Cpp/ctkCmdLineModuleFutureTest.cpp:457–475  ·  view source on GitHub ↗

-----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

455
456//-----------------------------------------------------------------------------
457void ctkCmdLineModuleFutureTester::testError()
458{
459 frontend->setValue("fileVar", "output1");
460 frontend->setValue("exitCodeVar", 24);
461 frontend->setValue("errorTextVar", "Some error occurred\n");
462
463 ctkCmdLineModuleFuture future = manager.run(frontend);
464
465 try
466 {
467 future.waitForFinished();
468 QFAIL("Expected exception not thrown.");
469 }
470 catch (const ctkCmdLineModuleRunException& e)
471 {
472 QVERIFY2(e.errorCode() == 24, "Test matching error code");
473 QCOMPARE(future.readAllErrorData().data(), "A superficial error message.\nSome error occurred\n");
474 }
475}
476
477// ----------------------------------------------------------------------------
478CTK_TEST_MAIN(ctkCmdLineModuleFutureTest)

Callers

nothing calls this directly

Calls 5

errorCodeMethod · 0.80
setValueMethod · 0.45
runMethod · 0.45
dataMethod · 0.45
readAllErrorDataMethod · 0.45

Tested by

no test coverage detected