From 3f4e167acacdcccde1a1b385c7f6a4d68f615bc6 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Thu, 23 Apr 2020 12:16:30 +0200 Subject: [PATCH] [libcalamares] Expand kpm test with API 3/4 differences - fix build - KPMCore 3 distinguishes esp and boot - KPMCore 4 does not --- src/libcalamares/partition/KPMTests.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/libcalamares/partition/KPMTests.cpp b/src/libcalamares/partition/KPMTests.cpp index edf7edf61..c84d70c99 100644 --- a/src/libcalamares/partition/KPMTests.cpp +++ b/src/libcalamares/partition/KPMTests.cpp @@ -57,11 +57,21 @@ KPMTests::testFlagNames() f <<= 1; } + +#ifdef WITH_KPMCORE4API + // KPMCore 4 unifies the flags and handles them internally + QVERIFY( names.contains( QStringLiteral( "boot" ) ) ); + QVERIFY( !names.contains( QStringLiteral( "esp" ) ) ); +#else + // KPMCore 3 has separate flags + QVERIFY( names.contains( QStringLiteral( "boot" ) ) ); + QVERIFY( names.contains( QStringLiteral( "esp" ) ) ); +#endif } QTEST_GUILESS_MAIN( KPMTests ) -#include "moc-warnings.h" +#include "utils/moc-warnings.h" #include "KPMTests.moc"