29TEST_CASE(
"Creating and configuring an pwrOnOffNode",
"[instGraph::pwrOnOffNode]" )
31 SECTION(
"node is in file, setting pwr key" )
33 ingr::instGraphXML parentGraph;
35 mx::app::writeConfigFile(
"/tmp/pwrOnOffNode_test.conf",
36 {
"ttmpupil",
"ttmpupil" },
38 {
"pwrOnOff",
"test.pwr" } );
39 mx::app::appConfigurator config;
40 config.readConfig(
"/tmp/pwrOnOffNode_test.conf" );
44 int rv = parentGraph.loadXMLFile( emsg,
"/tmp/xigNode_test.xml" );
47 REQUIRE( emsg ==
"" );
56 catch(
const std::exception &e )
58 std::cerr << e.what() <<
"\n";
61 REQUIRE( pass ==
true );
62 REQUIRE( tsn !=
nullptr );
64 REQUIRE( tsn->
name() ==
"ttmpupil" );
65 REQUIRE( tsn->
node()->name() ==
"ttmpupil" );
73 catch(
const std::exception &e )
75 std::cerr << e.what() <<
"\n";
78 REQUIRE( pass ==
true );
81 REQUIRE( tsn->
pwrKey() ==
"test.pwr" );
84 SECTION(
"node is in file, error: not setting pwr key" )
86 ingr::instGraphXML parentGraph;
88 mx::app::writeConfigFile(
"/tmp/pwrOnOffNode_test.conf",
92 mx::app::appConfigurator config;
93 config.readConfig(
"/tmp/pwrOnOffNode_test.conf" );
97 int rv = parentGraph.loadXMLFile( emsg,
"/tmp/xigNode_test.xml" );
100 REQUIRE( emsg ==
"" );
109 catch(
const std::exception &e )
111 std::cerr << e.what() <<
"\n";
114 REQUIRE( pass ==
true );
115 REQUIRE( tsn !=
nullptr );
117 REQUIRE( tsn->
name() ==
"ttmpupil" );
118 REQUIRE( tsn->
node()->name() ==
"ttmpupil" );
126 catch(
const std::exception &e )
128 std::cerr << e.what() <<
"\n";
131 REQUIRE( pass ==
false );