QtTest: call toString() as a normal function

toString() is both a function template and a set of overloaded
functions (for const char* and const void*). So don't explicitly
specify the function template arguments (they're deduced from the
arguments anyway). This enables overloading toString() as well as
specializing the template.

[ChangeLog][QtTest][Important Behavior Changes] toString() can now be
overloaded (instead of just specialized) for custom types, and is now
reliably found through argument-dependent lookup (ADL).

Change-Id: Ic4a622d236ad7f0e4142835353f1b98bf2dc6d4c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Marc Mutz 2014-12-17 12:58:31 +01:00
parent 876c2164f4
commit c61f8df404

View File

@ -282,7 +282,7 @@ namespace QTest
const char *file, int line)
{
return compare_helper(t1 == t2, "Compared values are not the same",
toString<T>(t1), toString<T>(t2), actual, expected, file, line);
toString(t1), toString(t2), actual, expected, file, line);
}
Q_TESTLIB_EXPORT bool qCompare(float const &t1, float const &t2,