From d6c52909e415f93109fbfbf93fb0961b5aacc391 Mon Sep 17 00:00:00 2001 From: Kai Bao Date: Wed, 19 Dec 2018 20:14:09 +0100 Subject: [PATCH] addressing review comments from PR #352 --- tests/test_compressed_cartesian_mapping.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/test_compressed_cartesian_mapping.cpp b/tests/test_compressed_cartesian_mapping.cpp index 66961a33c..da003c440 100644 --- a/tests/test_compressed_cartesian_mapping.cpp +++ b/tests/test_compressed_cartesian_mapping.cpp @@ -43,11 +43,13 @@ BOOST_AUTO_TEST_CASE(mapping) BOOST_CHECK_EQUAL(cartesian_to_compressed.at(8), 6); BOOST_CHECK_EQUAL(cartesian_to_compressed.at(9), 7); + const int non_existing_index = 1829; + BOOST_CHECK_THROW(cartesian_to_compressed.at(non_existing_index), std::out_of_range); + const std::vector compressed_to_cartesian = Opm::compressedToCartesian(num_cells, global_cell.data()); - for (int i = 0; i < num_cells; ++i) { - BOOST_CHECK_EQUAL(compressed_to_cartesian[i], global_cell[i]); - } + BOOST_CHECK_EQUAL_COLLECTIONS(compressed_to_cartesian.begin(), compressed_to_cartesian.end(), + global_cell.begin(), global_cell.end()); } BOOST_AUTO_TEST_CASE(nullmapping)