| 148 | } |
| 149 | |
| 150 | void CompareSubgraphViews(SubgraphView::SubgraphViewPtr& result, |
| 151 | SubgraphView::SubgraphViewPtr& expected) |
| 152 | { |
| 153 | // expect both to be valid subgraphs |
| 154 | CHECK((result.get() != nullptr)); |
| 155 | CHECK((expected.get() != nullptr)); |
| 156 | |
| 157 | if (result.get() != nullptr && expected.get() != nullptr) |
| 158 | { |
| 159 | CHECK(result->GetIInputSlots().size() == expected->GetIInputSlots().size()); |
| 160 | CHECK(result->GetIOutputSlots().size() == expected->GetIOutputSlots().size()); |
| 161 | CHECK(result->GetIConnectableLayers().size() == expected->GetIConnectableLayers().size()); |
| 162 | |
| 163 | auto resultLayers = ToSortedArray<IConnectableLayer*>(result->GetIConnectableLayers().begin(), |
| 164 | result->GetIConnectableLayers().end()); |
| 165 | auto expectedLayers = ToSortedArray<IConnectableLayer*>(expected->GetIConnectableLayers().begin(), |
| 166 | expected->GetIConnectableLayers().end()); |
| 167 | CompareVectors(resultLayers, expectedLayers); |
| 168 | |
| 169 | auto resultInputs = ToSortedArray<IInputSlot *>(result->GetIInputSlots().begin(), |
| 170 | result->GetIInputSlots().end()); |
| 171 | auto expectedInputs = ToSortedArray<IInputSlot *>(expected->GetIInputSlots().begin(), |
| 172 | expected->GetIInputSlots().end()); |
| 173 | CompareVectors(resultInputs, expectedInputs); |
| 174 | |
| 175 | auto resultOutputs = ToSortedArray<IOutputSlot *>(result->GetIOutputSlots().begin(), |
| 176 | result->GetIOutputSlots().end()); |
| 177 | auto expectedOutputs = ToSortedArray<IOutputSlot *>(expected->GetIOutputSlots().begin(), |
| 178 | expected->GetIOutputSlots().end()); |
| 179 | CompareVectors(resultOutputs, expectedOutputs); |
| 180 | } |
| 181 | } |
| 182 | |
| 183 | } // namespace <anonymous> |
| 184 |
no test coverage detected