diff options
Diffstat (limited to 'linden/indra/test/llsd_new_tut.cpp')
-rw-r--r-- | linden/indra/test/llsd_new_tut.cpp | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/linden/indra/test/llsd_new_tut.cpp b/linden/indra/test/llsd_new_tut.cpp index 2ab8668..6c8d96a 100644 --- a/linden/indra/test/llsd_new_tut.cpp +++ b/linden/indra/test/llsd_new_tut.cpp | |||
@@ -132,13 +132,11 @@ namespace tut | |||
132 | v = newUUID; ensureTypeAndValue("set to new UUID", v, newUUID); | 132 | v = newUUID; ensureTypeAndValue("set to new UUID", v, newUUID); |
133 | v = nullUUID; ensureTypeAndValue("set to null again", v, nullUUID); | 133 | v = nullUUID; ensureTypeAndValue("set to null again", v, nullUUID); |
134 | 134 | ||
135 | // strings must be tested with three (!) types of string objects | 135 | // strings must be tested with two types of string objects |
136 | std::string s = "now is the time"; | 136 | std::string s = "now is the time"; |
137 | LLString ls = "for all good zorks"; | 137 | const char* cs = "for all good zorks"; |
138 | const char* cs = "to come to the air of their planet"; | ||
139 | 138 | ||
140 | v = s; ensureTypeAndValue("set to std::string", v, s); | 139 | v = s; ensureTypeAndValue("set to std::string", v, s); |
141 | v = ls; ensureTypeAndValue("set to LLString", v, ls); | ||
142 | v = cs; ensureTypeAndValue("set to const char*", v, cs); | 140 | v = cs; ensureTypeAndValue("set to const char*", v, cs); |
143 | 141 | ||
144 | LLDate epoch; | 142 | LLDate epoch; |
@@ -186,10 +184,10 @@ namespace tut | |||
186 | ensureTypeAndValue("construct std::string", ss1, "abc"); | 184 | ensureTypeAndValue("construct std::string", ss1, "abc"); |
187 | LLSD ss2 = std::string("abc"); | 185 | LLSD ss2 = std::string("abc"); |
188 | ensureTypeAndValue("initialize std::string",ss2, "abc"); | 186 | ensureTypeAndValue("initialize std::string",ss2, "abc"); |
189 | LLSD sl1(LLString("def")); | 187 | LLSD sl1(std::string("def")); |
190 | ensureTypeAndValue("construct LLString", sl1, "def"); | 188 | ensureTypeAndValue("construct std::string", sl1, "def"); |
191 | LLSD sl2 = LLString("def"); | 189 | LLSD sl2 = std::string("def"); |
192 | ensureTypeAndValue("initialize LLString", sl2, "def"); | 190 | ensureTypeAndValue("initialize std::string", sl2, "def"); |
193 | LLSD sc1("ghi"); | 191 | LLSD sc1("ghi"); |
194 | ensureTypeAndValue("construct const char*", sc1, "ghi"); | 192 | ensureTypeAndValue("construct const char*", sc1, "ghi"); |
195 | LLSD sc2 = "ghi"; | 193 | LLSD sc2 = "ghi"; |
@@ -432,10 +430,6 @@ namespace tut | |||
432 | // SAD s = v; ensure_equals("assign to string", s, " 42.375"); | 430 | // SAD s = v; ensure_equals("assign to string", s, " 42.375"); |
433 | s = (std::string)v; ensure_equals("cast to string", s, " 42.375"); | 431 | s = (std::string)v; ensure_equals("cast to string", s, " 42.375"); |
434 | 432 | ||
435 | LLString t = "yo"; | ||
436 | // SAD t = v; ensure_equals("assign to LLString", t, " 42.375"); | ||
437 | t = (LLString)v; ensure_equals("cast to LLString", t, " 42.375"); | ||
438 | |||
439 | std::string uuidStr = "b1e50c2b-b627-4d23-8a86-a65d97b6319b"; | 433 | std::string uuidStr = "b1e50c2b-b627-4d23-8a86-a65d97b6319b"; |
440 | v = uuidStr; | 434 | v = uuidStr; |
441 | LLUUID u; | 435 | LLUUID u; |
@@ -486,10 +480,10 @@ namespace tut | |||
486 | ensure_equals("contruct string", s1, " 42.375"); | 480 | ensure_equals("contruct string", s1, " 42.375"); |
487 | ensure_equals("initialize string", s2, " 42.375"); | 481 | ensure_equals("initialize string", s2, " 42.375"); |
488 | 482 | ||
489 | LLString t1(v); | 483 | std::string t1(v); |
490 | LLString t2 = v.asString(); // SAD | 484 | std::string t2 = v.asString(); // SAD |
491 | ensure_equals("contruct LLString", t1, " 42.375"); | 485 | ensure_equals("contruct std::string", t1, " 42.375"); |
492 | ensure_equals("initialize LLString", t2, " 42.375"); | 486 | ensure_equals("initialize std::string", t2, " 42.375"); |
493 | 487 | ||
494 | std::string uuidStr = "b1e50c2b-b627-4d23-8a86-a65d97b6319b"; | 488 | std::string uuidStr = "b1e50c2b-b627-4d23-8a86-a65d97b6319b"; |
495 | v = uuidStr; | 489 | v = uuidStr; |