summaryrefslogtreecommitdiff
path: root/indra/llcommon
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2011-02-06 11:57:19 -0500
committerNat Goodspeed <nat@lindenlab.com>2011-02-06 11:57:19 -0500
commitf4f3791a5ff1cc76b9d1054c269e69d44cdaf8d6 (patch)
tree7961a5b5344371e9842d96ded6f257932a28bc51 /indra/llcommon
parente51ccdac0e3595a476dbc2d8580a3fb1780cdb4c (diff)
Add test verifying passing LLSD() to const char* parameter.
LLSDParam<const char*> is coded to pass NULL for an isUndefined() LLSD value, so event-based caller can choose whether to pass NULL, "" or whatever string value to such a parameter. Ensure this behavior.
Diffstat (limited to 'indra/llcommon')
-rw-r--r--indra/llcommon/tests/lleventdispatcher_test.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/indra/llcommon/tests/lleventdispatcher_test.cpp b/indra/llcommon/tests/lleventdispatcher_test.cpp
index 30d3c42554..bdd8c16cec 100644
--- a/indra/llcommon/tests/lleventdispatcher_test.cpp
+++ b/indra/llcommon/tests/lleventdispatcher_test.cpp
@@ -1229,4 +1229,18 @@ namespace tut
}
}
}
+
+ template<> template<>
+ void object::test<21>()
+ {
+ set_test_name("verify that passing LLSD() to const char* sends NULL");
+
+ ensure_equals("Vars::cp init", v.cp, "");
+ work("methodna_map_mdft", LLSDMap("cp", LLSD()));
+ ensure_equals("passing LLSD()", v.cp, "NULL");
+ work("methodna_map_mdft", LLSDMap("cp", ""));
+ ensure_equals("passing \"\"", v.cp, "''");
+ work("methodna_map_mdft", LLSDMap("cp", "non-NULL"));
+ ensure_equals("passing \"non-NULL\"", v.cp, "'non-NULL'");
+ }
} // namespace tut