From 918e2b629bd3dadfbe5288c0d72d93bcca1b8cfe Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 23 Oct 2014 20:23:08 -0700 Subject: Bring in new TUT library build. Clean up ensure_equals() overloads. The new TUT library build eliminates the ambiguity about ensure_equals(const char*, ...) versus ensure_equals(const std::string&, ...). Now it's all based on const std::string&. Remove pointless const char* overloads and ambiguous forwarding templates. With clang in Xcode 6, any new datatypes we intend to use with ensure_equals() must have operator<<(std::ostream&, datatype) declared BEFORE lltut.h #includes tut.hpp. Reorder code in certain test source files to guarantee that visibility. --- indra/test/lltut.cpp | 18 +++--------------- indra/test/lltut.h | 21 +++++---------------- 2 files changed, 8 insertions(+), 31 deletions(-) (limited to 'indra/test') diff --git a/indra/test/lltut.cpp b/indra/test/lltut.cpp index 2730fb34d7..5a8ee87afd 100755 --- a/indra/test/lltut.cpp +++ b/indra/test/lltut.cpp @@ -38,14 +38,14 @@ namespace tut { - void ensure_equals(const char* msg, const LLDate& actual, + void ensure_equals(const std::string& msg, const LLDate& actual, const LLDate& expected) { ensure_equals(msg, actual.secondsSinceEpoch(), expected.secondsSinceEpoch()); } - void ensure_equals(const char* msg, const LLURI& actual, + void ensure_equals(const std::string& msg, const LLURI& actual, const LLURI& expected) { ensure_equals(msg, @@ -61,18 +61,12 @@ namespace tut // if the LLSD::Binary type ever diverges from what we expect in lltut.h, // that divergence will produce an error: no definition will match that // declaration. - void ensure_equals(const char* msg, - const LLSD::Binary& actual, const LLSD::Binary& expected) - { - ensure_equals(std::string(msg? msg : ""), actual, expected); - } - void ensure_equals(const std::string& msg, const LLSD::Binary& actual, const LLSD::Binary& expected) { ensure_equals(msg + " size", actual.size(), expected.size()); - std::vector::const_iterator i, j; + LLSD::Binary::const_iterator i, j; int k; for (i = actual.begin(), j = expected.begin(), k = 0; i != actual.end(); @@ -82,12 +76,6 @@ namespace tut } } - void ensure_equals(const char* m, const LLSD& actual, - const LLSD& expected) - { - ensure_equals(std::string(m? m : ""), actual, expected); - } - void ensure_equals(const std::string& msg, const LLSD& actual, const LLSD& expected) { diff --git a/indra/test/lltut.h b/indra/test/lltut.h index 6cb670b2a3..b334fb51e2 100755 --- a/indra/test/lltut.h +++ b/indra/test/lltut.h @@ -38,35 +38,24 @@ class LLURI; namespace tut { - template void ensure_equals(const std::string& msg, - const Q& actual,const T& expected) - { ensure_equals(msg.c_str(), actual, expected); } - - void ensure_equals(const char* msg, const LLDate& actual, const LLDate& expected); - void ensure_equals(const char* msg, + void ensure_equals(const std::string& msg, const LLURI& actual, const LLURI& expected); // std::vector is the current definition of LLSD::Binary. Because // we're only forward-declaring LLSD in this header file, we can't // directly reference that nested type. If the build complains that - // there's no definition for either of these declarations, it could be - // that LLSD::Binary has changed, and that these declarations must be - // adjusted to match. - void ensure_equals(const char* msg, - const std::vector& actual, const std::vector& expected); - + // there's no definition for this declaration, it could be that + // LLSD::Binary has changed, and that this declaration must be adjusted to + // match. void ensure_equals(const std::string& msg, const std::vector& actual, const std::vector& expected); - void ensure_equals(const char* msg, - const LLSD& actual, const LLSD& expected); - void ensure_equals(const std::string& msg, const LLSD& actual, const LLSD& expected); - + void ensure_starts_with(const std::string& msg, const std::string& actual, const std::string& expectedStart); -- cgit v1.2.3