MCPcopy Create free account
hub / github.com/NatronGitHub/Natron / connectNodes

Method connectNodes

Tests/BaseTest.cpp:142–168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140}
141
142void
143BaseTest::connectNodes(NodePtr input,
144 NodePtr output,
145 int inputNumber,
146 bool expectedReturnValue)
147{
148 if (expectedReturnValue) {
149 ///check that the connections are internally all set as "expected"
150
151 EXPECT_EQ( (Node*)NULL, output->getInput(inputNumber).get() );
152 EXPECT_FALSE( output->isInputConnected(inputNumber) );
153 } else {
154 ///the call can only fail for those 2 reasons
155 EXPECT_TRUE(inputNumber > output->getNInputs() || //< inputNumber is greater than the maximum input number
156 output->getInput(inputNumber).get() != (Node*)NULL); //< input slot is already filled with another node
157 }
158
159
160 bool ret = getApp()->getProject()->connectNodes(inputNumber, input, output);
161 EXPECT_EQ(expectedReturnValue, ret);
162
163 if (expectedReturnValue) {
164 EXPECT_TRUE( input->hasOutputConnected() );
165 EXPECT_EQ(output->getInput(inputNumber), input);
166 EXPECT_TRUE( output->isInputConnected(inputNumber) );
167 }
168}
169
170void
171BaseTest::disconnectNodes(NodePtr input,

Callers 2

mousePressEventMethod · 0.45

Calls 7

getAppFunction · 0.85
isInputConnectedMethod · 0.80
getProjectMethod · 0.80
getMethod · 0.45
getInputMethod · 0.45
getNInputsMethod · 0.45
hasOutputConnectedMethod · 0.45

Tested by

no test coverage detected