diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2014-10-23 20:23:08 -0700 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2014-10-23 20:23:08 -0700 |
commit | 918e2b629bd3dadfbe5288c0d72d93bcca1b8cfe (patch) | |
tree | b5ae202882071bf8e954b5bcb875305e37d0dc41 /indra/llcommon/tests/lldependencies_test.cpp | |
parent | 642c334efa2dbd0bafca5b0dbb11a986cd5ab4a9 (diff) |
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.
Diffstat (limited to 'indra/llcommon/tests/lldependencies_test.cpp')
-rwxr-xr-x | indra/llcommon/tests/lldependencies_test.cpp | 46 |
1 files changed, 28 insertions, 18 deletions
diff --git a/indra/llcommon/tests/lldependencies_test.cpp b/indra/llcommon/tests/lldependencies_test.cpp index 5395d785b6..b5e189a465 100755 --- a/indra/llcommon/tests/lldependencies_test.cpp +++ b/indra/llcommon/tests/lldependencies_test.cpp @@ -37,29 +37,14 @@ // associated header #include "../lldependencies.h" // other Linden headers -#include "../test/lltut.h" - -using boost::assign::list_of; #if LL_WINDOWS #pragma warning (disable : 4675) // "resolved by ADL" -- just as I want! #endif -typedef LLDependencies<> StringDeps; -typedef StringDeps::KeyList StringList; - -// We use the very cool boost::assign::list_of() construct to specify vectors -// of strings inline. For reasons on which I'm not entirely clear, though, it -// needs a helper function. You can use list_of() to construct an implicit -// StringList (std::vector<std::string>) by conversion, e.g. for a function -// parameter -- but if you simply write StringList(list_of("etc.")), you get -// ambiguity errors. Shrug! -template<typename CONTAINER> -CONTAINER make(const CONTAINER& data) -{ - return data; -} - +/***************************************************************************** +* Display helpers: must be defined BEFORE lltut.h! +*****************************************************************************/ // Display an arbitary value as itself... template<typename T> std::ostream& display(std::ostream& out, const T& value) @@ -113,6 +98,31 @@ std::ostream& operator<<(std::ostream& out, const std::set<ENTRY>& set) return out; } +/***************************************************************************** +* Now we can #include lltut.h +*****************************************************************************/ +#include "../test/lltut.h" + +/***************************************************************************** +* Other helpers +*****************************************************************************/ +using boost::assign::list_of; + +typedef LLDependencies<> StringDeps; +typedef StringDeps::KeyList StringList; + +// We use the very cool boost::assign::list_of() construct to specify vectors +// of strings inline. For reasons on which I'm not entirely clear, though, it +// needs a helper function. You can use list_of() to construct an implicit +// StringList (std::vector<std::string>) by conversion, e.g. for a function +// parameter -- but if you simply write StringList(list_of("etc.")), you get +// ambiguity errors. Shrug! +template<typename CONTAINER> +CONTAINER make(const CONTAINER& data) +{ + return data; +} + const std::string& extract_key(const LLDependencies<>::value_type& entry) { return entry.first; |