summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2011-11-17 11:10:39 -0500
committerNat Goodspeed <nat@lindenlab.com>2011-11-17 11:10:39 -0500
commitb0d869554b902c30f8a874b1e772a0241acf9f1f (patch)
tree3f9e6de9f1ea8f3d84c4c8778778aa14d4bc2d5a /indra
parente62c691aab36b50d3eecb99310d5652d0b8e6f23 (diff)
LLSD-14: Add tests from Simon's server-trunk changeset 3852648182db.
That changeset provides most of the changes previously checked in on this Jira (viewer changeset 22b293aae639). Bring over the code he added to llsd_new_tut.cpp as well.
Diffstat (limited to 'indra')
-rw-r--r--indra/test/llsd_new_tut.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/indra/test/llsd_new_tut.cpp b/indra/test/llsd_new_tut.cpp
index dd93b36f04..f332ad0ee2 100644
--- a/indra/test/llsd_new_tut.cpp
+++ b/indra/test/llsd_new_tut.cpp
@@ -742,6 +742,42 @@ namespace tut
LLSD w = v;
w = "nice day";
}
+
+ {
+ SDAllocationCheck check("shared values test for threaded work", 9);
+
+ //U32 start_llsd_count = LLSD::outstandingCount();
+
+ LLSD m = LLSD::emptyMap();
+
+ m["one"] = 1;
+ m["two"] = 2;
+ m["one_copy"] = m["one"]; // 3 (m, "one" and "two")
+
+ m["undef_one"] = LLSD();
+ m["undef_two"] = LLSD();
+ m["undef_one_copy"] = m["undef_one"];
+
+ { // Ensure first_array gets freed to avoid counting it
+ LLSD first_array = LLSD::emptyArray();
+ first_array.append(1.0f);
+ first_array.append(2.0f);
+ first_array.append(3.0f); // 7
+
+ m["array"] = first_array;
+ m["array_clone"] = first_array;
+ m["array_copy"] = m["array"]; // 7
+ }
+
+ m["string_one"] = "string one value";
+ m["string_two"] = "string two value";
+ m["string_one_copy"] = m["string_one"]; // 9
+
+ //U32 llsd_object_count = LLSD::outstandingCount();
+ //std::cout << "Using " << (llsd_object_count - start_llsd_count) << " LLSD objects" << std::endl;
+
+ //m.dumpStats();
+ }
}
template<> template<>