Skip to content

Commit

Permalink
Fix clang tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
guilara committed Nov 13, 2023
1 parent 3c7c989 commit 046741a
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions tests/Unit/Domain/Creators/Test_Sphere.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ void test_sphere_construction(
// SphericalCompression map since the shape map is the identity
// currently
const double min_radius = inner_radius;
const double max_radius = radial_partitioning.size() > 0
const double max_radius = not radial_partitioning.empty()
? radial_partitioning[0]
: outer_radius;
const double func =
Expand Down Expand Up @@ -632,7 +632,7 @@ void test_sphere() {
const size_t l_max = 10;
const std::vector<double> times{1., 10.};

for (auto [interior_index, equiangular, equatorial_compression, array_index,
for (auto [interior_index, equiangular, equatorial_compression, index,
which_wedges, time_dependent, use_hard_coded_time_dep_options,
with_boundary_conditions] :
random_sample<5>(
Expand Down Expand Up @@ -666,13 +666,10 @@ void test_sphere() {

// If we are using hard coded maps, we need at least two shells (or one
// radial partition) for the translation map.
if (use_hard_coded_time_dep_options and
radial_partitioning[array_index].empty()) {
// If there is no radial partition, go to the next index to get one
// partition
++array_index;
}

const auto array_index =
(use_hard_coded_time_dep_options and radial_partitioning[index].empty()

Check failure on line 670 in tests/Unit/Domain/Creators/Test_Sphere.cpp

View workflow job for this annotation

GitHub Actions / Clang-tidy (Debug)

do not use array subscript when the index is not an integer constant expression
? index + 1
: index);
CAPTURE(radial_partitioning[array_index]);

Check failure on line 673 in tests/Unit/Domain/Creators/Test_Sphere.cpp

View workflow job for this annotation

GitHub Actions / Clang-tidy (Debug)

do not use array subscript when the index is not an integer constant expression
CAPTURE(radial_distribution[array_index]);

Check failure on line 674 in tests/Unit/Domain/Creators/Test_Sphere.cpp

View workflow job for this annotation

GitHub Actions / Clang-tidy (Debug)

do not use array subscript when the index is not an integer constant expression

Expand Down

0 comments on commit 046741a

Please sign in to comment.