8#include "../../../../tests/testXWC.hpp"
12#include "../xigNode.hpp"
26namespace xInstGraphTest
31 std::ofstream fout(
"/tmp/xigNode_test.xml" );
32 fout <<
"<mxfile host=\"test\">\n";
33 fout <<
" <diagram id=\"test\" name=\"test\">\n";
34 fout <<
" <mxGraphModel>\n";
36 fout <<
" <mxCell id=\"0\"/>\n";
37 fout <<
" <mxCell id=\"1\" parent=\"0\"/>\n";
38 fout <<
" <mxCell id=\"node:telescope\">\n";
39 fout <<
"</mxCell>\n";
41 fout <<
" </mxGraphModel>\n";
42 fout <<
" </diagram>\n";
43 fout <<
"</mxfile>\n";
56 static_cast<void>( ipRecv );
61SCENARIO(
"Creating an xigNode",
"[instGraph::xigNode]" )
64 #ifdef XINSTGRAPH_TEST_DOXYGEN_REF
70 GIVEN(
"a valid XML file" )
72 WHEN(
"node is in file" )
74 ingr::instGraphXML parentGraph;
79 int rv = parentGraph.loadXMLFile( emsg,
"/tmp/xigNode_test.xml" );
82 REQUIRE( emsg ==
"" );
95 REQUIRE( pass ==
true );
96 REQUIRE( txn !=
nullptr );
98 REQUIRE( txn->
name() ==
"telescope" );
99 REQUIRE( txn->
node()->name() ==
"telescope" );
100 REQUIRE( pass ==
true );
103 REQUIRE( txn->
keys().count(
"tkey" ) == 1 );
106 WHEN(
"node is not in file" )
108 ingr::instGraphXML parentGraph;
113 int rv = parentGraph.loadXMLFile( emsg,
"/tmp/xigNode_test.xml" );
116 REQUIRE( emsg ==
"" );
130 REQUIRE( pass ==
false );
131 REQUIRE( txn ==
nullptr );
135 GIVEN(
"an invalid XML file" )
137 WHEN(
"parent graph is null on construction" )
139 ingr::instGraphXML *parentGraph =
nullptr;
152 REQUIRE( pass ==
false );
153 REQUIRE( txn ==
nullptr );
int handleSetProperty(const pcf::IndiProperty &ipRecv)
INDI SetProperty callback.
test_xigNode(const std::string &name, ingr::instGraphXML *parentGraph)
Implementation of basic instGraph node interface for MagAO-X.
void key(const std::string &nkey)
Add a key to the set.
ingr::instNode * node()
Get the pointer to the underlying node.
std::string name()
Get the name of this node.
const std::set< std::string > & keys()
Get the set holding the INDI keys for this node.
SCENARIO("Creating and configuring an fsmNode", "[instGraph::fsmNode]")
void writeXML()
Write a minimal draw.io graph containing one of each supported node type.
Namespace for all libXWC tests.