diff options
Diffstat (limited to 'indra/newview/tests')
-rw-r--r-- | indra/newview/tests/lldateutil_test.cpp | 15 | ||||
-rw-r--r-- | indra/newview/tests/lllogininstance_test.cpp | 4 | ||||
-rw-r--r-- | indra/newview/tests/llslurl_test.cpp | 4 | ||||
-rw-r--r-- | indra/newview/tests/llviewernetwork_test.cpp | 4 | ||||
-rw-r--r-- | indra/newview/tests/llworldmap_test.cpp | 2 |
5 files changed, 17 insertions, 12 deletions
diff --git a/indra/newview/tests/lldateutil_test.cpp b/indra/newview/tests/lldateutil_test.cpp index e9d4982e35..151aadfd4b 100644 --- a/indra/newview/tests/lldateutil_test.cpp +++ b/indra/newview/tests/lldateutil_test.cpp @@ -38,18 +38,23 @@ // Baked-in return values for getString() -std::map< std::string, std::string > gString; +std::map< std::string, std::string, std::less<>> gString; // Baked-in return values for getCountString() // map of pairs of input xml_desc and integer count typedef std::pair< std::string, int > count_string_t; std::map< count_string_t, std::string > gCountString; -std::string LLTrans::getString(const std::string &xml_desc, const LLStringUtil::format_map_t& args, bool def_string) +std::string LLTrans::getString(const std::string_view xml_desc, const LLStringUtil::format_map_t& args, bool def_string) { - std::string text = gString[xml_desc]; - LLStringUtil::format(text, args); - return text; + auto it = gString.find(xml_desc); + if (it != gString.end()) + { + std::string text = it->second; + LLStringUtil::format(text, args); + return text; + } + return {}; } std::string LLTrans::getCountString(const std::string& language, const std::string& xml_desc, S32 count) diff --git a/indra/newview/tests/lllogininstance_test.cpp b/indra/newview/tests/lllogininstance_test.cpp index df0f006d02..bff2289a7c 100644 --- a/indra/newview/tests/lllogininstance_test.cpp +++ b/indra/newview/tests/lllogininstance_test.cpp @@ -79,7 +79,7 @@ LLProgressView * LLViewerWindow::getProgressView(void) const { return 0; } LLViewerWindow* gViewerWindow; -std::string LLTrans::getString(const std::string &xml_desc, const LLStringUtil::format_map_t& args, bool def_string) +std::string LLTrans::getString(std::string_view xml_desc, const LLStringUtil::format_map_t& args, bool def_string) { return std::string("test_trans"); } @@ -235,7 +235,7 @@ static LLEventPump * gTOSReplyPump = NULL; LLPointer<LLSecAPIHandler> gSecAPIHandler; //static -LLFloater* LLFloaterReg::showInstance(const std::string& name, const LLSD& key, bool focus) +LLFloater* LLFloaterReg::showInstance(std::string_view name, const LLSD& key, bool focus) { gTOSType = name; gTOSReplyPump = &LLEventPumps::instance().obtain(key["reply_pump"]); diff --git a/indra/newview/tests/llslurl_test.cpp b/indra/newview/tests/llslurl_test.cpp index 3be44a9bd5..fc9f5b707a 100644 --- a/indra/newview/tests/llslurl_test.cpp +++ b/indra/newview/tests/llslurl_test.cpp @@ -46,10 +46,10 @@ static const char * const TEST_FILENAME("llslurl_test.xml"); class LLTrans { public: - static std::string getString(const std::string &xml_desc, const LLStringUtil::format_map_t& args, bool def_string = false); + static std::string getString(std::string_view xml_desc, const LLStringUtil::format_map_t& args, bool def_string = false); }; -std::string LLTrans::getString(const std::string &xml_desc, const LLStringUtil::format_map_t& args, bool def_string) +std::string LLTrans::getString(std::string_view xml_desc, const LLStringUtil::format_map_t& args, bool def_string) { return std::string(); } diff --git a/indra/newview/tests/llviewernetwork_test.cpp b/indra/newview/tests/llviewernetwork_test.cpp index 40c2059d27..d9cb9e7538 100644 --- a/indra/newview/tests/llviewernetwork_test.cpp +++ b/indra/newview/tests/llviewernetwork_test.cpp @@ -45,10 +45,10 @@ static const char * const TEST_FILENAME("llviewernetwork_test.xml"); class LLTrans { public: - static std::string getString(const std::string &xml_desc, const LLStringUtil::format_map_t& args, bool def_string = false); + static std::string getString(std::string_view xml_desc, const LLStringUtil::format_map_t& args, bool def_string = false); }; -std::string LLTrans::getString(const std::string &xml_desc, const LLStringUtil::format_map_t& args, bool def_string) +std::string LLTrans::getString(std::string_view xml_desc, const LLStringUtil::format_map_t& args, bool def_string) { std::string grid_label = std::string(); if(xml_desc == "AgniGridLabel") diff --git a/indra/newview/tests/llworldmap_test.cpp b/indra/newview/tests/llworldmap_test.cpp index 8564dbeeb6..d5bf189d82 100644 --- a/indra/newview/tests/llworldmap_test.cpp +++ b/indra/newview/tests/llworldmap_test.cpp @@ -66,7 +66,7 @@ void LLWorldMipmap::equalizeBoostLevels() { } LLPointer<LLViewerFetchedTexture> LLWorldMipmap::getObjectsTile(U32 grid_x, U32 grid_y, S32 level, bool load) { return NULL; } // Stub other stuff -std::string LLTrans::getString(const std::string &, const LLStringUtil::format_map_t&, bool def_string) { return std::string("test_trans"); } +std::string LLTrans::getString(std::string_view, const LLStringUtil::format_map_t&, bool def_string) { return std::string("test_trans"); } void LLUIString::updateResult() const { } void LLUIString::setArg(const std::string& , const std::string& ) { } void LLUIString::assign(const std::string& ) { } |