(self, cond_net, cond_value, expect, cond_on_blob)
| 178 | self.IfCondTest(self.false_cond_net_, 0, True) |
| 179 | |
| 180 | def IfElseCondTest(self, cond_net, cond_value, expect, cond_on_blob): |
| 181 | if cond_value: |
| 182 | run_net = self.cnt_net_ |
| 183 | else: |
| 184 | run_net = self.cnt_2_net_ |
| 185 | if cond_on_blob: |
| 186 | step = control.Do( |
| 187 | 'if-else-all', |
| 188 | control.Do('count', cond_net), |
| 189 | control.If('myIfElse', cond_net.Proto().external_output[-1], |
| 190 | self.cnt_net_, self.cnt_2_net_)) |
| 191 | else: |
| 192 | step = control.If('myIfElse', cond_net, |
| 193 | self.cnt_net_, self.cnt_2_net_) |
| 194 | self.BuildAndRunPlan(step) |
| 195 | self.CheckNetOutput([(run_net, expect)]) |
| 196 | |
| 197 | def testIfElseCondTrueOnNet(self): |
| 198 | self.IfElseCondTest(self.true_cond_net_, True, 1, False) |
no test coverage detected