From f18885e55df025059e279605d997364575c1561a Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 4 Feb 2011 14:54:20 -0500 Subject: Change FunctionsTriple refs to pointers to facilitate passing. A certain popular-but-dumb compiler seems to think that initializing a std::vector from a pair of iterators requires assignment. A struct containing a reference cannot be assigned. Pointers get us past this issue. --- indra/llcommon/tests/lleventdispatcher_test.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'indra/llcommon/tests') diff --git a/indra/llcommon/tests/lleventdispatcher_test.cpp b/indra/llcommon/tests/lleventdispatcher_test.cpp index f8cf93f838..9de0819b66 100644 --- a/indra/llcommon/tests/lleventdispatcher_test.cpp +++ b/indra/llcommon/tests/lleventdispatcher_test.cpp @@ -1074,7 +1074,7 @@ namespace tut struct FunctionsTriple { std::string name1, name2; - Vars& vars; + Vars* vars; }; template<> template<> @@ -1083,9 +1083,9 @@ namespace tut set_test_name("call no-args functions"); FunctionsTriple tests[] = { - { "free0_array", "free0_map", g }, - { "smethod0_array", "smethod0_map", g }, - { "method0_array", "method0_map", v } + { "free0_array", "free0_map", &g }, + { "smethod0_array", "smethod0_map", &g }, + { "method0_array", "method0_map", &v } }; foreach(const FunctionsTriple& tr, tests) { @@ -1093,16 +1093,16 @@ namespace tut // cleared at the start of each test method. But since we're // calling these things several different times in the same // test method, manually reset the Vars between each. - tr.vars = Vars(); - ensure_equals(tr.vars.i, 0); + *tr.vars = Vars(); + ensure_equals(tr.vars->i, 0); // array-style call with empty array (or LLSD(), should be equivalent) work(tr.name1, LLSD()); - ensure_equals(tr.vars.i, 17); + ensure_equals(tr.vars->i, 17); - tr.vars = Vars(); + *tr.vars = Vars(); // map-style call with empty map (or LLSD(), should be equivalent) work(tr.name2, LLSD()); - ensure_equals(tr.vars.i, 17); + ensure_equals(tr.vars->i, 17); } } @@ -1112,9 +1112,9 @@ namespace tut { FunctionsTriple tests[] = { - { "freena_array", "freenb_array", g }, - { "smethodna_array", "smethodnb_array", g }, - { "methodna_array", "methodnb_array", v } + { "freena_array", "freenb_array", &g }, + { "smethodna_array", "smethodnb_array", &g }, + { "methodna_array", "methodnb_array", &v } }; return std::vector(boost::begin(tests), boost::end(tests)); } -- cgit v1.2.3