Skip to content
Snippets Groups Projects
Commit 2bfe1fc2 authored by Adam Moss's avatar Adam Moss
Browse files

Extend automated string tests to cover the formerly-crashing "[]" substitution...

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...
parent 7db4992f
No related branches found
No related tags found
No related merge requests found
......@@ -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);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment