Skip to content

Commit

Permalink
Added missing EXPECTs in test.
Browse files Browse the repository at this point in the history
  • Loading branch information
odlomax committed Sep 16, 2024
1 parent 73d990f commit f4d3697
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/atlas/array/ArrayViewVariant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "atlas/array/ArrayViewVariant.h"

#include <string>
#include <type_traits>

#include "atlas/runtime/Exception.h"

Expand Down
9 changes: 6 additions & 3 deletions src/tests/array/test_array_view_variant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,15 @@ CASE("test std::visit") {

const auto visitor = [&](auto&& view) {
if constexpr (Rank<decltype(view)>() == 1) {
testRank1(view);
rank1Tested = true;
return testRank1(view);
}
if constexpr (Rank<decltype(view)>() == 2) {
testRank2(view);
rank2Tested = true;
return testRank2(view);
}
// Test should not reach here.
EXPECT(false);
};

std::visit(visitor, var1);
Expand All @@ -158,7 +160,8 @@ CASE("test std::visit") {
rank2Tested = true;
},
[](auto&& view) -> std::enable_if_t<(Rank<decltype(view)>() > 2)> {
// do nothing.
// Test should not reach here.
EXPECT(false);
}};

std::visit(visitor, var1);
Expand Down
1 change: 0 additions & 1 deletion src/tests/util/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,3 @@ ecbuild_add_test( TARGET atlas_test_unitsphere
ENVIRONMENT ${ATLAS_TEST_ENVIRONMENT}
)


0 comments on commit f4d3697

Please sign in to comment.