| 223 | } |
| 224 | |
| 225 | void DescribeTo(::std::ostream* os) const override { |
| 226 | std::vector<string> predicates; |
| 227 | |
| 228 | if (name) { |
| 229 | predicates.push_back(absl::StrCat("name: ", *name)); |
| 230 | } |
| 231 | |
| 232 | if (op) { |
| 233 | predicates.push_back(absl::StrCat("op: ", *op)); |
| 234 | } |
| 235 | |
| 236 | if (assigned_device) { |
| 237 | predicates.push_back(absl::StrCat("assigned device: ", *assigned_device)); |
| 238 | } |
| 239 | |
| 240 | bool printed_something = !predicates.empty(); |
| 241 | |
| 242 | *os << absl::StrJoin(predicates, ", "); |
| 243 | |
| 244 | if (constant_value) { |
| 245 | printed_something = true; |
| 246 | *os << "constant value: " << constant_value->DebugString(); |
| 247 | } |
| 248 | |
| 249 | if (input_matchers) { |
| 250 | if (!input_matchers->empty()) { |
| 251 | printed_something = true; |
| 252 | *os << " with " << (input_matchers->size() == 1 ? "only " : "") |
| 253 | << "input" << (input_matchers->size() == 1 ? "" : "s") << " "; |
| 254 | } |
| 255 | |
| 256 | if (input_matchers->size() == 1) { |
| 257 | ::std::stringstream ss; |
| 258 | input_matchers->front().DescribeTo(&ss); |
| 259 | printed_something = true; |
| 260 | *os << "matching " << ss.str(); |
| 261 | } else { |
| 262 | int edge_idx = 0; |
| 263 | for (const ::testing::Matcher<OutEdge>& matcher : (*input_matchers)) { |
| 264 | *os << "\n [" << edge_idx << "] matching ("; |
| 265 | ::std::stringstream ss; |
| 266 | matcher.DescribeTo(&ss); |
| 267 | printed_something = true; |
| 268 | *os << IndentAllButFirstLine(ss.str()); |
| 269 | *os << ")"; |
| 270 | edge_idx++; |
| 271 | } |
| 272 | } |
| 273 | } |
| 274 | |
| 275 | if (control_dep_set) { |
| 276 | printed_something = true; |
| 277 | *os << " and control deps "; |
| 278 | control_dep_set->DescribeTo(os); |
| 279 | } |
| 280 | |
| 281 | if (!attrs.empty()) { |
| 282 | printed_something = true; |
no test coverage detected