[partition] Support KPMCore 3.3 in tests

This commit is contained in:
Adriaan de Groot 2020-10-06 23:51:30 +02:00
parent f28d28a455
commit db537535ee

View File

@ -125,6 +125,7 @@ CreateLayoutsTests::testMixedSizePartition()
QCOMPARE( partitions[2]->length(), ((5_GiB - 5_MiB)/2)/LOGICAL_SIZE ); QCOMPARE( partitions[2]->length(), ((5_GiB - 5_MiB)/2)/LOGICAL_SIZE );
} }
#ifdef WITH_KPMCORE4API
// TODO: Get a clean way to instanciate a test Device from KPMCore // TODO: Get a clean way to instanciate a test Device from KPMCore
class DevicePrivate class DevicePrivate
{ {
@ -143,3 +144,9 @@ TestDevice::TestDevice(const QString& name, const qint64 logicalSectorSize, cons
: Device (std::make_shared<DevicePrivate>(), name, QString( "node" ), logicalSectorSize, totalLogicalSectors, QString(), Device::Type::Unknown_Device) : Device (std::make_shared<DevicePrivate>(), name, QString( "node" ), logicalSectorSize, totalLogicalSectors, QString(), Device::Type::Unknown_Device)
{ {
} }
#else
TestDevice::TestDevice(const QString& name, const qint64 logicalSectorSize, const qint64 totalLogicalSectors)
: Device (name, QString( "node" ), logicalSectorSize, totalLogicalSectors, QString(), Device::Type::Unknown_Device)
{
}
#endif