@@ -5840,7 +5840,8 @@ void TestQgsProcessing::modelerAlgorithm()
5840
5840
alg5c1.addParameterSources ( " zm" , QgsProcessingModelChildParameterSources () << QgsProcessingModelChildParameterSource::fromStaticValue ( 6 )
5841
5841
<< QgsProcessingModelChildParameterSource::fromModelParameter ( " p2" )
5842
5842
<< QgsProcessingModelChildParameterSource::fromChildOutput ( " cx2" , " out4" )
5843
- << QgsProcessingModelChildParameterSource::fromExpression ( " 1+2" ) );
5843
+ << QgsProcessingModelChildParameterSource::fromExpression ( " 1+2" )
5844
+ << QgsProcessingModelChildParameterSource::fromStaticValue ( QgsProperty::fromExpression ( " 1+8" ) ) );
5844
5845
alg5c1.setActive ( true );
5845
5846
alg5c1.setOutputsCollapsed ( true );
5846
5847
alg5c1.setParametersCollapsed ( true );
@@ -5896,7 +5897,7 @@ void TestQgsProcessing::modelerAlgorithm()
5896
5897
QCOMPARE ( alg6c1.parameterSources ().value ( " z" ).at ( 0 ).staticValue ().toInt (), 5 );
5897
5898
QCOMPARE ( alg6c1.parameterSources ().value ( " a" ).at ( 0 ).source (), QgsProcessingModelChildParameterSource::Expression );
5898
5899
QCOMPARE ( alg6c1.parameterSources ().value ( " a" ).at ( 0 ).expression (), QStringLiteral ( " 2*2" ) );
5899
- QCOMPARE ( alg6c1.parameterSources ().value ( " zm" ).count (), 4 );
5900
+ QCOMPARE ( alg6c1.parameterSources ().value ( " zm" ).count (), 5 );
5900
5901
QCOMPARE ( alg6c1.parameterSources ().value ( " zm" ).at ( 0 ).source (), QgsProcessingModelChildParameterSource::StaticValue );
5901
5902
QCOMPARE ( alg6c1.parameterSources ().value ( " zm" ).at ( 0 ).staticValue ().toInt (), 6 );
5902
5903
QCOMPARE ( alg6c1.parameterSources ().value ( " zm" ).at ( 1 ).source (), QgsProcessingModelChildParameterSource::ModelParameter );
@@ -5906,6 +5907,9 @@ void TestQgsProcessing::modelerAlgorithm()
5906
5907
QCOMPARE ( alg6c1.parameterSources ().value ( " zm" ).at ( 2 ).outputName (), QStringLiteral ( " out4" ) );
5907
5908
QCOMPARE ( alg6c1.parameterSources ().value ( " zm" ).at ( 3 ).source (), QgsProcessingModelChildParameterSource::Expression );
5908
5909
QCOMPARE ( alg6c1.parameterSources ().value ( " zm" ).at ( 3 ).expression (), QStringLiteral ( " 1+2" ) );
5910
+ QCOMPARE ( alg6c1.parameterSources ().value ( " zm" ).at ( 4 ).source (), QgsProcessingModelChildParameterSource::StaticValue );
5911
+ QVERIFY ( alg6c1.parameterSources ().value ( " zm" ).at ( 4 ).staticValue ().canConvert < QgsProperty >() );
5912
+ QCOMPARE ( alg6c1.parameterSources ().value ( " zm" ).at ( 4 ).staticValue ().value < QgsProperty >().expressionString (), QStringLiteral ( " 1+8" ) );
5909
5913
5910
5914
QCOMPARE ( alg6c1.modelOutputs ().count (), 1 );
5911
5915
QCOMPARE ( alg6c1.modelOutputs ().value ( QStringLiteral ( " a" ) ).description (), QStringLiteral ( " my output" ) );
0 commit comments