Qt Test: Fix QCOMPARE message for signed and unsigned char.

QCOMPARE did not print "Actual" and "Expected" values for quint8
and qint8 variables when they where not equal. QTest::toString<T>()
lacked specializations for signed and unsigned char types, that are
actually distinct types from char.

Change-Id: Iae789885c474c56441da45065992d7ccf1bc9f5c
Task-number: QTBUG-45238
Reviewed-by: Jason McDonald <macadder1@gmail.com>
This commit is contained in:
Vincas Dargis 2015-07-05 19:16:42 +03:00 committed by Simon Hausmann
parent bdbd26a3b7
commit c963c514ac
2 changed files with 4 additions and 0 deletions

View File

@ -3337,6 +3337,8 @@ TO_STRING_IMPL(quint64, %llu)
#endif
TO_STRING_IMPL(bool, %d)
TO_STRING_IMPL(char, %c)
TO_STRING_IMPL(signed char, %hhd)
TO_STRING_IMPL(unsigned char, %hhu)
TO_STRING_IMPL(float, %g)
TO_STRING_IMPL(double, %lg)

View File

@ -340,6 +340,8 @@ namespace QTest
QTEST_COMPARE_DECL(float)
QTEST_COMPARE_DECL(double)
QTEST_COMPARE_DECL(char)
QTEST_COMPARE_DECL(signed char)
QTEST_COMPARE_DECL(unsigned char)
QTEST_COMPARE_DECL(bool)
#endif