Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
More travis build fixes
  • Loading branch information
nyalldawson committed Sep 21, 2018
1 parent 85a9e17 commit ced9559
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions tests/src/gui/testprocessinggui.cpp
Expand Up @@ -925,7 +925,7 @@ void TestProcessingGui::testNumericWrapperDouble()
QCOMPARE( static_cast< QgsDoubleSpinBox * >( wrapperMin.wrappedWidget() )->minimum(), -5.0 );
QCOMPARE( static_cast< QgsDoubleSpinBox * >( wrapperMin.wrappedWidget() )->maximum(), 999999999.0 );
QCOMPARE( static_cast< QgsDoubleSpinBox * >( wrapperMin.wrappedWidget() )->clearValue(), -5.0 );
QCOMPARE( wrapperMin.parameterValue(), 0.0 );
QCOMPARE( wrapperMin.parameterValue().toDouble(), 0.0 );
delete w;

// with max value
Expand All @@ -939,7 +939,7 @@ void TestProcessingGui::testNumericWrapperDouble()
QCOMPARE( static_cast< QgsDoubleSpinBox * >( wrapperMax.wrappedWidget() )->minimum(), -999999999.0 );
QCOMPARE( static_cast< QgsDoubleSpinBox * >( wrapperMax.wrappedWidget() )->maximum(), 5.0 );
QCOMPARE( static_cast< QgsDoubleSpinBox * >( wrapperMax.wrappedWidget() )->clearValue(), 0.0 );
QCOMPARE( wrapperMax.parameterValue(), 0.0 );
QCOMPARE( wrapperMax.parameterValue().toDouble(), 0.0 );
delete w;

// with min and max value
Expand All @@ -954,7 +954,7 @@ void TestProcessingGui::testNumericWrapperDouble()
QCOMPARE( static_cast< QgsDoubleSpinBox * >( wrapperMinMax.wrappedWidget() )->minimum(), -.1 );
QCOMPARE( static_cast< QgsDoubleSpinBox * >( wrapperMinMax.wrappedWidget() )->maximum(), .1 );
QCOMPARE( static_cast< QgsDoubleSpinBox * >( wrapperMinMax.wrappedWidget() )->clearValue(), -.1 );
QCOMPARE( wrapperMinMax.parameterValue(), 0.0 );
QCOMPARE( wrapperMinMax.parameterValue().toDouble(), 0.0 );
delete w;

// with default value
Expand All @@ -965,7 +965,7 @@ void TestProcessingGui::testNumericWrapperDouble()

w = wrapperDefault.createWrappedWidget( context );
QCOMPARE( static_cast< QgsDoubleSpinBox * >( wrapperDefault.wrappedWidget() )->clearValue(), 55.0 );
QCOMPARE( wrapperDefault.parameterValue(), 55.0 );
QCOMPARE( wrapperDefault.parameterValue().toDouble(), 55.0 );
delete w;

// optional, no default
Expand All @@ -977,7 +977,7 @@ void TestProcessingGui::testNumericWrapperDouble()
QCOMPARE( static_cast< QgsDoubleSpinBox * >( wrapperOptional.wrappedWidget() )->clearValue(), -1000000000.0 );
QVERIFY( !wrapperOptional.parameterValue().isValid() );
wrapperOptional.setParameterValue( 5, context );
QCOMPARE( wrapperOptional.parameterValue(), 5.0 );
QCOMPARE( wrapperOptional.parameterValue().toDouble(), 5.0 );
wrapperOptional.setParameterValue( QVariant(), context );
QVERIFY( !wrapperOptional.parameterValue().isValid() );
wrapperOptional.setParameterValue( 5, context );
Expand All @@ -990,18 +990,18 @@ void TestProcessingGui::testNumericWrapperDouble()

