Skip to content

Commit a399acc

Browse files
longhuan2018nyalldawson
authored andcommittedApr 14, 2020
fix unicode string test error
1 parent 314353c commit a399acc

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed
 

‎tests/src/app/testqgsappbrowserproviders.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ void TestQgsAppBrowserProviders::testProjectItemCreation()
123123
QCOMPARE( child->children().at( 5 )->name(), QStringLiteral( "testlayer" ) );
124124

125125
QVERIFY( dynamic_cast< QgsLayerItem * >( child->children().at( 6 ) ) );
126-
QCOMPARE( child->children().at( 6 )->name(), QStringLiteral( "testlayer \u00E8\u00E9" ) );
126+
QCOMPARE( child->children().at( 6 )->name(), QString::fromStdString( "testlayer \u00E8\u00E9" ) );
127127

128128
delete dirItem;
129129
return;

‎tests/src/gui/testqgsprocessingmodel.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ void TestQgsProcessingModel::testModel()
235235
QModelIndex alg1Index = model.index( 0, 0, group1Index );
236236
QVERIFY( !model.providerForIndex( alg1Index ) );
237237
QCOMPARE( model.data( alg1Index, Qt::DisplayRole ).toString(), QStringLiteral( "a1" ) );
238-
QCOMPARE( model.data( alg1Index, Qt::ToolTipRole ).toString(), QStringLiteral( "<p><b>a1</b></p><p>short desc a</p><p>Algorithm ID: \u2018<i>p3:a1</i>\u2019</p>" ) );
238+
QCOMPARE( model.data( alg1Index, Qt::ToolTipRole ).toString(), QString::fromStdString( "<p><b>a1</b></p><p>short desc a</p><p>Algorithm ID: \u2018<i>p3:a1</i>\u2019</p>" ) );
239239
QCOMPARE( model.data( alg1Index, QgsProcessingToolboxModel::RoleAlgorithmFlags ).toInt(), static_cast< int >( QgsProcessingAlgorithm::FlagHideFromModeler ) );
240240
QCOMPARE( model.data( alg1Index, QgsProcessingToolboxModel::RoleAlgorithmId ).toString(), QStringLiteral( "p3:a1" ) );
241241
QCOMPARE( model.data( alg1Index, QgsProcessingToolboxModel::RoleAlgorithmName ).toString(), QStringLiteral( "a1" ) );
@@ -249,7 +249,7 @@ void TestQgsProcessingModel::testModel()
249249
QVERIFY( model.hasChildren( group2Index ) );
250250
QModelIndex alg2Index = model.index( 0, 0, group2Index );
251251
QCOMPARE( model.data( alg2Index, Qt::DisplayRole ).toString(), QStringLiteral( "a2" ) );
252-
QCOMPARE( model.data( alg2Index, Qt::ToolTipRole ).toString(), QStringLiteral( "<p><b>a2</b></p><p>Algorithm ID: \u2018<i>p3:a2</i>\u2019</p>" ) );
252+
QCOMPARE( model.data( alg2Index, Qt::ToolTipRole ).toString(), QString::fromStdString( "<p><b>a2</b></p><p>Algorithm ID: \u2018<i>p3:a2</i>\u2019</p>" ) );
253253
QCOMPARE( model.data( alg2Index, QgsProcessingToolboxModel::RoleAlgorithmFlags ).toInt(), static_cast< int >( QgsProcessingAlgorithm::FlagHideFromToolbox ) );
254254
QCOMPARE( model.data( alg2Index, QgsProcessingToolboxModel::RoleAlgorithmId ).toString(), QStringLiteral( "p3:a2" ) );
255255
QCOMPARE( model.data( alg2Index, QgsProcessingToolboxModel::RoleAlgorithmName ).toString(), QStringLiteral( "a2" ) );

0 commit comments

Comments
 (0)
Please sign in to comment.