From b0d869554b902c30f8a874b1e772a0241acf9f1f Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 17 Nov 2011 11:10:39 -0500 Subject: 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. --- indra/test/llsd_new_tut.cpp | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) 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<> -- cgit v1.2.3