w = wrapperOptionalDefault.createWrappedWidget( context );
QCOMPARE( static_cast< QgsDoubleSpinBox * >( wrapperOptionalDefault.wrappedWidget() )->clearValue(), -1000000000.0 );
QCOMPARE( wrapperOptionalDefault.parameterValue(), 3.0 );
QCOMPARE( wrapperOptionalDefault.parameterValue().toDouble(), 3.0 );
wrapperOptionalDefault.setParameterValue( 5, context );
QCOMPARE( wrapperOptionalDefault.parameterValue(), 5.0 );
QCOMPARE( wrapperOptionalDefault.parameterValue().toDouble(), 5.0 );
wrapperOptionalDefault.setParameterValue( QVariant(), context );
QCOMPARE( static_cast< QgsDoubleSpinBox * >( wrapperOptionalDefault.wrappedWidget() )->value(), -1000000000.0 );
QVERIFY( !wrapperOptionalDefault.parameterValue().isValid() );
wrapperOptionalDefault.setParameterValue( 5, context );
QCOMPARE( wrapperOptionalDefault.parameterValue(), 5.0 );
QCOMPARE( wrapperOptionalDefault.parameterValue().toDouble(), 5.0 );
static_cast< QgsDoubleSpinBox * >( wrapperOptionalDefault.wrappedWidget() )->clear();
QVERIFY( !wrapperOptionalDefault.parameterValue().isValid() );
wrapperOptionalDefault.setParameterValue( 5, context );
QCOMPARE( wrapperOptionalDefault.parameterValue(), 5.0 );
QCOMPARE( wrapperOptionalDefault.parameterValue().toDouble(), 5.0 );

delete w;
};
Expand Down Expand Up @@ -1078,7 +1078,7 @@ void TestProcessingGui::testNumericWrapperInt()
QCOMPARE( static_cast< QgsSpinBox * >( wrapperMin.wrappedWidget() )->minimum(), -5 );
QCOMPARE( static_cast< QgsSpinBox * >( wrapperMin.wrappedWidget() )->maximum(), 999999999 );
QCOMPARE( static_cast< QgsSpinBox * >( wrapperMin.wrappedWidget() )->clearValue(), -5 );
QCOMPARE( wrapperMin.parameterValue(), 0 );
QCOMPARE( wrapperMin.parameterValue().toInt(), 0 );
delete w;

// with max value
Expand All @@ -1091,7 +1091,7 @@ void TestProcessingGui::testNumericWrapperInt()
QCOMPARE( static_cast< QgsSpinBox * >( wrapperMax.wrappedWidget() )->minimum(), -999999999 );
QCOMPARE( static_cast< QgsSpinBox * >( wrapperMax.wrappedWidget() )->maximum(), 5 );
QCOMPARE( static_cast< QgsSpinBox * >( wrapperMax.wrappedWidget() )->clearValue(), 0 );
QCOMPARE( wrapperMax.parameterValue(), 0 );
QCOMPARE( wrapperMax.parameterValue().toInt(), 0 );
delete w;

// with min and max value
Expand All @@ -1105,7 +1105,7 @@ void TestProcessingGui::testNumericWrapperInt()
QCOMPARE( static_cast< QgsSpinBox * >( wrapperMinMax.wrappedWidget() )->minimum(), -1 );
QCOMPARE( static_cast< QgsSpinBox * >( wrapperMinMax.wrappedWidget() )->maximum(), 1 );
QCOMPARE( static_cast< QgsSpinBox * >( wrapperMinMax.wrappedWidget() )->clearValue(), -1 );
QCOMPARE( wrapperMinMax.parameterValue(), 0 );
QCOMPARE( wrapperMinMax.parameterValue().toInt(), 0 );
delete w;

// with default value
Expand All @@ -1116,7 +1116,7 @@ void TestProcessingGui::testNumericWrapperInt()

w = wrapperDefault.createWrappedWidget( context );
QCOMPARE( static_cast< QgsSpinBox * >( wrapperDefault.wrappedWidget() )->clearValue(), 55 );
QCOMPARE( wrapperDefault.parameterValue(), 55 );
QCOMPARE( wrapperDefault.parameterValue().toInt(), 55 );
delete w;

