summaryrefslogtreecommitdiffstats
path: root/src/testlib
diff options
context:
space:
mode:
authorVincas Dargis <vindrg@gmail.com>2015-07-05 19:16:42 +0300
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2015-07-21 06:48:08 +0000
commitc963c514ac7945433cab94db29b4619f881371db (patch)
tree67c7277d956ff156d021af04227d3f6063ff66dc /src/testlib
parentbdbd26a3b73b718b54eb9ffb2ebf687924ed6e6d (diff)
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>
Diffstat (limited to 'src/testlib')
-rw-r--r--src/testlib/qtestcase.cpp2
-rw-r--r--src/testlib/qtestcase.h2
2 files changed, 4 insertions, 0 deletions
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
index 6634597c5e..4668c26934 100644
--- a/src/testlib/qtestcase.cpp
+++ b/src/testlib/qtestcase.cpp
@@ -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)
diff --git a/src/testlib/qtestcase.h b/src/testlib/qtestcase.h
index 9b0af186bc..9f3c461cf0 100644
--- a/src/testlib/qtestcase.h
+++ b/src/testlib/qtestcase.h
@@ -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