Fixing tut related compile errors on etch:

(1) the LLLand class had to be forward declared in a cpp file that did not include llland.h
(2) ensure_equals(const char*, type, type) requires that type have an operator!=(type, type) defined.
(3) ensure_equals(const char*, type, type) is so overloaded that the compiler can have trouble picking the right version when it has to implicitly cast a std::string to "const char*" AND multiple valid casts exist for type --> S32, F32, etc.  To solve this problem we must explicitly pass in a "const char*" instead of a std::string.
Reviewed with CG
meow-7.2.2
Andrew Meadows 2008-12-19 22:33:29 +00:00
parent 796a10d8e0
commit 5b2f960ceb
5 changed files with 17 additions and 2 deletions

View File

@ -234,6 +234,11 @@ void LLDate::secondsSinceEpoch(F64 seconds)
mSecondsSinceEpoch = seconds;
}
bool operator!=(const LLDate& first, const LLDate& second)
{
return (first.secondsSinceEpoch() != second.secondsSinceEpoch());
}
std::ostream& operator<<(std::ostream& s, const LLDate& date)
{
date.toStream(s);

View File

@ -116,6 +116,8 @@ private:
F64 mSecondsSinceEpoch;
};
// this operator required for tut
bool operator!=(const LLDate& first, const LLDate& second);
// Helper function to stream out a date
std::ostream& operator<<(std::ostream& s, const LLDate& date);

View File

@ -599,3 +599,8 @@ std::string LLURI::mapToQueryString(const LLSD& queryMap)
}
return query_string;
}
bool operator!=(const LLURI& first, const LLURI& second)
{
return (first.asString() != second.asString());
}

View File

@ -187,4 +187,7 @@ private:
std::string mEscapedQuery;
};
// this operator required for tut
bool operator!=(const LLURI& first, const LLURI& second);
#endif // LL_LLURI_H

View File

@ -124,7 +124,7 @@ namespace tut
{
ensure_equals(msg + " map keys",
actual_iter->first, expected_iter->first);
ensure_equals(msg + "[" + actual_iter->first + "]",
ensure_equals((msg + "[" + actual_iter->first + "]").c_str(),
actual_iter->second, expected_iter->second);
++actual_iter;
++expected_iter;
@ -137,7 +137,7 @@ namespace tut
for(int i = 0; i < actual.size(); ++i)
{
ensure_equals(msg + llformat("[%d]", i),
ensure_equals((msg + llformat("[%d]", i)).c_str(),
actual[i], expected[i]);
}
return;