(self, cond_net, cond_value, expect, cond_on_blob)
| 231 | self.IfNotCondTest(self.false_cond_net_, 1, True) |
| 232 | |
| 233 | def IfNotElseCondTest(self, cond_net, cond_value, expect, cond_on_blob): |
| 234 | if cond_value: |
| 235 | run_net = self.cnt_2_net_ |
| 236 | else: |
| 237 | run_net = self.cnt_net_ |
| 238 | if cond_on_blob: |
| 239 | step = control.Do( |
| 240 | 'if-not-else', |
| 241 | control.Do('count', cond_net), |
| 242 | control.IfNot('myIfNotElse', |
| 243 | cond_net.Proto().external_output[-1], |
| 244 | self.cnt_net_, self.cnt_2_net_)) |
| 245 | else: |
| 246 | step = control.IfNot('myIfNotElse', cond_net, |
| 247 | self.cnt_net_, self.cnt_2_net_) |
| 248 | self.BuildAndRunPlan(step) |
| 249 | self.CheckNetOutput([(run_net, expect)]) |
| 250 | |
| 251 | def testIfNotElseCondTrueOnNet(self): |
| 252 | self.IfNotElseCondTest(self.true_cond_net_, True, 2, False) |
no test coverage detected