on xenial help sign in
Fix utils tests

The old usage of the QCOMPARE() macro appears to have been removed between Qt 5.4 and 5.9. By creating and using a new variable we avoid issues.

commit7d149cf15f0ec629868d2449322753b5e978e235 authorDalton Durst <dalton@ubports.com> dateMon 9 Mar 2020, 19:12 (7 years ago) parent78c5a3a
2 files changed+3−2
tests/plugins/CMakeLists.txt+1−1 tests/plugins/Utils/ModelTest.cpp+2−1
tests/plugins/CMakeLists.txt+1−1
@@ -6,6 +6,6 @@ add_subdirectory(LightDM)
66add_subdirectory(SessionBroadcast)
77add_subdirectory(Ubuntu)
88add_subdirectory(Unity)
9−#add_subdirectory(Utils) #FIXME broken with qt 5.9
9+add_subdirectory(Utils)
1010add_subdirectory(WindowManager)
1111#add_subdirectory(Wizard) #FIXME broken
tests/plugins/Utils/ModelTest.cpp+2−1
@@ -441,7 +441,8 @@ void ModelTest::data()
441441 QVariant textAlignmentVariant = model->data ( model->index ( 0, 0 ), Qt::TextAlignmentRole );
442442 if ( textAlignmentVariant.isValid() ) {
443443 int alignment = textAlignmentVariant.toInt();
444− QCOMPARE( alignment, ( alignment & ( Qt::AlignHorizontal_Mask | Qt::AlignVertical_Mask ) ) );
444+ int alignment_test = alignment & ( Qt::AlignHorizontal_Mask | Qt::AlignVertical_Mask );
445+ QCOMPARE( alignment, alignment_test );
445446 }
446447
447448 // General Purpose roles that should return a QColor