Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jul 7, 2017
1 parent d6cbf30 commit 515ba24
Showing 1 changed file with 27 additions and 27 deletions.
54 changes: 27 additions & 27 deletions tests/src/core/testqgsprocessing.cpp
Expand Up @@ -4854,14 +4854,14 @@ void TestQgsProcessing::modelExecution()
QCOMPARE( variables.value( "SOURCE_LAYER_miny" ).source.source(), QgsProcessingModelAlgorithm::ChildParameterSource::ModelParameter );
QCOMPARE( variables.value( "SOURCE_LAYER_maxx" ).source.source(), QgsProcessingModelAlgorithm::ChildParameterSource::ModelParameter );
QCOMPARE( variables.value( "SOURCE_LAYER_maxy" ).source.source(), QgsProcessingModelAlgorithm::ChildParameterSource::ModelParameter );
QCOMPARE( variables.value( "cx1_OUTPUT_LAYER_minx" ).source.source(), QgsProcessingModelAlgorithm::ChildParameterSource::ChildOutput );
QCOMPARE( variables.value( "cx1_OUTPUT_LAYER_minx" ).source.outputChildId(), QStringLiteral( "cx1" ) );
QCOMPARE( variables.value( "cx1_OUTPUT_LAYER_miny" ).source.source(), QgsProcessingModelAlgorithm::ChildParameterSource::ChildOutput );
QCOMPARE( variables.value( "cx1_OUTPUT_LAYER_miny" ).source.outputChildId(), QStringLiteral( "cx1" ) );
QCOMPARE( variables.value( "cx1_OUTPUT_LAYER_maxx" ).source.source(), QgsProcessingModelAlgorithm::ChildParameterSource::ChildOutput );
QCOMPARE( variables.value( "cx1_OUTPUT_LAYER_maxx" ).source.outputChildId(), QStringLiteral( "cx1" ) );
QCOMPARE( variables.value( "cx1_OUTPUT_LAYER_maxy" ).source.source(), QgsProcessingModelAlgorithm::ChildParameterSource::ChildOutput );
QCOMPARE( variables.value( "cx1_OUTPUT_LAYER_maxy" ).source.outputChildId(), QStringLiteral( "cx1" ) );
QCOMPARE( variables.value( "cx1_OUTPUT_minx" ).source.source(), QgsProcessingModelAlgorithm::ChildParameterSource::ChildOutput );
QCOMPARE( variables.value( "cx1_OUTPUT_minx" ).source.outputChildId(), QStringLiteral( "cx1" ) );
QCOMPARE( variables.value( "cx1_OUTPUT_miny" ).source.source(), QgsProcessingModelAlgorithm::ChildParameterSource::ChildOutput );
QCOMPARE( variables.value( "cx1_OUTPUT_miny" ).source.outputChildId(), QStringLiteral( "cx1" ) );
QCOMPARE( variables.value( "cx1_OUTPUT_maxx" ).source.source(), QgsProcessingModelAlgorithm::ChildParameterSource::ChildOutput );
QCOMPARE( variables.value( "cx1_OUTPUT_maxx" ).source.outputChildId(), QStringLiteral( "cx1" ) );
QCOMPARE( variables.value( "cx1_OUTPUT_maxy" ).source.source(), QgsProcessingModelAlgorithm::ChildParameterSource::ChildOutput );
QCOMPARE( variables.value( "cx1_OUTPUT_maxy" ).source.outputChildId(), QStringLiteral( "cx1" ) );

