Replace EXPECT/ASSERT_DEATH with EXPECT_DEATH_IF_SUPPORTED. This allows us to remove all the WIN32/MSVC ifdefs in the various tests. http://code.google.com/p/ceres-solver/issues/detail?id=55 Change-Id: Ida053e44ea84b6915758318403f3db05325f1226
diff --git a/internal/ceres/graph_test.cc b/internal/ceres/graph_test.cc index d4ee22d..85b80bf 100644 --- a/internal/ceres/graph_test.cc +++ b/internal/ceres/graph_test.cc
@@ -83,22 +83,16 @@ EXPECT_EQ(graph.EdgeWeight(1, 0), 0.5); } -// Death tests don't work on Windows. -// TODO(keir): Figure out why this test doesn't work on Windows. -#ifndef _WIN32 - TEST(Graph, DieOnNonExistentVertex) { Graph<int> graph; graph.AddVertex(0, 1.0); graph.AddVertex(1, 2.0); graph.AddEdge(0, 1, 0.5); - EXPECT_DEATH(graph.VertexWeight(2), "key not found"); - EXPECT_DEATH(graph.Neighbors(2), "key not found"); + EXPECT_DEATH_IF_SUPPORTED(graph.VertexWeight(2), "key not found"); + EXPECT_DEATH_IF_SUPPORTED(graph.Neighbors(2), "key not found"); } -#endif // _WIN32 - TEST(Graph, NonExistentEdge) { Graph<int> graph; graph.AddVertex(0, 1.0);