Skip to content

Commit 0db4cf3

Browse files
committed
Add another test
1 parent 1d69939 commit 0db4cf3

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

‎tests/src/core/testqgsprocessing.cpp‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3920,6 +3920,19 @@ void TestQgsProcessing::modelExecution()
39203920
QCOMPARE( params.value( "INPUT" ).toString(), QStringLiteral( "dest.shp" ) );
39213921
QCOMPARE( params.value( "OUTPUT_LAYER" ).toString(), QStringLiteral( "memory:" ) );
39223922
QCOMPARE( params.count(), 2 );
3923+
3924+
// a child with an optional output
3925+
QgsProcessingModelAlgorithm::ChildAlgorithm alg2c3;
3926+
alg2c3.setChildId( "cx3" );
3927+
alg2c3.setAlgorithmId( "native:extractbyexpression" );
3928+
alg2c3.addParameterSource( "INPUT", QgsProcessingModelAlgorithm::ChildParameterSource::fromChildOutput( "cx1", "OUTPUT_LAYER" ) );
3929+
alg2c3.addParameterSource( "EXPRESSION", QgsProcessingModelAlgorithm::ChildParameterSource::fromStaticValue( "true" ) );
3930+
model2.addChildAlgorithm( alg2c3 );
3931+
params = model2.parametersForChildAlgorithm( model2.childAlgorithm( "cx3" ), modelInputs, childResults );
3932+
QCOMPARE( params.value( "INPUT" ).toString(), QStringLiteral( "dest.shp" ) );
3933+
QCOMPARE( params.value( "EXPRESSION" ).toString(), QStringLiteral( "true" ) );
3934+
QCOMPARE( params.value( "OUTPUT" ).toString(), QStringLiteral( "memory:" ) );
3935+
QCOMPARE( params.count(), 3 ); // don't want FAIL_OUTPUT set!
39233936
}
39243937

39253938
void TestQgsProcessing::tempUtils()

0 commit comments

Comments
 (0)