Skip to content

Commit

Permalink
fixing wrong compiler brackets in test_helix.cc
Browse files Browse the repository at this point in the history
  • Loading branch information
shutsch committed Feb 22, 2024
1 parent e81648b commit 27ac693
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions c_library/test/regular/test_helix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ TEST_CASE("HelixMagneticField") {
updated_irregular_grid[1] = new double[size_pos];
updated_irregular_grid[2] = new double[size_pos];

#if autodiff_FOUND
for (int i=0; i < size_pos; i++) {
vector def_mod_at_grid_point = model(grid_x[0], grid_y[0], helix.ampx, helix.ampy, helix.ampz, helix.rmin, helix.rmax);
default_irregular_grid[0][i] = def_mod_at_grid_point[0].val();
Expand All @@ -112,6 +113,18 @@ TEST_CASE("HelixMagneticField") {
updated_irregular_grid[1][i] = up_mod_at_grid_point[1].val();
updated_irregular_grid[2][i] = up_mod_at_grid_point[2].val();
}
#else
for (int i=0; i < size_pos; i++) {
vector def_mod_at_grid_point = model(grid_x[0], grid_y[0], helix.ampx, helix.ampy, helix.ampz, helix.rmin, helix.rmax);
default_irregular_grid[0][i] = def_mod_at_grid_point[0];
default_irregular_grid[1][i] = def_mod_at_grid_point[1];
default_irregular_grid[2][i] = def_mod_at_grid_point[2];
vector up_mod_at_grid_point = model(grid_x[0], grid_y[0], ampx, ampy, ampz, rmin, rmax);
updated_irregular_grid[0][i] = up_mod_at_grid_point[0];
updated_irregular_grid[1][i] = up_mod_at_grid_point[1];
updated_irregular_grid[2][i] = up_mod_at_grid_point[2];
}
#endif

// test at_position -- default parameters
REQUIRE_THAT(helix.at_position(origin[0], origin[1], origin[2]), EqualsVector(zeros));
Expand Down

0 comments on commit 27ac693

Please sign in to comment.