| 226 | } |
| 227 | |
| 228 | TEST(DeadnessAnalysisTest, BasicPositive) { |
| 229 | Scope root = Scope::NewRootScope().ExitOnError(); |
| 230 | |
| 231 | ops::Switch sw = CreateSwitch(root, "0"); |
| 232 | Output add = |
| 233 | ops::Add(root.WithOpName("add"), sw.output_true, sw.output_false); |
| 234 | |
| 235 | std::unique_ptr<DeadnessAnalysis> result; |
| 236 | TF_ASSERT_OK(AnalyzeDeadness(root.graph(), &result)); |
| 237 | |
| 238 | TF_ASSERT_OK_AND_ASSIGN( |
| 239 | bool has_inputs_with_mismatching_deadness, |
| 240 | HasInputsWithMismatchingDeadness(*result, *add.node())); |
| 241 | EXPECT_TRUE(has_inputs_with_mismatching_deadness); |
| 242 | } |
| 243 | |
| 244 | TEST(DeadnessAnalysisTest, BasicNegative) { |
| 245 | Scope root = Scope::NewRootScope().ExitOnError(); |
nothing calls this directly
no test coverage detected