From 80606cc38d3b67f8af70fda5a351f3cbe7c3a15c Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 14 May 2019 05:27:38 -0400 Subject: [PATCH] [partition] Reduce test warnings through consistent signedness --- .../partition/tests/PartitionJobTests.cpp | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/modules/partition/tests/PartitionJobTests.cpp b/src/modules/partition/tests/PartitionJobTests.cpp index acb671254..f3bd8dd13 100644 --- a/src/modules/partition/tests/PartitionJobTests.cpp +++ b/src/modules/partition/tests/PartitionJobTests.cpp @@ -77,7 +77,7 @@ static QByteArray generateTestData( qint64 size ) { QByteArray ba; - ba.resize( size ); + ba.resize( static_cast( size ) ); // Fill the array explicitly to keep Valgrind happy for ( auto it = ba.data() ; it < ba.data() + size ; ++it ) { @@ -172,7 +172,8 @@ PartitionJobTests::initTestCase() QString devicePath = qgetenv( "CALAMARES_TEST_DISK" ); if ( devicePath.isEmpty() ) { - QSKIP( "Skipping test, CALAMARES_TEST_DISK is not set. It should point to a disk which can be safely formatted" ); + // The 0 is to keep the macro parameters happy + QSKIP( "Skipping test, CALAMARES_TEST_DISK is not set. It should point to a disk which can be safely formatted", 0 ); } QVERIFY( KPMHelpers::initKPMcore() ); @@ -327,10 +328,10 @@ PartitionJobTests::testCreatePartitionExtended() void PartitionJobTests::testResizePartition_data() { - QTest::addColumn< int >( "oldStartMiB" ); - QTest::addColumn< int >( "oldSizeMiB" ); - QTest::addColumn< int >( "newStartMiB" ); - QTest::addColumn< int >( "newSizeMiB" ); + QTest::addColumn< unsigned int >( "oldStartMiB" ); + QTest::addColumn< unsigned int >( "oldSizeMiB" ); + QTest::addColumn< unsigned int >( "newStartMiB" ); + QTest::addColumn< unsigned int >( "newSizeMiB" ); QTest::newRow("grow") << 10 << 50 << 10 << 70; QTest::newRow("shrink") << 10 << 70 << 10 << 50; @@ -341,10 +342,10 @@ PartitionJobTests::testResizePartition_data() void PartitionJobTests::testResizePartition() { - QFETCH( int, oldStartMiB ); - QFETCH( int, oldSizeMiB ); - QFETCH( int, newStartMiB ); - QFETCH( int, newSizeMiB ); + QFETCH( unsigned int, oldStartMiB ); + QFETCH( unsigned int, oldSizeMiB ); + QFETCH( unsigned int, newStartMiB ); + QFETCH( unsigned int, newSizeMiB ); const qint64 sectorsPerMiB = 1_MiB / m_device->logicalSize();