-----------------------------------------------------------------------------
| 455 | |
| 456 | //----------------------------------------------------------------------------- |
| 457 | void 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 | // ---------------------------------------------------------------------------- |
| 478 | CTK_TEST_MAIN(ctkCmdLineModuleFutureTest) |
nothing calls this directly
no test coverage detected