From 80d39bb73d8ae3b5c3b47772f6c6ba80cbfedc1d Mon Sep 17 00:00:00 2001 From: Weber Date: Mon, 13 Mar 2023 13:14:51 +0100 Subject: [PATCH] test-half-neighbors to gtest --- test/t8_forest/t8_gtest_half_neighbors.cxx | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/test/t8_forest/t8_gtest_half_neighbors.cxx b/test/t8_forest/t8_gtest_half_neighbors.cxx index c579eca24f..45959d080c 100644 --- a/test/t8_forest/t8_gtest_half_neighbors.cxx +++ b/test/t8_forest/t8_gtest_half_neighbors.cxx @@ -43,9 +43,7 @@ class forest_half_neighbors:public testing::TestWithParam t8_element_num_faces (element); face++) { /* Get the eclass of the face neighbor and get the scheme */ - t8_eclass_t neigh_class = + const t8_eclass_t neigh_class = t8_forest_element_neighbor_eclass (forest, itree, element, face); t8_eclass_scheme_c *neigh_scheme = t8_forest_get_eclass_scheme (forest, neigh_class); - int num_face_neighs = + const int num_face_neighs = ts->t8_element_num_face_children (element, face); t8_element_t **half_neighbors = T8_ALLOC (t8_element_t *, num_face_neighs); @@ -120,7 +118,7 @@ TEST_P (forest_half_neighbors, test_half_neighbors) num_face_neighs, NULL); /* allocate memory for element's neighbor and construct it */ neigh_scheme->t8_element_new (1, &neighbor); - t8_locidx_t neigh_tree = + const t8_locidx_t neigh_tree = t8_forest_element_face_neighbor (forest, itree, element, neighbor, neigh_scheme, face, &dual_face); if (neigh_tree > 0) { @@ -139,12 +137,11 @@ TEST_P (forest_half_neighbors, test_half_neighbors) child_ids); /* Check that the children at face of the neighbor are the half neighbors of the element */ for (int ineigh = 0; ineigh < num_face_neighs; ineigh++) { - SC_CHECK_ABORTF (!neigh_scheme->t8_element_compare - (neighbor_face_childs[ineigh], - half_neighbors[ineigh]), - "Half neighbor %i at face %i is not equal to child %i " - "of the neighbor element.\n", ineigh, face, - ineigh); + ASSERT_TRUE (!neigh_scheme->t8_element_compare + (neighbor_face_childs[ineigh], + half_neighbors[ineigh])) << "Half neighbor " << + ineigh << " at face " << face << "is not equal to child" << + ineigh << "of the neighbor element.\n"; } neigh_scheme->t8_element_destroy (num_face_neighs, neighbor_face_childs);