// optional, no default
Expand All @@ -1128,7 +1128,7 @@ void TestProcessingGui::testNumericWrapperInt()
QCOMPARE( static_cast< QgsSpinBox * >( wrapperOptional.wrappedWidget() )->clearValue(), -1000000000 );
QVERIFY( !wrapperOptional.parameterValue().isValid() );
wrapperOptional.setParameterValue( 5, context );
QCOMPARE( wrapperOptional.parameterValue(), 5 );
QCOMPARE( wrapperOptional.parameterValue().toInt(), 5 );
wrapperOptional.setParameterValue( QVariant(), context );
QVERIFY( !wrapperOptional.parameterValue().isValid() );
wrapperOptional.setParameterValue( 5, context );
Expand All @@ -1141,18 +1141,18 @@ void TestProcessingGui::testNumericWrapperInt()

w = wrapperOptionalDefault.createWrappedWidget( context );
QCOMPARE( static_cast< QgsSpinBox * >( wrapperOptionalDefault.wrappedWidget() )->clearValue(), -1000000000 );
QCOMPARE( wrapperOptionalDefault.parameterValue(), 3 );
QCOMPARE( wrapperOptionalDefault.parameterValue().toInt(), 3 );
wrapperOptionalDefault.setParameterValue( 5, context );
QCOMPARE( wrapperOptionalDefault.parameterValue(), 5 );
QCOMPARE( wrapperOptionalDefault.parameterValue().toInt(), 5 );
wrapperOptionalDefault.setParameterValue( QVariant(), context );
QCOMPARE( static_cast< QgsSpinBox * >( wrapperOptionalDefault.wrappedWidget() )->value(), -1000000000 );
QVERIFY( !wrapperOptionalDefault.parameterValue().isValid() );
wrapperOptionalDefault.setParameterValue( 5, context );
QCOMPARE( wrapperOptionalDefault.parameterValue(), 5 );
QCOMPARE( wrapperOptionalDefault.parameterValue().toInt(), 5 );
static_cast< QgsSpinBox * >( wrapperOptionalDefault.wrappedWidget() )->clear();
QVERIFY( !wrapperOptionalDefault.parameterValue().isValid() );
wrapperOptionalDefault.setParameterValue( 5, context );
QCOMPARE( wrapperOptionalDefault.parameterValue(), 5 );
QCOMPARE( wrapperOptionalDefault.parameterValue().toInt(), 5 );

delete w;
};
Expand Down Expand Up @@ -1273,7 +1273,7 @@ void TestProcessingGui::testDistanceWrapper()
QCOMPARE( wrapper.parameterValue().toDouble(), 2000.0 );

wrapper.setUnitParameterValue( id );
QCOMPARE( wrapper.parameterValue().toDouble(), 2 );
QCOMPARE( wrapper.parameterValue().toDouble(), 2.0 );
wrapper.setParameterValue( 5, context );
QCOMPARE( wrapper.parameterValue().toDouble(), 5.0 );

Expand Down Expand Up @@ -1307,13 +1307,13 @@ void TestProcessingGui::testDistanceWrapper()
w = wrapperM.createWrappedWidget( context );
QSignalSpy spy3( &wrapperM, &QgsProcessingDistanceWidgetWrapper::widgetValueHasChanged );
wrapperM.setWidgetValue( 29, context );
QCOMPARE( wrapperM.widgetValue().toDouble(), 29 );
QCOMPARE( wrapperM.widgetValue().toDouble(), 29.0 );
QCOMPARE( spy3.count(), 1 );
QCOMPARE( wrapperM.mDoubleSpinBox->value(), 29 );
QCOMPARE( wrapperM.mDoubleSpinBox->value(), 29.0 );
wrapperM.setWidgetValue( -29, context );
QCOMPARE( wrapperM.widgetValue().toDouble(), -29 );
QCOMPARE( wrapperM.widgetValue().toDouble(), -29.0 );
QCOMPARE( spy3.count(), 2 );
QCOMPARE( wrapperM.mDoubleSpinBox->value(), -29 );
QCOMPARE( wrapperM.mDoubleSpinBox->value(), -29.0 );

// check signal
wrapperM.mDoubleSpinBox->setValue( 33 );
Expand Down

0 comments on commit ced9559

Please sign in to comment.