// with values
variables = model2.variablesForChildAlgorithm( "cx2", context, modelInputs, childResults );
Expand Down Expand Up @@ -4903,22 +4903,22 @@ void TestQgsProcessing::modelExecution()
QCOMPARE( variables.value( "SOURCE_LAYER_miny" ).source.source(), QgsProcessingModelAlgorithm::ChildParameterSource::ModelParameter );
QCOMPARE( variables.value( "SOURCE_LAYER_maxx" ).source.source(), QgsProcessingModelAlgorithm::ChildParameterSource::ModelParameter );
QCOMPARE( variables.value( "SOURCE_LAYER_maxy" ).source.source(), QgsProcessingModelAlgorithm::ChildParameterSource::ModelParameter );
QCOMPARE( variables.value( "cx1_OUTPUT_LAYER_minx" ).source.source(), QgsProcessingModelAlgorithm::ChildParameterSource::ChildOutput );
QCOMPARE( variables.value( "cx1_OUTPUT_LAYER_minx" ).source.outputChildId(), QStringLiteral( "cx1" ) );
QCOMPARE( variables.value( "cx1_OUTPUT_LAYER_miny" ).source.source(), QgsProcessingModelAlgorithm::ChildParameterSource::ChildOutput );
QCOMPARE( variables.value( "cx1_OUTPUT_LAYER_miny" ).source.outputChildId(), QStringLiteral( "cx1" ) );
QCOMPARE( variables.value( "cx1_OUTPUT_LAYER_maxx" ).source.source(), QgsProcessingModelAlgorithm::ChildParameterSource::ChildOutput );
QCOMPARE( variables.value( "cx1_OUTPUT_LAYER_maxx" ).source.outputChildId(), QStringLiteral( "cx1" ) );
QCOMPARE( variables.value( "cx1_OUTPUT_LAYER_maxy" ).source.source(), QgsProcessingModelAlgorithm::ChildParameterSource::ChildOutput );
QCOMPARE( variables.value( "cx1_OUTPUT_LAYER_maxy" ).source.outputChildId(), QStringLiteral( "cx1" ) );
QCOMPARE( variables.value( "cx2_OUTPUT_LAYER_minx" ).source.source(), QgsProcessingModelAlgorithm::ChildParameterSource::ChildOutput );
QCOMPARE( variables.value( "cx2_OUTPUT_LAYER_minx" ).source.outputChildId(), QStringLiteral( "cx2" ) );
QCOMPARE( variables.value( "cx2_OUTPUT_LAYER_miny" ).source.source(), QgsProcessingModelAlgorithm::ChildParameterSource::ChildOutput );
QCOMPARE( variables.value( "cx2_OUTPUT_LAYER_miny" ).source.outputChildId(), QStringLiteral( "cx2" ) );
QCOMPARE( variables.value( "cx2_OUTPUT_LAYER_maxx" ).source.source(), QgsProcessingModelAlgorithm::ChildParameterSource::ChildOutput );
QCOMPARE( variables.value( "cx2_OUTPUT_LAYER_maxx" ).source.outputChildId(), QStringLiteral( "cx2" ) );
QCOMPARE( variables.value( "cx2_OUTPUT_LAYER_maxy" ).source.source(), QgsProcessingModelAlgorithm::ChildParameterSource::ChildOutput );
QCOMPARE( variables.value( "cx2_OUTPUT_LAYER_maxy" ).source.outputChildId(), QStringLiteral( "cx2" ) );
QCOMPARE( variables.value( "cx1_OUTPUT_minx" ).source.source(), QgsProcessingModelAlgorithm::ChildParameterSource::ChildOutput );
QCOMPARE( variables.value( "cx1_OUTPUT_minx" ).source.outputChildId(), QStringLiteral( "cx1" ) );
QCOMPARE( variables.value( "cx1_OUTPUT_miny" ).source.source(), QgsProcessingModelAlgorithm::ChildParameterSource::ChildOutput );
QCOMPARE( variables.value( "cx1_OUTPUT_miny" ).source.outputChildId(), QStringLiteral( "cx1" ) );
QCOMPARE( variables.value( "cx1_OUTPUT_maxx" ).source.source(), QgsProcessingModelAlgorithm::ChildParameterSource::ChildOutput );
QCOMPARE( variables.value( "cx1_OUTPUT_maxx" ).source.outputChildId(), QStringLiteral( "cx1" ) );
QCOMPARE( variables.value( "cx1_OUTPUT_maxy" ).source.source(), QgsProcessingModelAlgorithm::ChildParameterSource::ChildOutput );
QCOMPARE( variables.value( "cx1_OUTPUT_maxy" ).source.outputChildId(), QStringLiteral( "cx1" ) );
QCOMPARE( variables.value( "cx2_OUTPUT_minx" ).source.source(), QgsProcessingModelAlgorithm::ChildParameterSource::ChildOutput );
QCOMPARE( variables.value( "cx2_OUTPUT_minx" ).source.outputChildId(), QStringLiteral( "cx2" ) );
QCOMPARE( variables.value( "cx2_OUTPUT_miny" ).source.source(), QgsProcessingModelAlgorithm::ChildParameterSource::ChildOutput );
QCOMPARE( variables.value( "cx2_OUTPUT_miny" ).source.outputChildId(), QStringLiteral( "cx2" ) );
QCOMPARE( variables.value( "cx2_OUTPUT_maxx" ).source.source(), QgsProcessingModelAlgorithm::ChildParameterSource::ChildOutput );
QCOMPARE( variables.value( "cx2_OUTPUT_maxx" ).source.outputChildId(), QStringLiteral( "cx2" ) );
QCOMPARE( variables.value( "cx2_OUTPUT_maxy" ).source.source(), QgsProcessingModelAlgorithm::ChildParameterSource::ChildOutput );
QCOMPARE( variables.value( "cx2_OUTPUT_maxy" ).source.outputChildId(), QStringLiteral( "cx2" ) );
// with values
variables = model2.variablesForChildAlgorithm( "cx3", context, modelInputs, childResults );
QCOMPARE( variables.count(), 13 );
Expand Down Expand Up @@ -4997,7 +4997,7 @@ void TestQgsProcessing::modelAcceptableValues()
QCOMPARE( sources.count(), 1 );
res.clear();
res << sources.at( 0 ).outputChildId() + ':' + sources.at( 0 ).outputName();
QCOMPARE( res, QSet< QString >() << "cx1:OUTPUT_LAYER" );
QCOMPARE( res, QSet< QString >() << "cx1:OUTPUT" );

// with dependencies between child algs
QgsProcessingModelAlgorithm::ChildAlgorithm alg2c2;
Expand All @@ -5010,7 +5010,7 @@ void TestQgsProcessing::modelAcceptableValues()
res.clear();
res << sources.at( 0 ).outputChildId() + ':' + sources.at( 0 ).outputName();
res << sources.at( 1 ).outputChildId() + ':' + sources.at( 1 ).outputName();
QCOMPARE( res, QSet< QString >() << "cx1:OUTPUT_LAYER" << "cx2:OUTPUT_LAYER" );
QCOMPARE( res, QSet< QString >() << "cx1:OUTPUT" << "cx2:OUTPUT" );

sources = m.availableSourcesForChild( QStringLiteral( "cx1" ), QStringList(), QStringList() << "string" << "outputVector" );
QCOMPARE( sources.count(), 0 );
Expand All @@ -5019,7 +5019,7 @@ void TestQgsProcessing::modelAcceptableValues()
QCOMPARE( sources.count(), 1 );
res.clear();
res << sources.at( 0 ).outputChildId() + ':' + sources.at( 0 ).outputName();
QCOMPARE( res, QSet< QString >() << "cx1:OUTPUT_LAYER" );
QCOMPARE( res, QSet< QString >() << "cx1:OUTPUT" );
}

void TestQgsProcessing::tempUtils()
Expand Down

0 comments on commit 515ba24

Please sign in to comment.