diff options
author | Adam Moss <moss@lindenlab.com> | 2009-10-08 12:00:24 +0000 |
---|---|---|
committer | Adam Moss <moss@lindenlab.com> | 2009-10-08 12:00:24 +0000 |
commit | 2bfe1fc2bc355f455c018a575b97452f5ac8a729 (patch) | |
tree | 32654c44716f6718328754abf686232a83f3943f /indra | |
parent | 7db4992f34c67b5585a3250b21efbd27393d38d7 (diff) |
Extend automated string tests to cover the formerly-crashing "[]" substitution case (EXT-1282, DEV-41081)
Also 'fix' string tests to match the new expected behaviour of LLStringUtil::format(). They must have been failing dreadfully before, but the legacy tut tests aren't run in a viewer-only build, so...
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llcommon/tests/llstring_test.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/indra/llcommon/tests/llstring_test.cpp b/indra/llcommon/tests/llstring_test.cpp index 13894efad0..1f4603631a 100644 --- a/indra/llcommon/tests/llstring_test.cpp +++ b/indra/llcommon/tests/llstring_test.cpp @@ -554,6 +554,7 @@ namespace tut fmt_map["[KEYSHORTER]"] = "Am I not a long string?"; fmt_map["?"] = "?"; fmt_map["[DELETE]"] = ""; + fmt_map["[]"] = "[]"; // doesn't do a substitution, but shouldn't crash either for (LLStringUtil::format_map_t::const_iterator iter = fmt_map.begin(); iter != fmt_map.end(); ++iter) { @@ -562,7 +563,7 @@ namespace tut std::string s2 = (std::string)iter->second; subcount = LLStringUtil::format(s1, fmt_map); ensure_equals("LLStringUtil::format: Raw interpolation result", s1, s2); - if (s1 == "?") + if (s1 == "?" || s1 == "[]") // no interp expected { ensure_equals("LLStringUtil::format: Raw interpolation result count", 0, subcount); } @@ -580,7 +581,7 @@ namespace tut s = s1 + s1 + s1 + s1; subcount = LLStringUtil::format(s, fmt_map); ensure_equals("LLStringUtil::format: Rawx4 interpolation result", s, s2 + s2 + s2 + s2); - if (s1 == "?") + if (s1 == "?" || s1 == "[]") // no interp expected { ensure_equals("LLStringUtil::format: Rawx4 interpolation result count", 0, subcount); } |