50TEST_CASE(
"Creating and configuring an pwrOnOffNode",
"[instGraph::pwrOnOffNode]" )
53 #ifdef XINSTGRAPH_TEST_DOXYGEN_REF
59 SECTION(
"node is in file, setting pwr key" )
61 ingr::instGraphXML parentGraph;
63 mx::app::writeConfigFile(
"/tmp/pwrOnOffNode_test.conf",
64 {
"ttmpupil",
"ttmpupil" },
66 {
"pwrOnOff",
"test.pwr" } );
67 mx::app::appConfigurator config;
68 config.readConfig(
"/tmp/pwrOnOffNode_test.conf" );
72 int rv = parentGraph.loadXMLFile( emsg,
"/tmp/xigNode_test.xml" );
75 REQUIRE( emsg ==
"" );
84 catch(
const std::exception &e )
86 std::cerr << e.what() <<
"\n";
89 REQUIRE( pass ==
true );
90 REQUIRE( tsn !=
nullptr );
92 REQUIRE( tsn->
name() ==
"ttmpupil" );
93 REQUIRE( tsn->
node()->name() ==
"ttmpupil" );
101 catch(
const std::exception &e )
103 std::cerr << e.what() <<
"\n";
106 REQUIRE( pass ==
true );
109 REQUIRE( tsn->
pwrKey() ==
"test.pwr" );
112 SECTION(
"node is in file, error: not setting pwr key" )
114 ingr::instGraphXML parentGraph;
116 mx::app::writeConfigFile(
"/tmp/pwrOnOffNode_test.conf", {
"ttmpupil" }, {
"type" }, {
"pwrOnOff" } );
117 mx::app::appConfigurator config;
118 config.readConfig(
"/tmp/pwrOnOffNode_test.conf" );
122 int rv = parentGraph.loadXMLFile( emsg,
"/tmp/xigNode_test.xml" );
125 REQUIRE( emsg ==
"" );
134 catch(
const std::exception &e )
136 std::cerr << e.what() <<
"\n";
139 REQUIRE( pass ==
true );
140 REQUIRE( tsn !=
nullptr );
142 REQUIRE( tsn->
name() ==
"ttmpupil" );
143 REQUIRE( tsn->
node()->name() ==
"ttmpupil" );
151 catch(
const std::exception &e )
153 std::cerr << e.what() <<
"\n";
156 REQUIRE( pass ==
false );