From e3a0eac260719c0e3f80ccac18c65277b3775f27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Mon, 1 Dec 2014 14:18:51 +0100 Subject: [PATCH] Uncomment second test. Test fails, it requires exact match which is too strict. --- tests/test_anisotropiceikonal.cpp | 52 +++++++++++++++---------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/tests/test_anisotropiceikonal.cpp b/tests/test_anisotropiceikonal.cpp index 5a3629f7d..fe3160b75 100644 --- a/tests/test_anisotropiceikonal.cpp +++ b/tests/test_anisotropiceikonal.cpp @@ -41,10 +41,10 @@ BOOST_AUTO_TEST_CASE(cartesian_2d_a) AnisotropicEikonal2d ae(grid); const std::vector metric = { - 1, 0, 0, 1, - 1, 0, 0, 1, - 1, 0, 0, 1, - 1, 0, 0, 1 + 1, 0, 0, 1, + 1, 0, 0, 1, + 1, 0, 0, 1, + 1, 0, 0, 1 }; BOOST_REQUIRE_EQUAL(metric.size(), grid.number_of_cells*grid.dimensions*grid.dimensions); const std::vector start = { 0 }; @@ -57,26 +57,26 @@ BOOST_AUTO_TEST_CASE(cartesian_2d_a) } -// BOOST_AUTO_TEST_CASE(cartesian_2d_b) -// { -// const GridManager gm(3, 2, 1.0, 2.0); -// const UnstructuredGrid& grid = *gm.c_grid(); -// AnisotropicEikonal2d ae(grid); +BOOST_AUTO_TEST_CASE(cartesian_2d_b) +{ + const GridManager gm(3, 2, 1.0, 2.0); + const UnstructuredGrid& grid = *gm.c_grid(); + AnisotropicEikonal2d ae(grid); -// const std::vector metric = { -// 1, 0, 0, 1, -// 1, 0, 0, 1, -// 1, 0, 0, 1, -// 1, 0, 0, 1, -// 1, 0, 0, 1, -// 1, 0, 0, 1 -// }; -// BOOST_REQUIRE_EQUAL(metric.size(), grid.number_of_cells*grid.dimensions*grid.dimensions); -// const std::vector start = { 0 }; -// std::vector sol; -// ae.solve(metric.data(), start, sol); -// BOOST_REQUIRE(!sol.empty()); -// BOOST_CHECK_EQUAL(sol.size(), grid.number_of_cells); -// std::vector truth = { 0, 1, 2, 2, std::sqrt(5), std::sqrt(8) }; -// BOOST_CHECK_EQUAL_COLLECTIONS(sol.begin(), sol.end(), truth.begin(), truth.end()); -// } + const std::vector metric = { + 1, 0, 0, 1, + 1, 0, 0, 1, + 1, 0, 0, 1, + 1, 0, 0, 1, + 1, 0, 0, 1, + 1, 0, 0, 1 + }; + BOOST_REQUIRE_EQUAL(metric.size(), grid.number_of_cells*grid.dimensions*grid.dimensions); + const std::vector start = { 0 }; + std::vector sol; + ae.solve(metric.data(), start, sol); + BOOST_REQUIRE(!sol.empty()); + BOOST_CHECK_EQUAL(sol.size(), grid.number_of_cells); + std::vector truth = { 0, 1, 2, 2, std::sqrt(5), std::sqrt(8) }; + BOOST_CHECK_EQUAL_COLLECTIONS(sol.begin(), sol.end(), truth.begin(), truth.end()); +}