| 216 | } |
| 217 | |
| 218 | Result validateFunctionExecOutputs(const GraphFunction& func) { |
| 219 | // make sure all exec outputs exist, and raise an error otherwise. |
| 220 | // TODO (#70): quickfix to add return |
| 221 | |
| 222 | Result res; |
| 223 | |
| 224 | // make sure they all get the context |
| 225 | auto funcCtx = |
| 226 | res.addScopedContext({{"function", func.name()}, {"module", func.module().fullName()}}); |
| 227 | |
| 228 | for (const auto& nodepair : func.nodes()) { |
| 229 | auto node = nodepair.second.get(); |
| 230 | |
| 231 | auto id = 0ull; |
| 232 | for (const auto& conn : node->outputExecConnections) { |
| 233 | if (conn.second == ~0ull || conn.first == nullptr) { |
| 234 | res.addEntry("EUKN", "Node is missing an output exec connection", |
| 235 | {{"Node ID", node->stringId()}, {"Missing ID", id}}); |
| 236 | } |
| 237 | |
| 238 | ++id; |
| 239 | } |
| 240 | } |
| 241 | |
| 242 | return res; |
| 243 | } |
| 244 | |
| 245 | } // namespace chi |
no test coverage detected