From a1d2b581c44c8d78a4c85fcb345e53fcd2660e38 Mon Sep 17 00:00:00 2001 From: Stefan Sayer Date: Fri, 16 Jul 2010 02:20:17 +0200 Subject: [PATCH] json: to and back conversion test --- core/tests/test_jsonarg.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/core/tests/test_jsonarg.cpp b/core/tests/test_jsonarg.cpp index 2e25db8b..aa889fcb 100644 --- a/core/tests/test_jsonarg.cpp +++ b/core/tests/test_jsonarg.cpp @@ -102,4 +102,18 @@ FCTMF_SUITE_BGN(test_jsonarg) { fct_chk(isArgDouble(rpc_params["result"]) && rpc_params["result"].asDouble() == 1.21); } FCT_TEST_END(); + FCT_TEST_BGN(json_tofro_equality) { + AmArg a1; + a1["test"]=1; + a1["test2"].push("asdf"); + a1["test2"].push(1); + + string s = arg2json(a1); + AmArg a2; + bool back_conversion_result = json2arg(s, a2); + fct_chk(back_conversion_result); + // fct_chk(a1==a2); + // DBG("a1 = '%s', a2 = '%s', \n", AmArg::print(a1).c_str(), AmArg::print(a2).c_str()); + } FCT_TEST_END(); + } FCTMF_SUITE_END();