31TEST_CASE(
"cred2Ctrl lifecycle entrypoints handle startup failures and success",
"[cred2Ctrl]" )
36 #ifdef CRED2CTRL_TEST_DOXYGEN_REF
41 SECTION(
"appStartup reports failure when no startup mode is available" )
45 loadDefaultConfig( app,
"startup_missing_mode" );
46 app.m_startupMode.clear();
48 REQUIRE( app.appStartup() < 0 );
51 SECTION(
"appStartup reports failure when the EDT runtime config cannot be read" )
55 loadDefaultConfig( app,
"startup_bad_edt" );
56 g_edtStubState.readcfgReturn = -1;
58 REQUIRE( app.appStartup() < 0 );
61 SECTION(
"appStartup succeeds once the runtime mode and telemetry path are configured" )
64 startupScope startup( app );
66 loadDefaultConfig( app,
"startup_success" );
68 const int startupRv = app.appStartup();
69 startup.markStarted( startupRv == 0 );
71 REQUIRE( startupRv == 0 );
72 REQUIRE( app.m_pdv !=
nullptr );
73 REQUIRE( app.m_raw_width == 640 );
74 REQUIRE( app.m_raw_height == 512 );
75 REQUIRE( app.m_raw_depth == 16 );
76 REQUIRE( app.m_cameraType ==
"stub_pdv" );
77 REQUIRE( g_edtStubState.readcfgCalls > 0 );
78 REQUIRE( g_edtStubState.multibufCalls > 0 );
81 SECTION(
"appStartup reports failure when the read-only fps property has already been registered" )
84 pcf::IndiProperty fpsLimits;
86 loadDefaultConfig( app,
"startup_duplicate_property" );
87 REQUIRE( app.createROIndiNumber( fpsLimits,
"fps_limits" ) == 0 );
88 REQUIRE( app.registerIndiPropertyReadOnly( fpsLimits ) == 0 );
90 REQUIRE( app.appStartup() < 0 );