summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2011-02-02 17:17:41 -0500
committerNat Goodspeed <nat@lindenlab.com>2011-02-02 17:17:41 -0500
commit63f81d59f6e736c5fdd30d8297d64d1677987d3c (patch)
treed80700b160469147f5f6738347ee01e83599fa18
parentf1262c83fc9be45c4b5cd1678c127b601634fb29 (diff)
Add test to exercise map/array args mismatch validation.
-rw-r--r--indra/llcommon/tests/lleventdispatcher_test.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/indra/llcommon/tests/lleventdispatcher_test.cpp b/indra/llcommon/tests/lleventdispatcher_test.cpp
index 30878beae4..2f2188a121 100644
--- a/indra/llcommon/tests/lleventdispatcher_test.cpp
+++ b/indra/llcommon/tests/lleventdispatcher_test.cpp
@@ -1056,4 +1056,24 @@ namespace tut
ensure_equals("matching mismatch", ti->llsd, matching);
}
}
+
+ template<> template<>
+ void object::test<17>()
+ {
+ set_test_name("passing wrong args to (map | array)-style registrations");
+
+ // Pass scalar/map to array-style functions, scalar/array to map-style
+ // functions. As that validation happens well before we engage the
+ // argument magic, it seems pointless to repeat this with every
+ // variation: (free function | non-static method), (no | arbitrary)
+ // args. We should only need to engage it for one map-style
+ // registration and one array-style registration.
+ std::string array_exc("needs an args array");
+ call_exc("free0_array", 17, array_exc);
+ call_exc("free0_array", LLSDMap("pi", 3.14), array_exc);
+
+ std::string map_exc("needs a map");
+ call_exc("free0_map", 17, map_exc);
+ call_exc("free0_map", LLSDArray("a")("b"), map_exc);
+ }
} // namespace tut