Partitionmanager: fix PM-tests build
This commit is contained in:
parent
49e0d0d504
commit
1479fc974e
@ -29,8 +29,8 @@ include_directories(
|
|||||||
ecm_add_test( ${partitionjobtests_SRCS}
|
ecm_add_test( ${partitionjobtests_SRCS}
|
||||||
TEST_NAME partitionjobtests
|
TEST_NAME partitionjobtests
|
||||||
LINK_LIBRARIES
|
LINK_LIBRARIES
|
||||||
calapm
|
|
||||||
${CALAMARES_LIBRARIES}
|
${CALAMARES_LIBRARIES}
|
||||||
|
kpmcore
|
||||||
Qt5::Core
|
Qt5::Core
|
||||||
Qt5::Test
|
Qt5::Test
|
||||||
KF5::Service
|
KF5::Service
|
||||||
|
@ -24,7 +24,6 @@
|
|||||||
#include <core/KPMHelpers.h>
|
#include <core/KPMHelpers.h>
|
||||||
|
|
||||||
// CalaPM
|
// CalaPM
|
||||||
#include <CalaPM.h>
|
|
||||||
#include <backend/corebackend.h>
|
#include <backend/corebackend.h>
|
||||||
#include <backend/corebackendmanager.h>
|
#include <backend/corebackendmanager.h>
|
||||||
#include <fs/filesystemfactory.h>
|
#include <fs/filesystemfactory.h>
|
||||||
@ -166,7 +165,7 @@ PartitionJobTests::initTestCase()
|
|||||||
QSKIP( "Skipping test, CALAMARES_TEST_DISK is not set. It should point to a disk which can be safely formatted" );
|
QSKIP( "Skipping test, CALAMARES_TEST_DISK is not set. It should point to a disk which can be safely formatted" );
|
||||||
}
|
}
|
||||||
|
|
||||||
QVERIFY( CalaPM::init() );
|
QVERIFY( KPMHelpers::initKPMcore() );
|
||||||
FileSystemFactory::init();
|
FileSystemFactory::init();
|
||||||
|
|
||||||
refreshDevice();
|
refreshDevice();
|
||||||
@ -212,7 +211,7 @@ PartitionJobTests::newCreatePartitionJob( Partition* freeSpacePartition, Partiti
|
|||||||
qint64 lastSector;
|
qint64 lastSector;
|
||||||
|
|
||||||
if ( size > 0 )
|
if ( size > 0 )
|
||||||
lastSector = firstSector + size / m_device->logicalSectorSize();
|
lastSector = firstSector + size / m_device->logicalSize();
|
||||||
else
|
else
|
||||||
lastSector = freeSpacePartition->lastSector();
|
lastSector = freeSpacePartition->lastSector();
|
||||||
FileSystem* fs = FileSystemFactory::create( type, firstSector, lastSector );
|
FileSystem* fs = FileSystemFactory::create( type, firstSector, lastSector );
|
||||||
@ -335,7 +334,7 @@ PartitionJobTests::testResizePartition()
|
|||||||
QFETCH( int, newStartMB );
|
QFETCH( int, newStartMB );
|
||||||
QFETCH( int, newSizeMB );
|
QFETCH( int, newSizeMB );
|
||||||
|
|
||||||
const qint64 sectorForMB = MB / m_device->logicalSectorSize();
|
const qint64 sectorForMB = MB / m_device->logicalSize();
|
||||||
|
|
||||||
qint64 oldFirst = sectorForMB * oldStartMB;
|
qint64 oldFirst = sectorForMB * oldStartMB;
|
||||||
qint64 oldLast = oldFirst + sectorForMB * oldSizeMB - 1;
|
qint64 oldLast = oldFirst + sectorForMB * oldSizeMB - 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user