"{ \"type\": \"SubConfig\", \"value\": { \"intVal\": 54321, \"intVector\": [ 1 ], "
"\"subSubObj\": { \"intVal\": 234 } } } ] }";
+const std::string jsonEmptyTestString =
+ "{ \"intVal\": 0, "
+ "\"int64Val\": 0, "
+ "\"stringVal\": \"\", "
+ "\"boolVal\": false, "
+ "\"emptyIntVector\": [ ], "
+ "\"intVector\": [ ], "
+ "\"stringVector\": [ ], "
+ "\"subObj\": { \"intVal\": 0, \"intVector\": [ ], \"subSubObj\": { \"intVal\": 0 } }, "
+ "\"subVector\": [ ], "
+ "\"union1\": { \"type\": \"int\", \"value\": 0 }, "
+ "\"union2\": { \"type\": \"int\", \"value\": 0 }, "
+ "\"unions\": [ ] }";
+
#endif
// all in db
saveToKVStore(DB_PATH, config, DB_PREFIX);
TestConfig outConfig2;
- outConfig2.union1.set<int>(0);
- outConfig2.union2.set<int>(0);
- std::string emptyConfig = saveToJsonString(outConfig2);
- loadFromKVStoreWithJson(DB_PATH, emptyConfig, outConfig2, DB_PREFIX);
+ loadFromKVStoreWithJson(DB_PATH, jsonEmptyTestString, outConfig2, DB_PREFIX);
std::string out2 = saveToJsonString(outConfig2);
BOOST_CHECK_EQUAL(out2, jsonTestString);