"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tests/src/server/testqgsserverquerystringparameter.cpp" between
QGIS-final-3_10_5.tar.gz and QGIS-final-3_10_6.tar.gz

About: QGIS (Quantum GIS) is a Geographic Information System that supports vector, raster, and database formats. Long-term release (3.10.x series).

testqgsserverquerystringparameter.cpp  (QGIS-final-3_10_5):testqgsserverquerystringparameter.cpp  (QGIS-final-3_10_6)
skipping to change at line 120 skipping to change at line 120
// Test double // Test double
p.mType = QgsServerQueryStringParameter::Type::Double; p.mType = QgsServerQueryStringParameter::Type::Double;
request.setUrl( QStringLiteral( "http://www.qgis.org/api/?parameter1=123" ) ); request.setUrl( QStringLiteral( "http://www.qgis.org/api/?parameter1=123" ) );
QCOMPARE( p.value( ctx ).toDouble(), 123.0 ); QCOMPARE( p.value( ctx ).toDouble(), 123.0 );
QCOMPARE( p.value( ctx ).type(), QVariant::Double ); QCOMPARE( p.value( ctx ).type(), QVariant::Double );
request.setUrl( QStringLiteral( "http://www.qgis.org/api/?parameter1=123.456" ) ); request.setUrl( QStringLiteral( "http://www.qgis.org/api/?parameter1=123.456" ) );
QCOMPARE( p.value( ctx ).toDouble(), 123.456 ); QCOMPARE( p.value( ctx ).toDouble(), 123.456 );
QCOMPARE( p.value( ctx ).type(), QVariant::Double ); QCOMPARE( p.value( ctx ).type(), QVariant::Double );
request.setUrl( QStringLiteral( "http://www.qgis.org/api/?parameter1=a%20strin g" ) ); request.setUrl( QStringLiteral( "http://www.qgis.org/api/?parameter1=a%20strin g" ) );
QVERIFY_EXCEPTION_THROWN( p.value( ctx ), QgsServerApiBadRequestException ); QVERIFY_EXCEPTION_THROWN( p.value( ctx ), QgsServerApiBadRequestException );
QCOMPARE( QString::fromStdString( p.data()["schema"]["type"] ), QString( "numb er" ) );
// Test list // Test list
p.mType = QgsServerQueryStringParameter::Type::List; p.mType = QgsServerQueryStringParameter::Type::List;
request.setUrl( QStringLiteral( "http://www.qgis.org/api/?parameter1=123,a%20v alue" ) ); request.setUrl( QStringLiteral( "http://www.qgis.org/api/?parameter1=123,a%20v alue" ) );
QCOMPARE( p.value( ctx ).toStringList(), QStringList() << QStringLiteral( "123 " ) << QStringLiteral( "a value" ) ); QCOMPARE( p.value( ctx ).toStringList(), QStringList() << QStringLiteral( "123 " ) << QStringLiteral( "a value" ) );
QCOMPARE( p.value( ctx ).type(), QVariant::StringList ); QCOMPARE( p.value( ctx ).type(), QVariant::StringList );
request.setUrl( QStringLiteral( "http://www.qgis.org/api/?parameter1=a%20value " ) ); request.setUrl( QStringLiteral( "http://www.qgis.org/api/?parameter1=a%20value " ) );
QCOMPARE( p.value( ctx ).toStringList(), QStringList() << QStringLiteral( "a v alue" ) ); QCOMPARE( p.value( ctx ).toStringList(), QStringList() << QStringLiteral( "a v alue" ) );
QCOMPARE( p.value( ctx ).type(), QVariant::StringList ); QCOMPARE( p.value( ctx ).type(), QVariant::StringList );
 End of changes. 1 change blocks. 
0 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)