From a198e30488d93b94ba0f43d3ec898feea06027da Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Tue, 16 Jun 2020 10:18:53 +1000 Subject: [PATCH] Update test --- tests/src/analysis/testqgsprocessing.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/src/analysis/testqgsprocessing.cpp b/tests/src/analysis/testqgsprocessing.cpp index 99e45110da9d..d5057ab2c7c5 100644 --- a/tests/src/analysis/testqgsprocessing.cpp +++ b/tests/src/analysis/testqgsprocessing.cpp @@ -9432,8 +9432,9 @@ void TestQgsProcessing::modelExecution() // Check variables for child algorithm // without values QMap variables = model2.variablesForChildAlgorithm( "cx1", context ); - QCOMPARE( variables.count(), 6 ); + QCOMPARE( variables.count(), 7 ); QCOMPARE( variables.value( "DIST" ).source.source(), QgsProcessingModelChildParameterSource::ModelParameter ); + QCOMPARE( variables.value( "CRS" ).source.source(), QgsProcessingModelChildParameterSource::ModelParameter ); QCOMPARE( variables.value( "SOURCE_LAYER" ).source.source(), QgsProcessingModelChildParameterSource::ModelParameter ); QCOMPARE( variables.value( "SOURCE_LAYER_minx" ).source.source(), QgsProcessingModelChildParameterSource::ModelParameter ); QCOMPARE( variables.value( "SOURCE_LAYER_miny" ).source.source(), QgsProcessingModelChildParameterSource::ModelParameter ); @@ -9442,7 +9443,7 @@ void TestQgsProcessing::modelExecution() // with values variables = model2.variablesForChildAlgorithm( "cx1", context, modelInputs, childResults ); - QCOMPARE( variables.count(), 6 ); + QCOMPARE( variables.count(), 7 ); QCOMPARE( variables.value( "DIST" ).value.toInt(), 271 ); QCOMPARE( variables.value( "SOURCE_LAYER" ).source.parameterName(), QString( "SOURCE_LAYER" ) ); QGSCOMPARENEAR( variables.value( "SOURCE_LAYER_minx" ).value.toDouble(), -118.8888, 0.001 ); @@ -9452,7 +9453,7 @@ void TestQgsProcessing::modelExecution() std::unique_ptr< QgsExpressionContextScope > childScope( model2.createExpressionContextScopeForChildAlgorithm( "cx1", context, modelInputs, childResults ) ); QCOMPARE( childScope->name(), QStringLiteral( "algorithm_inputs" ) ); - QCOMPARE( childScope->variableCount(), 6 ); + QCOMPARE( childScope->variableCount(), 7 ); QCOMPARE( childScope->variable( "DIST" ).toInt(), 271 ); QCOMPARE( variables.value( "SOURCE_LAYER" ).source.parameterName(), QString( "SOURCE_LAYER" ) ); QGSCOMPARENEAR( childScope->variable( "SOURCE_LAYER_minx" ).toDouble(), -118.8888, 0.001 ); @@ -9477,7 +9478,7 @@ void TestQgsProcessing::modelExecution() QCOMPARE( params.count(), 2 ); variables = model2.variablesForChildAlgorithm( "cx2", context ); - QCOMPARE( variables.count(), 11 ); + QCOMPARE( variables.count(), 12 ); QCOMPARE( variables.value( "DIST" ).source.source(), QgsProcessingModelChildParameterSource::ModelParameter ); QCOMPARE( variables.value( "SOURCE_LAYER" ).source.source(), QgsProcessingModelChildParameterSource::ModelParameter ); QCOMPARE( variables.value( "SOURCE_LAYER_minx" ).source.source(), QgsProcessingModelChildParameterSource::ModelParameter ); @@ -9497,7 +9498,7 @@ void TestQgsProcessing::modelExecution() // with values variables = model2.variablesForChildAlgorithm( "cx2", context, modelInputs, childResults ); - QCOMPARE( variables.count(), 11 ); + QCOMPARE( variables.count(), 12 ); QCOMPARE( variables.value( "DIST" ).value.toInt(), 271 ); QCOMPARE( variables.value( "SOURCE_LAYER" ).source.parameterName(), QString( "SOURCE_LAYER" ) ); QCOMPARE( variables.value( "cx1_OUTPUT" ).source.outputChildId(), QString( "cx1" ) ); @@ -9549,7 +9550,7 @@ void TestQgsProcessing::modelExecution() variables = model2.variablesForChildAlgorithm( "cx3", context ); - QCOMPARE( variables.count(), 16 ); + QCOMPARE( variables.count(), 17 ); QCOMPARE( variables.value( "DIST" ).source.source(), QgsProcessingModelChildParameterSource::ModelParameter ); QCOMPARE( variables.value( "SOURCE_LAYER" ).source.source(), QgsProcessingModelChildParameterSource::ModelParameter ); QCOMPARE( variables.value( "SOURCE_LAYER_minx" ).source.source(), QgsProcessingModelChildParameterSource::ModelParameter ); @@ -9578,7 +9579,7 @@ void TestQgsProcessing::modelExecution() QCOMPARE( variables.value( "cx2_OUTPUT_maxy" ).source.outputChildId(), QStringLiteral( "cx2" ) ); // with values variables = model2.variablesForChildAlgorithm( "cx3", context, modelInputs, childResults ); - QCOMPARE( variables.count(), 16 ); + QCOMPARE( variables.count(), 17 ); QCOMPARE( variables.value( "DIST" ).value.toInt(), 271 ); QCOMPARE( variables.value( "SOURCE_LAYER" ).source.parameterName(), QString( "SOURCE_LAYER" ) ); QCOMPARE( variables.value( "cx1_OUTPUT" ).source.outputChildId(), QString( "cx1" ) );