summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2019-06-23 15:11:17 +0200
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2019-06-23 15:52:41 +0200
commit5e86aa93fc61ab6eb48b2da1704cd7ced6bc302d (patch)
treea9acc4fda530248249c661e748161975e06eb267 /tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp
parent43c410867b5eccea2e0f7eeceabad76d5f874101 (diff)
QByteArray autotest: code tidies
Suppress a few warnings raised by GCC 9. Change-Id: Ic52dc9c85e447ee0f54ef8310a7fcd41d6e09304 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp')
-rw-r--r--tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp b/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp
index 987b3058e3..90dfcaef25 100644
--- a/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp
+++ b/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp
@@ -1935,7 +1935,7 @@ void tst_QByteArray::repeatedSignature() const
{
/* repated() should be a const member. */
const QByteArray string;
- string.repeated(3);
+ (void)string.repeated(3);
}
void tst_QByteArray::repeated() const
@@ -2127,7 +2127,7 @@ void tst_QByteArray::movablity()
{
QFETCH(QByteArray, array);
- QVERIFY(!QTypeInfo<QByteArray>::isStatic);
+ Q_STATIC_ASSERT(!QTypeInfo<QByteArray>::isStatic);
const int size = array.size();
const bool isEmpty = array.isEmpty();
@@ -2139,7 +2139,7 @@ void tst_QByteArray::movablity()
// we need only memory space not the instance
memSpace.~QByteArray();
// move array -> memSpace
- memcpy(&memSpace, &array, sizeof(QByteArray));
+ memcpy((void *)&memSpace, (const void *)&array, sizeof(QByteArray));
// reconstruct empty QByteArray
new (&array) QByteArray;
@@ -2149,8 +2149,8 @@ void tst_QByteArray::movablity()
QCOMPARE(memSpace.capacity(), capacity);
// try to not crash
- memSpace.toLower();
- memSpace.toUpper();
+ (void)memSpace.toLower();
+ (void)memSpace.toUpper();
memSpace.prepend('a');
memSpace.append("b", 1);
memSpace.squeeze();
@@ -2166,7 +2166,7 @@ void tst_QByteArray::movablity()
// move back memSpace -> array
array.~QByteArray();
- memcpy(&array, &memSpace, sizeof(QByteArray));
+ memcpy((void *)&array, (const void *)&memSpace, sizeof(QByteArray));
// reconstruct empty QByteArray
new (&memSpace) QByteArray;