Skip to content
Snippets Groups Projects
Commit 6304164d authored by Simon Ottenhaus's avatar Simon Ottenhaus
Browse files

added test

parent b197e600
No related branches found
No related tags found
No related merge requests found
......@@ -29,6 +29,7 @@
#include <ArmarXGui/libraries/StructuralJson/JsonArray.h>
#include <ArmarXGui/libraries/StructuralJson/JsonObject.h>
#include <ArmarXGui/libraries/StructuralJson/StructuralJsonParser.h>
#include <ArmarXGui/libraries/StructuralJson/JPathNavigator.h>
using namespace armarx;
......@@ -146,5 +147,14 @@ BOOST_AUTO_TEST_CASE(testWriteStructuralJson)
BOOST_CHECK_EQUAL("{\"arr1\":[1.5],\"arr2\":[2.5],\"arr3\":[3.5]}", o->toJsonString());
}
BOOST_AUTO_TEST_CASE(testJPathNavigatorAsInt)
{
StructuralJsonParser parser(R"({int:5,float:5.5,boolTrue:true,boolFalse:false}})");
parser.parse();
JPathNavigator nav(parser.parsedJson);
BOOST_CHECK_EQUAL(5, nav.selectSingleNode("int").asInt());
BOOST_CHECK_EQUAL(5.5f, nav.selectSingleNode("float").asFloat());
BOOST_CHECK_EQUAL(true, nav.selectSingleNode("boolTrue").asBool());
BOOST_CHECK_EQUAL(false, nav.selectSingleNode("boolFalse").asBool());
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment