Skip to content

Commit

Permalink
Fix test on Travis
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Sep 12, 2018
1 parent c5ab589 commit adc31bb
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions tests/src/core/testqgsstyle.cpp
Expand Up @@ -270,7 +270,7 @@ void TestStyle::testFavorites()
// remove one symbol from favorites
mStyle->removeFavorite( QgsStyle::SymbolEntity, QStringLiteral( "symbolA" ) );
QCOMPARE( favoriteChangedSpy.count(), 1 );
QCOMPARE( favoriteChangedSpy.at( 0 ).at( 0 ).toInt(), QgsStyle::SymbolEntity );
QCOMPARE( favoriteChangedSpy.at( 0 ).at( 0 ).toInt(), static_cast< int >( QgsStyle::SymbolEntity ) );
QCOMPARE( favoriteChangedSpy.at( 0 ).at( 1 ).toString(), QStringLiteral( "symbolA" ) );
QCOMPARE( favoriteChangedSpy.at( 0 ).at( 2 ).toBool(), false );

Expand All @@ -281,7 +281,7 @@ void TestStyle::testFavorites()

mStyle->addFavorite( QgsStyle::SymbolEntity, QStringLiteral( "symbolA" ) );
QCOMPARE( favoriteChangedSpy.count(), 2 );
QCOMPARE( favoriteChangedSpy.at( 1 ).at( 0 ).toInt(), QgsStyle::SymbolEntity );
QCOMPARE( favoriteChangedSpy.at( 1 ).at( 0 ).toInt(), static_cast< int >( QgsStyle::SymbolEntity ) );
QCOMPARE( favoriteChangedSpy.at( 1 ).at( 1 ).toString(), QStringLiteral( "symbolA" ) );
QCOMPARE( favoriteChangedSpy.at( 1 ).at( 2 ).toBool(), true );
favorites = mStyle->symbolsOfFavorite( QgsStyle::SymbolEntity );
Expand All @@ -295,7 +295,7 @@ void TestStyle::testFavorites()

mStyle->addFavorite( QgsStyle::ColorrampEntity, QStringLiteral( "gradient_1" ) );
QCOMPARE( favoriteChangedSpy.count(), 3 );
QCOMPARE( favoriteChangedSpy.at( 2 ).at( 0 ).toInt(), QgsStyle::ColorrampEntity );
QCOMPARE( favoriteChangedSpy.at( 2 ).at( 0 ).toInt(), static_cast< int >( QgsStyle::ColorrampEntity ) );
QCOMPARE( favoriteChangedSpy.at( 2 ).at( 1 ).toString(), QStringLiteral( "gradient_1" ) );
QCOMPARE( favoriteChangedSpy.at( 2 ).at( 2 ).toBool(), true );
favorites = mStyle->symbolsOfFavorite( QgsStyle::ColorrampEntity );
Expand All @@ -304,7 +304,7 @@ void TestStyle::testFavorites()

mStyle->removeFavorite( QgsStyle::ColorrampEntity, QStringLiteral( "gradient_1" ) );
QCOMPARE( favoriteChangedSpy.count(), 4 );
QCOMPARE( favoriteChangedSpy.at( 3 ).at( 0 ).toInt(), QgsStyle::ColorrampEntity );
QCOMPARE( favoriteChangedSpy.at( 3 ).at( 0 ).toInt(), static_cast< int >( QgsStyle::ColorrampEntity ) );
QCOMPARE( favoriteChangedSpy.at( 3 ).at( 1 ).toString(), QStringLiteral( "gradient_1" ) );
QCOMPARE( favoriteChangedSpy.at( 3 ).at( 2 ).toBool(), false );
favorites = mStyle->symbolsOfFavorite( QgsStyle::ColorrampEntity );
Expand Down Expand Up @@ -364,13 +364,13 @@ void TestStyle::testTags()
//tag them
QVERIFY( mStyle->tagSymbol( QgsStyle::SymbolEntity, "blue starry", QStringList() << "blue" << "starry" ) );
QCOMPARE( tagsChangedSpy.count(), 1 );
QCOMPARE( tagsChangedSpy.at( 0 ).at( 0 ).toInt(), QgsStyle::SymbolEntity );
QCOMPARE( tagsChangedSpy.at( 0 ).at( 0 ).toInt(), static_cast< int >( QgsStyle::SymbolEntity ) );
QCOMPARE( tagsChangedSpy.at( 0 ).at( 1 ).toString(), QStringLiteral( "blue starry" ) );
QCOMPARE( tagsChangedSpy.at( 0 ).at( 2 ).toStringList(), QStringList() << QStringLiteral( "blue" ) << QStringLiteral( "starry" ) );

QVERIFY( mStyle->tagSymbol( QgsStyle::SymbolEntity, "red circle", QStringList() << "red" << "circle" ) );
QCOMPARE( tagsChangedSpy.count(), 2 );
QCOMPARE( tagsChangedSpy.at( 1 ).at( 0 ).toInt(), QgsStyle::SymbolEntity );
QCOMPARE( tagsChangedSpy.at( 1 ).at( 0 ).toInt(), static_cast< int >( QgsStyle::SymbolEntity ) );
QCOMPARE( tagsChangedSpy.at( 1 ).at( 1 ).toString(), QStringLiteral( "red circle" ) );
QCOMPARE( tagsChangedSpy.at( 1 ).at( 2 ).toStringList(), QStringList() << QStringLiteral( "red" ) << QStringLiteral( "circle" ) );

Expand All @@ -380,7 +380,7 @@ void TestStyle::testTags()
//tag which hasn't been added yet
QVERIFY( mStyle->tagSymbol( QgsStyle::SymbolEntity, "red circle", QStringList() << "round" ) );
QCOMPARE( tagsChangedSpy.count(), 3 );
QCOMPARE( tagsChangedSpy.at( 2 ).at( 0 ).toInt(), QgsStyle::SymbolEntity );
QCOMPARE( tagsChangedSpy.at( 2 ).at( 0 ).toInt(), static_cast< int >( QgsStyle::SymbolEntity ) );
QCOMPARE( tagsChangedSpy.at( 2 ).at( 1 ).toString(), QStringLiteral( "red circle" ) );
QCOMPARE( tagsChangedSpy.at( 2 ).at( 2 ).toStringList(), QStringList() << QStringLiteral( "red" ) << QStringLiteral( "circle" ) << QStringLiteral( "round" ) );

Expand Down Expand Up @@ -426,7 +426,7 @@ void TestStyle::testTags()
QCOMPARE( tags.count(), 1 );
QVERIFY( tags.contains( "starry" ) );
QCOMPARE( tagsChangedSpy.count(), 5 );
QCOMPARE( tagsChangedSpy.at( 4 ).at( 0 ).toInt(), QgsStyle::SymbolEntity );
QCOMPARE( tagsChangedSpy.at( 4 ).at( 0 ).toInt(), static_cast< int >( QgsStyle::SymbolEntity ) );
QCOMPARE( tagsChangedSpy.at( 4 ).at( 1 ).toString(), QStringLiteral( "blue starry" ) );
QCOMPARE( tagsChangedSpy.at( 4 ).at( 2 ).toStringList(), QStringList() << QStringLiteral( "starry" ) );

Expand All @@ -435,7 +435,7 @@ void TestStyle::testTags()
tags = mStyle->tagsOfSymbol( QgsStyle::SymbolEntity, QStringLiteral( "blue starry" ) );
QCOMPARE( tags.count(), 0 );
QCOMPARE( tagsChangedSpy.count(), 6 );
QCOMPARE( tagsChangedSpy.at( 5 ).at( 0 ).toInt(), QgsStyle::SymbolEntity );
QCOMPARE( tagsChangedSpy.at( 5 ).at( 0 ).toInt(), static_cast< int >( QgsStyle::SymbolEntity ) );
QCOMPARE( tagsChangedSpy.at( 5 ).at( 1 ).toString(), QStringLiteral( "blue starry" ) );
QCOMPARE( tagsChangedSpy.at( 5 ).at( 2 ).toStringList(), QStringList() );

Expand Down Expand Up @@ -537,7 +537,7 @@ void TestStyle::testTags()
QCOMPARE( tags.count(), 1 );
QVERIFY( tags.contains( "starry" ) );
QCOMPARE( tagsChangedSpy.count(), 13 );
QCOMPARE( tagsChangedSpy.at( 12 ).at( 0 ).toInt(), QgsStyle::ColorrampEntity );
QCOMPARE( tagsChangedSpy.at( 12 ).at( 0 ).toInt(), static_cast< int >( QgsStyle::ColorrampEntity ) );
QCOMPARE( tagsChangedSpy.at( 12 ).at( 1 ).toString(), QStringLiteral( "gradient_tag1" ) );
QCOMPARE( tagsChangedSpy.at( 12 ).at( 2 ).toStringList(), QStringList() << QStringLiteral( "starry" ) );

Expand All @@ -546,7 +546,7 @@ void TestStyle::testTags()
tags = mStyle->tagsOfSymbol( QgsStyle::ColorrampEntity, QStringLiteral( "gradient_tag1" ) );
QCOMPARE( tags.count(), 0 );
QCOMPARE( tagsChangedSpy.count(), 14 );
QCOMPARE( tagsChangedSpy.at( 13 ).at( 0 ).toInt(), QgsStyle::ColorrampEntity );
QCOMPARE( tagsChangedSpy.at( 13 ).at( 0 ).toInt(), static_cast< int >( QgsStyle::ColorrampEntity ) );
QCOMPARE( tagsChangedSpy.at( 13 ).at( 1 ).toString(), QStringLiteral( "gradient_tag1" ) );
QCOMPARE( tagsChangedSpy.at( 13 ).at( 2 ).toStringList(), QStringList() );
}
Expand Down

0 comments on commit adc31bb

Please sign in to comment.