diff options
author | Steven Bennetts <steve@lindenlab.com> | 2008-06-26 00:39:00 +0000 |
---|---|---|
committer | Steven Bennetts <steve@lindenlab.com> | 2008-06-26 00:39:00 +0000 |
commit | 25c10ed028da5c547b11f1f461916897272b0e6d (patch) | |
tree | 350a5858f8970b6e28b2dc395625d74d8bd597b2 /indra/test | |
parent | 6dd125d375b38455997a0c4b8747659f4c2351aa (diff) |
QAR-628 merge string-cleanup-5 -r 90476:90508 -> release
dataserver-is-deprecated
Diffstat (limited to 'indra/test')
-rw-r--r-- | indra/test/llblowfish_tut.cpp | 6 | ||||
-rw-r--r-- | indra/test/llmessageconfig_tut.cpp | 8 | ||||
-rw-r--r-- | indra/test/llsd_new_tut.cpp | 26 | ||||
-rw-r--r-- | indra/test/llsdtraits.h | 4 | ||||
-rw-r--r-- | indra/test/message_tut.cpp | 8 |
5 files changed, 21 insertions, 31 deletions
diff --git a/indra/test/llblowfish_tut.cpp b/indra/test/llblowfish_tut.cpp index 3081ac3855..8fe8b7a720 100644 --- a/indra/test/llblowfish_tut.cpp +++ b/indra/test/llblowfish_tut.cpp @@ -57,8 +57,8 @@ namespace tut mInputSize = 36; } - bool matchFile(const char* filename, - const std::string& data) + bool matchFile(const std::string& filename, + const std::string& data) { LLFILE* fp = LLFile::fopen(filename, "rb"); if (!fp) @@ -66,7 +66,7 @@ namespace tut // sometimes test is run inside the indra directory std::string path = "test/"; path += filename; - fp = LLFile::fopen(path.c_str(), "rb"); + fp = LLFile::fopen(path, "rb"); } if (!fp) { diff --git a/indra/test/llmessageconfig_tut.cpp b/indra/test/llmessageconfig_tut.cpp index c2329220e5..3dcf251fc0 100644 --- a/indra/test/llmessageconfig_tut.cpp +++ b/indra/test/llmessageconfig_tut.cpp @@ -56,7 +56,7 @@ namespace tut oStr << "/tmp/llmessage-config-test-" << random; #endif mTestConfigDir = oStr.str(); - LLFile::mkdir(mTestConfigDir.c_str()); + LLFile::mkdir(mTestConfigDir); writeConfigFile(LLSD()); LLMessageConfig::initClass("simulator", mTestConfigDir); } @@ -64,16 +64,16 @@ namespace tut ~LLMessageConfigTestData() { // rm contents of temp dir - int rmfile = LLFile::remove((mTestConfigDir + "/message.xml").c_str()); + int rmfile = LLFile::remove((mTestConfigDir + "/message.xml")); ensure_equals("rmfile value", rmfile, 0); // rm temp dir - int rmdir = LLFile::rmdir(mTestConfigDir.c_str()); + int rmdir = LLFile::rmdir(mTestConfigDir); ensure_equals("rmdir value", rmdir, 0); } void writeConfigFile(const LLSD& config) { - llofstream file((mTestConfigDir + "/message.xml").c_str()); + llofstream file((mTestConfigDir + "/message.xml")); if (file.is_open()) { LLSDSerialize::toPrettyXML(config, file); diff --git a/indra/test/llsd_new_tut.cpp b/indra/test/llsd_new_tut.cpp index b40d4fa348..529e0df20f 100644 --- a/indra/test/llsd_new_tut.cpp +++ b/indra/test/llsd_new_tut.cpp @@ -132,13 +132,11 @@ namespace tut v = newUUID; ensureTypeAndValue("set to new UUID", v, newUUID); v = nullUUID; ensureTypeAndValue("set to null again", v, nullUUID); - // strings must be tested with three (!) types of string objects + // strings must be tested with two types of string objects std::string s = "now is the time"; - LLString ls = "for all good zorks"; - const char* cs = "to come to the air of their planet"; + const char* cs = "for all good zorks"; v = s; ensureTypeAndValue("set to std::string", v, s); - v = ls; ensureTypeAndValue("set to LLString", v, ls); v = cs; ensureTypeAndValue("set to const char*", v, cs); LLDate epoch; @@ -186,10 +184,10 @@ namespace tut ensureTypeAndValue("construct std::string", ss1, "abc"); LLSD ss2 = std::string("abc"); ensureTypeAndValue("initialize std::string",ss2, "abc"); - LLSD sl1(LLString("def")); - ensureTypeAndValue("construct LLString", sl1, "def"); - LLSD sl2 = LLString("def"); - ensureTypeAndValue("initialize LLString", sl2, "def"); + LLSD sl1(std::string("def")); + ensureTypeAndValue("construct std::string", sl1, "def"); + LLSD sl2 = std::string("def"); + ensureTypeAndValue("initialize std::string", sl2, "def"); LLSD sc1("ghi"); ensureTypeAndValue("construct const char*", sc1, "ghi"); LLSD sc2 = "ghi"; @@ -432,10 +430,6 @@ namespace tut // SAD s = v; ensure_equals("assign to string", s, " 42.375"); s = (std::string)v; ensure_equals("cast to string", s, " 42.375"); - LLString t = "yo"; -// SAD t = v; ensure_equals("assign to LLString", t, " 42.375"); - t = (LLString)v; ensure_equals("cast to LLString", t, " 42.375"); - std::string uuidStr = "b1e50c2b-b627-4d23-8a86-a65d97b6319b"; v = uuidStr; LLUUID u; @@ -486,10 +480,10 @@ namespace tut ensure_equals("contruct string", s1, " 42.375"); ensure_equals("initialize string", s2, " 42.375"); - LLString t1(v); - LLString t2 = v.asString(); // SAD - ensure_equals("contruct LLString", t1, " 42.375"); - ensure_equals("initialize LLString", t2, " 42.375"); + std::string t1(v); + std::string t2 = v.asString(); // SAD + ensure_equals("contruct std::string", t1, " 42.375"); + ensure_equals("initialize std::string", t2, " 42.375"); std::string uuidStr = "b1e50c2b-b627-4d23-8a86-a65d97b6319b"; v = uuidStr; diff --git a/indra/test/llsdtraits.h b/indra/test/llsdtraits.h index 97eece6ff0..e140be2a7d 100644 --- a/indra/test/llsdtraits.h +++ b/indra/test/llsdtraits.h @@ -84,10 +84,6 @@ LLSDTraits<LLSD::String>::LLSDTraits() { } template<> -class LLSDTraits<LLString> : public LLSDTraits<LLSD::String> -{ }; - -template<> class LLSDTraits<const char*> : public LLSDTraits<LLSD::String> { }; diff --git a/indra/test/message_tut.cpp b/indra/test/message_tut.cpp index 57db6dd97a..d426511d24 100644 --- a/indra/test/message_tut.cpp +++ b/indra/test/message_tut.cpp @@ -93,7 +93,7 @@ namespace tut random.generate(); ostr << "message-test-" << random; mTestConfigDir = ostr.str(); - LLFile::mkdir(mTestConfigDir.c_str()); + LLFile::mkdir(mTestConfigDir); writeConfigFile(LLSD()); LLMessageConfig::initClass("simulator", ostr.str()); } @@ -107,11 +107,11 @@ namespace tut // rm contents of temp dir std::ostringstream ostr; ostr << mTestConfigDir << mSep << "message.xml"; - int rmfile = LLFile::remove(ostr.str().c_str()); + int rmfile = LLFile::remove(ostr.str()); ensure_equals("rmfile value", rmfile, 0); // rm temp dir - int rmdir = LLFile::rmdir(mTestConfigDir.c_str()); + int rmdir = LLFile::rmdir(mTestConfigDir); ensure_equals("rmdir value", rmdir, 0); } @@ -119,7 +119,7 @@ namespace tut { std::ostringstream ostr; ostr << mTestConfigDir << mSep << "message.xml"; - llofstream file(ostr.str().c_str()); + llofstream file(ostr.str()); if (file.is_open()) { LLSDSerialize::toPrettyXML(config, file); |