[libcalamares] Test some specific KPM partition flags

This commit is contained in:
Adriaan de Groot 2020-04-23 13:46:09 +02:00
parent 3f4e167aca
commit 79e8c447b9

View File

@ -58,12 +58,17 @@ KPMTests::testFlagNames()
f <<= 1;
}
QCOMPARE( PartitionTable::flagName( static_cast< PartitionTable::Flag >( 1 ) ), QStringLiteral( "boot" ) );
#ifdef WITH_KPMCORE4API
// KPMCore 4 unifies the flags and handles them internally
QCOMPARE( PartitionTable::flagName( PartitionTable::Flag::Boot ), QStringLiteral( "boot" ) );
QVERIFY( names.contains( QStringLiteral( "boot" ) ) );
QVERIFY( !names.contains( QStringLiteral( "esp" ) ) );
#else
// KPMCore 3 has separate flags
QCOMPARE( PartitionTable::flagName( PartitionTable::FlagBoot ), QStringLiteral( "boot" ) );
QCOMPARE( PartitionTable::flagName( PartitionTable::FlagEsp ), QStringLiteral( "esp" ) );
QVERIFY( names.contains( QStringLiteral( "boot" ) ) );
QVERIFY( names.contains( QStringLiteral( "esp" ) ) );
#endif