Add clang-format (#1086)

Co-authored-by: mwilsnd <mwilsnd@gmail.com>
This commit is contained in:
Bart Louwers
2023-05-01 16:57:37 +02:00
committed by GitHub
parent 403a12bd1b
commit 71f6da2722
1018 changed files with 27876 additions and 25862 deletions

View File

@@ -28,22 +28,22 @@ Position createPosition(std::array<float, 3> pos) {
}
TEST(Position, Calculations) {
std::array<float, 3> spherical{{ 2, 10, 270 }};
std::array<float, 3> spherical{{2, 10, 270}};
Position position(spherical);
expectArrayNE(position.getCartesian(), spherical);
expectArrayEQ(position.getSpherical(), spherical);
expectArrayEQ(position.getCartesian(), {{ 0.34729638695716858, -1.9696154594421387, 2.384976127700611e-08 }});
expectArrayEQ(position.getCartesian(), {{0.34729638695716858, -1.9696154594421387, 2.384976127700611e-08}});
expectArrayNE(createPosition({{ 2, 30, 10 }}).getSpherical(), createPosition({{ 2, 30, 370 }}).getSpherical());
expectArrayEQ(createPosition({{ 2, 30, 10 }}).getCartesian(), createPosition({{ 2, 30, 370 }}).getCartesian());
expectArrayNE(createPosition({{2, 30, 10}}).getSpherical(), createPosition({{2, 30, 370}}).getSpherical());
expectArrayEQ(createPosition({{2, 30, 10}}).getCartesian(), createPosition({{2, 30, 370}}).getCartesian());
std::array<float, 3> newSpherical = {{ 1, 80, 270 }};
std::array<float, 3> newSpherical = {{1, 80, 270}};
position.set(newSpherical);
expectArrayNE(position.getSpherical(), spherical);
expectArrayNE(position.getCartesian(), {{ 0.34729638695716858, -1.9696154594421387, 2.384976127700611e-08 }});
expectArrayEQ(position.getCartesian(), {{ 0.98480772972106934, -0.17364829778671265, 1.1924880638503055e-08 }});
expectArrayNE(position.getCartesian(), {{0.34729638695716858, -1.9696154594421387, 2.384976127700611e-08}});
expectArrayEQ(position.getCartesian(), {{0.98480772972106934, -0.17364829778671265, 1.1924880638503055e-08}});
}