Skip to content

Commit 0d178aa

Browse files
committedFeb 13, 2019
Fix build on xenial (Qt 5.5)
1 parent faf8c91 commit 0d178aa

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed
 

‎tests/src/gui/testqgsfieldexpressionwidget.cpp

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -148,53 +148,53 @@ void TestQgsFieldExpressionWidget::asExpression()
148148
widget->setField( QStringLiteral( "fld" ) );
149149
QCOMPARE( widget->asExpression(), QStringLiteral( "\"fld\"" ) );
150150
QCOMPARE( spy.count(), 1 );
151-
QCOMPARE( spy.constLast().at( 0 ).toString(), QStringLiteral( "fld" ) );
151+
QCOMPARE( spy.last().at( 0 ).toString(), QStringLiteral( "fld" ) );
152152
QCOMPARE( spy2.count(), 1 );
153-
QCOMPARE( spy2.constLast().at( 0 ).toString(), QStringLiteral( "fld" ) );
154-
QVERIFY( spy2.constLast().at( 1 ).toBool() );
153+
QCOMPARE( spy2.last().at( 0 ).toString(), QStringLiteral( "fld" ) );
154+
QVERIFY( spy2.last().at( 1 ).toBool() );
155155

156156
// check with expressions set
157157
widget->setField( QStringLiteral( "fld + 1" ) );
158158
QCOMPARE( widget->asExpression(), QStringLiteral( "fld + 1" ) );
159159
QCOMPARE( spy.count(), 2 );
160-
QCOMPARE( spy.constLast().at( 0 ).toString(), QStringLiteral( "fld + 1" ) );
160+
QCOMPARE( spy.last().at( 0 ).toString(), QStringLiteral( "fld + 1" ) );
161161
QCOMPARE( spy2.count(), 2 );
162-
QCOMPARE( spy2.constLast().at( 0 ).toString(), QStringLiteral( "fld + 1" ) );
163-
QVERIFY( spy2.constLast().at( 1 ).toBool() );
162+
QCOMPARE( spy2.last().at( 0 ).toString(), QStringLiteral( "fld + 1" ) );
163+
QVERIFY( spy2.last().at( 1 ).toBool() );
164164

165165
widget->setField( QStringLiteral( "1" ) );
166166
QCOMPARE( widget->asExpression(), QStringLiteral( "1" ) );
167167
QCOMPARE( spy.count(), 3 );
168-
QCOMPARE( spy.constLast().at( 0 ).toString(), QStringLiteral( "1" ) );
168+
QCOMPARE( spy.last().at( 0 ).toString(), QStringLiteral( "1" ) );
169169
QCOMPARE( spy2.count(), 3 );
170-
QCOMPARE( spy2.constLast().at( 0 ).toString(), QStringLiteral( "1" ) );
171-
QVERIFY( spy2.constLast().at( 1 ).toBool() );
170+
QCOMPARE( spy2.last().at( 0 ).toString(), QStringLiteral( "1" ) );
171+
QVERIFY( spy2.last().at( 1 ).toBool() );
172172

173173
widget->setField( QStringLiteral( "\"fld2\"" ) );
174174
QCOMPARE( widget->asExpression(), QStringLiteral( "\"fld2\"" ) );
175175
QCOMPARE( spy.count(), 4 );
176-
QCOMPARE( spy.constLast().at( 0 ).toString(), QStringLiteral( "fld2" ) );
176+
QCOMPARE( spy.last().at( 0 ).toString(), QStringLiteral( "fld2" ) );
177177
QCOMPARE( spy2.count(), 4 );
178-
QCOMPARE( spy2.constLast().at( 0 ).toString(), QStringLiteral( "fld2" ) );
179-
QVERIFY( spy2.constLast().at( 1 ).toBool() );
178+
QCOMPARE( spy2.last().at( 0 ).toString(), QStringLiteral( "fld2" ) );
179+
QVERIFY( spy2.last().at( 1 ).toBool() );
180180

181181
// check switching back to a field
182182
widget->setField( QStringLiteral( "fld3" ) );
183183
QCOMPARE( widget->asExpression(), QStringLiteral( "\"fld3\"" ) );
184184
QCOMPARE( spy.count(), 5 );
185-
QCOMPARE( spy.constLast().at( 0 ).toString(), QStringLiteral( "fld3" ) );
185+
QCOMPARE( spy.last().at( 0 ).toString(), QStringLiteral( "fld3" ) );
186186
QCOMPARE( spy2.count(), 5 );
187-
QCOMPARE( spy2.constLast().at( 0 ).toString(), QStringLiteral( "fld3" ) );
188-
QVERIFY( spy2.constLast().at( 1 ).toBool() );
187+
QCOMPARE( spy2.last().at( 0 ).toString(), QStringLiteral( "fld3" ) );
188+
QVERIFY( spy2.last().at( 1 ).toBool() );
189189

190190
// and back to null
191191
widget->setField( QString() );
192192
QVERIFY( widget->asExpression().isEmpty() );
193193
QCOMPARE( spy.count(), 6 );
194-
QVERIFY( spy.constLast().at( 0 ).toString().isEmpty() );
194+
QVERIFY( spy.last().at( 0 ).toString().isEmpty() );
195195
QCOMPARE( spy2.count(), 6 );
196-
QVERIFY( spy2.constLast().at( 0 ).toString().isEmpty() );
197-
QVERIFY( spy2.constLast().at( 1 ).toBool() );
196+
QVERIFY( spy2.last().at( 0 ).toString().isEmpty() );
197+
QVERIFY( spy2.last().at( 1 ).toBool() );
198198

199199
QgsProject::instance()->removeMapLayer( layer );
200200
}

0 commit comments

Comments
 (0)
Please sign in to comment.