summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/global
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2021-05-17 12:50:49 +0200
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2021-05-18 02:09:06 +0200
commit8b8ff64be273d9e74ac64d7efd1d5f6b2c70d362 (patch)
tree9c53e7a725a34f5be444e84083b21a4105c96fe7 /tests/auto/corelib/global
parent8f7873272ac9e5c5f1a83a5204afb512843cf8d8 (diff)
PRIx macros: add some actual testing
Not just a compile-time one (that the macros compile and don't raise warnings). Change-Id: I5642bf242a6c26a33730708f3c1710237fc107a2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/corelib/global')
-rw-r--r--tests/auto/corelib/global/qglobal/tst_qglobal.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/auto/corelib/global/qglobal/tst_qglobal.cpp b/tests/auto/corelib/global/qglobal/tst_qglobal.cpp
index d2a449bb58..5547f832ff 100644
--- a/tests/auto/corelib/global/qglobal/tst_qglobal.cpp
+++ b/tests/auto/corelib/global/qglobal/tst_qglobal.cpp
@@ -674,27 +674,27 @@ void tst_QGlobal::PRImacros()
// none of these calls must generate a -Wformat warning
{
quintptr p = 123u;
- (void)QString::asprintf("The value %" PRIuQUINTPTR " is nice", p);
- (void)QString::asprintf("The value %" PRIoQUINTPTR " is nice", p);
- (void)QString::asprintf("The value %" PRIxQUINTPTR " is nice", p);
- (void)QString::asprintf("The value %" PRIXQUINTPTR " is nice", p);
+ QCOMPARE(QString::asprintf("The value %" PRIuQUINTPTR " is nice", p), "The value 123 is nice");
+ QCOMPARE(QString::asprintf("The value %" PRIoQUINTPTR " is nice", p), "The value 173 is nice");
+ QCOMPARE(QString::asprintf("The value %" PRIxQUINTPTR " is nice", p), "The value 7b is nice");
+ QCOMPARE(QString::asprintf("The value %" PRIXQUINTPTR " is nice", p), "The value 7B is nice");
}
{
qintptr p = 123;
- (void)QString::asprintf("The value %" PRIdQINTPTR " is nice", p);
- (void)QString::asprintf("The value %" PRIiQINTPTR " is nice", p);
+ QCOMPARE(QString::asprintf("The value %" PRIdQINTPTR " is nice", p), "The value 123 is nice");
+ QCOMPARE(QString::asprintf("The value %" PRIiQINTPTR " is nice", p), "The value 123 is nice");
}
{
qptrdiff d = 123;
- (void)QString::asprintf("The value %" PRIdQPTRDIFF " is nice", d);
- (void)QString::asprintf("The value %" PRIiQPTRDIFF " is nice", d);
+ QCOMPARE(QString::asprintf("The value %" PRIdQPTRDIFF " is nice", d), "The value 123 is nice");
+ QCOMPARE(QString::asprintf("The value %" PRIiQPTRDIFF " is nice", d), "The value 123 is nice");
}
{
qsizetype s = 123;
- (void)QString::asprintf("The value %" PRIdQSIZETYPE " is nice", s);
- (void)QString::asprintf("The value %" PRIiQSIZETYPE " is nice", s);
+ QCOMPARE(QString::asprintf("The value %" PRIdQSIZETYPE " is nice", s), "The value 123 is nice");
+ QCOMPARE(QString::asprintf("The value %" PRIiQSIZETYPE " is nice", s), "The value 123 is nice");
}
}