@@ -5095,6 +5095,34 @@ void TestQgsProcessing::modelerAlgorithm()
5095
5095
QVERIFY ( alg3.dependsOnChildAlgorithms ( " c9" ).contains ( " c7" ) );
5096
5096
QVERIFY ( alg3.dependsOnChildAlgorithms ( " c9" ).contains ( " c8" ) );
5097
5097
5098
+ QgsProcessingModelChildAlgorithm c9b;
5099
+ c9b.setChildId ( " c9b" );
5100
+ c9b.addParameterSources ( " x" , QgsProcessingModelChildParameterSources () << QgsProcessingModelChildParameterSource::fromChildOutput ( " c9" , " x" ) );
5101
+ alg3.addChildAlgorithm ( c9b );
5102
+
5103
+ QCOMPARE ( alg3.dependentChildAlgorithms ( " c9" ).count (), 1 );
5104
+ QCOMPARE ( alg3.dependentChildAlgorithms ( " c8" ).count (), 2 );
5105
+ QVERIFY ( alg3.dependentChildAlgorithms ( " c8" ).contains ( " c9" ) );
5106
+ QVERIFY ( alg3.dependentChildAlgorithms ( " c8" ).contains ( " c9b" ) );
5107
+ QCOMPARE ( alg3.dependentChildAlgorithms ( " c7" ).count (), 3 );
5108
+ QVERIFY ( alg3.dependentChildAlgorithms ( " c7" ).contains ( " c8" ) );
5109
+ QVERIFY ( alg3.dependentChildAlgorithms ( " c7" ).contains ( " c9" ) );
5110
+ QVERIFY ( alg3.dependentChildAlgorithms ( " c7" ).contains ( " c9b" ) );
5111
+
5112
+ QVERIFY ( alg3.dependsOnChildAlgorithms ( " c7" ).isEmpty () );
5113
+ QCOMPARE ( alg3.dependsOnChildAlgorithms ( " c8" ).count (), 1 );
5114
+ QVERIFY ( alg3.dependsOnChildAlgorithms ( " c8" ).contains ( " c7" ) );
5115
+ QCOMPARE ( alg3.dependsOnChildAlgorithms ( " c9" ).count (), 2 );
5116
+ QVERIFY ( alg3.dependsOnChildAlgorithms ( " c9" ).contains ( " c7" ) );
5117
+ QVERIFY ( alg3.dependsOnChildAlgorithms ( " c9" ).contains ( " c8" ) );
5118
+ QCOMPARE ( alg3.dependsOnChildAlgorithms ( " c9b" ).count (), 3 );
5119
+ QVERIFY ( alg3.dependsOnChildAlgorithms ( " c9b" ).contains ( " c7" ) );
5120
+ QVERIFY ( alg3.dependsOnChildAlgorithms ( " c9b" ).contains ( " c8" ) );
5121
+ QVERIFY ( alg3.dependsOnChildAlgorithms ( " c9b" ).contains ( " c9" ) );
5122
+
5123
+ alg3.removeChildAlgorithm ( " c9b" );
5124
+
5125
+
5098
5126
// (de)activate child algorithm
5099
5127
alg3.deactivateChildAlgorithm ( " c9" );
5100
5128
QVERIFY ( !alg3.childAlgorithm ( " c9" ).isActive () );
0 commit comments