Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 32da6c36cc38
Choose a base ref
...
head repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 78b85ce208db
Choose a head ref
  • 7 commits
  • 7 files changed
  • 1 contributor

Commits on Jan 18, 2020

  1. Copy the full SHA
    8a2ada5 View commit details
  2. Fix two tests.

    pleroy committed Jan 18, 2020
    Copy the full SHA
    4d30241 View commit details
  3. Fix the Euler solver test.

    pleroy committed Jan 18, 2020
    Copy the full SHA
    a0f9234 View commit details
  4. Copy the full SHA
    f59e646 View commit details
  5. Back to Lt.

    pleroy committed Jan 18, 2020
    Copy the full SHA
    6b92be6 View commit details
  6. Back to Lt instead of IsNear.

    pleroy committed Jan 18, 2020
    Copy the full SHA
    25d3ad4 View commit details
  7. Merge pull request #2453 from pleroy/1624

    Fix some (all?) of the test failures on macOS
    pleroy authored Jan 18, 2020
    Copy the full SHA
    78b85ce View commit details
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -81,6 +81,7 @@ SHARED_ARGS := \
-Wall -Wpedantic \
-Wno-char-subscripts \
-Wno-gnu-anonymous-struct \
-Wno-gnu-zero-variadic-macro-arguments \
-Wno-nested-anon-types \
-Wno-unknown-pragmas \
-DPROJECT_DIR='std::filesystem::path("$(PROJECT_DIR)")' \
6 changes: 3 additions & 3 deletions astronomy/orbital_elements_test.cpp
Original file line number Diff line number Diff line change
@@ -176,7 +176,7 @@ TEST_F(OrbitalElementsTest, KeplerOrbit) {
AbsoluteErrorFrom(*initial_osculating.period, Lt(510 * Micro(Second))));
EXPECT_THAT(
elements.nodal_period(),
AbsoluteErrorFrom(*initial_osculating.period, Lt(3.9 * Milli(Second))));
AbsoluteErrorFrom(*initial_osculating.period, Lt(4.1 * Milli(Second))));
EXPECT_THAT(
elements.sidereal_period(),
AbsoluteErrorFrom(*initial_osculating.period, Lt(1.9 * Micro(Second))));
@@ -195,7 +195,7 @@ TEST_F(OrbitalElementsTest, KeplerOrbit) {
Lt(0.64 * Micro(ArcSecond))));
EXPECT_THAT(elements.mean_longitude_of_ascending_node_interval().midpoint(),
AbsoluteErrorFrom(initial_osculating.longitude_of_ascending_node,
Lt(62 * ArcSecond)));
Lt(64 * ArcSecond)));
EXPECT_THAT(elements.mean_argument_of_periapsis_interval().midpoint(),
AbsoluteErrorFrom(*initial_osculating.argument_of_periapsis,
Lt(62 * ArcSecond)));
@@ -208,7 +208,7 @@ TEST_F(OrbitalElementsTest, KeplerOrbit) {
EXPECT_THAT(elements.mean_inclination_interval().measure(),
Lt(1.4 * Micro(ArcSecond)));
EXPECT_THAT(elements.mean_longitude_of_ascending_node_interval().measure(),
Lt(2.2 * ArcMinute));
Lt(2.3 * ArcMinute));
EXPECT_THAT(elements.mean_argument_of_periapsis_interval().measure(),
Lt(2.2 * ArcMinute));

32 changes: 31 additions & 1 deletion integrators/symmetric_linear_multistep_integrator_test.cpp
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@
#include <string>

#include "base/file.hpp"
#include "base/macros.hpp"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "mathematica/mathematica.hpp"
@@ -120,7 +121,35 @@ std::vector<SimpleHarmonicMotionTestInstance> Instances() {
// The |beginning_of_convergence| below were carefully chosen using
// Mathematica to only select the domain where |p| and |step| are properly
// correlated.
return {INSTANCE(Quinlan1999Order8A,
return {
#if OS_MACOSX
INSTANCE(Quinlan1999Order8A,
0.07 * Second,
1.00044972306534419e-13 * Metre,
1.00586206031039183e-13 * Metre / Second,
3.93946996135596805e-08 * Joule),
INSTANCE(Quinlan1999Order8B,
0.055 * Second,
9.97882332320898513e-14 * Metre,
1.00960906301850173e-13 * Metre / Second,
2.19802622769549316e-08 * Joule),
INSTANCE(QuinlanTremaine1990Order8,
0.3 * Second,
9.98298665955132947e-14 * Metre,
1.00759678378636863e-13 * Metre / Second,
6.42628611435824837e-08 * Joule),
INSTANCE(QuinlanTremaine1990Order10,
0.3 * Second,
9.96980276113390573e-14 * Metre,
1.02445829597286320e-13 * Metre / Second,
1.03418451580239434e-09 * Joule),
INSTANCE(QuinlanTremaine1990Order12,
0.21 * Second,
9.90457715843717779e-14 * Metre,
1.05138120432002324e-13 * Metre / Second,
4.14703826834283973e-11 * Joule)};
#else
INSTANCE(Quinlan1999Order8A,
0.07 * Second,
1.00044972306534419e-13 * Metre,
1.00587940754515159e-13 * Metre / Second,
@@ -145,6 +174,7 @@ std::vector<SimpleHarmonicMotionTestInstance> Instances() {
9.90457715843717779e-14 * Metre,
1.05165876007617953e-13 * Metre / Second,
4.14703826834283973e-11 * Joule)};
#endif
}

} // namespace
194 changes: 193 additions & 1 deletion integrators/symplectic_runge_kutta_nyström_integrator_test.cpp
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@
#include <vector>
#include <string>

#include "base/macros.hpp"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "integrators/methods.hpp"
@@ -143,7 +144,197 @@ std::ostream& operator<<(std::ostream& stream,
}

std::vector<SimpleHarmonicMotionTestInstance> Instances() {
return {INSTANCE(McLachlanAtela1992Order4Optimal,
return {
#if OS_MACOSX
INSTANCE(McLachlanAtela1992Order4Optimal,
1.0 * Second,
+1.88161985992252310e-13 * Metre,
+1.88489848729211928e-13 * Metre / Second,
+7.52285331973023830e-07 * Joule),
INSTANCE(McLachlan1995SB3A4,
1.0 * Second,
+1.21597176772070270e-13 * Metre,
+1.21781057460523812e-13 * Metre / Second,
+2.52639347009253610e-06 * Joule),
INSTANCE(McLachlan1995SB3A5,
1.0 * Second,
+1.37754391227318250e-13 * Metre,
+1.37841127401117092e-13 * Metre / Second,
+1.70551544109720510e-07 * Joule),
INSTANCE(BlanesMoan2002SRKN6B,
1.0 * Second,
+1.18405285576272950e-13 * Metre,
+1.18563145412586834e-13 * Metre / Second,
+1.55706381121945010e-09 * Joule),
INSTANCE(McLachlanAtela1992Order5Optimal,
1.1 * Second,
+7.51005160837259210e-14 * Metre,
+7.50823014872281650e-14 * Metre / Second,
+3.06327349042234690e-08 * Joule),
INSTANCE(OkunborSkeel1994Order6Method13,
1.1 * Second,
+1.54723456269323380e-13 * Metre,
+1.54957643938580247e-13 * Metre / Second,
+2.28626773068896230e-09 * Joule),
INSTANCE(BlanesMoan2002SRKN11B,
1.0 * Second,
+1.11972930927350940e-13 * Metre,
+1.12028442078582202e-13 * Metre / Second,
+9.14945896823837760e-12 * Joule),
INSTANCE(BlanesMoan2002SRKN14A,
1.0 * Second,
+1.11001485780803930e-13 * Metre,
+1.11056996932035190e-13 * Metre / Second,
+6.29052365752613700e-13 * Joule),
// We test |NewtonDelambreStørmerVerletLeapfrog| both as |ABA| and
// |BAB| (sometimes called leapfrog and pseudo-leapfrog) for coverage.
// We test the others as BAB integrators only.
SPRK_INSTANCE(NewtonDelambreStørmerVerletLeapfrog,
ABA,
0.4 * Second,
+4.15606749774469295e-05 * Metre,
+4.16264386218978197e-05 * Metre / Second,
+5.05049535215751355e-03 * Joule),
SPRK_INSTANCE(NewtonDelambreStørmerVerletLeapfrog,
BAB,
0.4 * Second,
+4.15606749774714325e-05 * Metre,
+4.16261832565066603e-05 * Metre / Second,
+4.99999039863668893e-03 * Joule),
SPRK_INSTANCE(Ruth1983,
BA,
0.1 * Second,
+2.77767866216707682e-11 * Metre,
+7.01563807048444232e-13 * Metre / Second,
+1.15535032619074052e-04 * Joule),
SPRK_INSTANCE(鈴木1990,
BAB,
1 * Second,
+1.17211795824800902e-12 * Metre,
+1.17471310456807032e-12 * Metre / Second,
+5.75983521433620638e-06 * Joule),
SPRK_INSTANCE(吉田1990Order6A,
BAB,
1.5 * Second,
+8.30793767114812454e-14 * Metre,
+8.30672336471494077e-14 * Metre / Second,
1.28253665132582739e-07 * Joule),
SPRK_INSTANCE(吉田1990Order6B,
BAB,
1 * Second,
+3.32525673663042198e-13 * Metre,
+3.32803229419198487e-13 * Metre / Second,
+3.39431978840787352e-06 * Joule),
SPRK_INSTANCE(吉田1990Order6C,
BAB,
1 * Second,
+9.58053081312471022e-14 * Metre,
+9.58608192824783600e-14 * Metre / Second,
+3.58056353333413568e-06 * Joule),
SPRK_INSTANCE(吉田1990Order8A,
BAB,
0.043 * Second,
+6.06330957664269476e-13 * Metre,
+6.06917294199149637e-13 * Metre / Second,
+1.49030436397135091e-05 * Joule),
SPRK_INSTANCE(吉田1990Order8B,
BAB,
0.5 * Second,
+4.91648388667442759e-13 * Metre,
+4.92127172346812358e-13 * Metre / Second,
+1.33083068010186878e-07 * Joule),
SPRK_INSTANCE(吉田1990Order8C,
BAB,
0.9 * Second,
+3.13037790133918747e-13 * Metre,
+3.13284120867507454e-13 * Metre / Second,
+4.68151000188044009e-08 * Joule),
SPRK_INSTANCE(吉田1990Order8D,
BAB,
1.1 * Second,
+2.20309881449054501e-13 * Metre,
+2.20483353796652182e-13 * Metre / Second,
+1.58094315416690279e-10 * Joule),
SPRK_INSTANCE(吉田1990Order8E,
BAB,
0.3 * Second,
+1.39072781069060625e-13 * Metre,
+1.39152578348955558e-13 * Metre / Second,
+3.42872182312881080e-08 * Joule),
SPRK_INSTANCE(CandyRozmus1991ForestRuth1990,
BAB,
0.5 * Second,
+6.63488881891272086e-11 * Metre,
+6.64553828633174248e-11 * Metre / Second,
+6.26859072366814374e-05 * Joule),
SPRK_INSTANCE(McLachlanAtela1992Order2Optimal,
BA,
0.7 * Second,
+2.01685999379921758e-05 * Metre,
+2.02003819904818379e-05 * Metre / Second,
+8.63068191495619530e-05 * Joule),
SPRK_INSTANCE(McLachlanAtela1992Order3Optimal,
BA,
0.09 * Second,
+1.21425465168800706e-11 * Metre,
+3.68975683340266869e-13 * Metre / Second,
+4.72513762963533424e-05 * Joule),
SPRK_INSTANCE(McLachlan1995S2,
BAB,
0.1 * Second,
+1.20001294944783662e-05 * Metre,
+1.20190260074261876e-05 * Metre / Second,
+4.47986262497312993e-05 * Joule),
SPRK_INSTANCE(McLachlan1995SS5,
BAB,
0.1 * Second,
+1.99751326590558165e-12 * Metre,
+2.00208252754130456e-12 * Metre / Second,
+3.99026027320115162e-06 * Joule),
SPRK_INSTANCE(McLachlan1995S4,
BAB,
0.1 * Second,
+2.20774787340616285e-13 * Metre,
+2.21159895952283136e-13 * Metre / Second,
+2.11567735630691089e-06 * Joule),
SPRK_INSTANCE(McLachlan1995S5,
BAB,
1 * Second,
+7.15764253422790375e-14 * Metre,
+7.15608128309952463e-14 * Metre / Second,
+7.82877597083064813e-07 * Joule),
SPRK_INSTANCE(McLachlan1995SS9,
BAB,
1 * Second,
+1.23734356094473696e-13 * Metre,
+1.23810683927416676e-13 * Metre / Second,
+1.29530730030857910e-08 * Joule),
SPRK_INSTANCE(McLachlan1995SS15,
BAB,
1 * Second,
+9.67281810204667636e-14 * Metre,
+9.67767532777941142e-14 * Metre / Second,
+1.21325172131037107e-11 * Joule),
SPRK_INSTANCE(McLachlan1995SS17,
BAB,
1 * Second,
+8.34124436188687923e-14 * Metre,
+8.34454033649123517e-14 * Metre / Second,
+2.24043006369356590e-12 * Joule),
SPRK_INSTANCE(BlanesMoan2002S6,
BAB,
1 * Second,
+1.23803745033512769e-13 * Metre,
+1.23965074316778612e-13 * Metre / Second,
+2.24300146345335349e-07 * Joule),
SPRK_INSTANCE(BlanesMoan2002S10,
BAB,
1 * Second,
+7.67649832589256675e-14 * Metre,
+7.67354929598340618e-14 * Metre / Second,
+2.45151621225403460e-10 * Joule)};
#else
INSTANCE(McLachlanAtela1992Order4Optimal,
1.0 * Second,
+1.88161985992252310e-13 * Metre,
+1.88491583452687910e-13 * Metre / Second,
@@ -330,6 +521,7 @@ std::vector<SimpleHarmonicMotionTestInstance> Instances() {
+7.67632485354496907e-14 * Metre,
+7.67372276833100386e-14 * Metre / Second,
+2.45151621225403460e-10 * Joule)};
#endif
}

} // namespace
17 changes: 10 additions & 7 deletions numerics/cbrt_test.cpp
Original file line number Diff line number Diff line change
@@ -20,13 +20,16 @@ using ::testing::Gt;
using ::testing::Lt;
using ::testing::Truly;

#define EXPECT_SIGNALS(expression, exceptions) \
do { \
std::feclearexcept(FE_ALL_EXCEPT); \
[[maybe_unused]] auto const volatile evaluated_signaling_expression = \
(expression); \
EXPECT_THAT(std::fetestexcept(FE_ALL_EXCEPT), Eq((exceptions))) \
<< "while evaluating " #expression; \
#define EXPECT_SIGNALS(expression, exceptions) \
do { \
std::feclearexcept(FE_ALL_EXCEPT); \
[[maybe_unused]] auto const volatile evaluated_signaling_expression = \
(expression); \
/* Ignore implementation-defined exceptions. */ \
EXPECT_THAT(std::fetestexcept(FE_DIVBYZERO | FE_INEXACT | FE_INVALID | \
FE_OVERFLOW | FE_UNDERFLOW), \
Eq((exceptions))) \
<< "while evaluating " #expression; \
} while (false)

class CubeRootTest : public ::testing::Test {
Loading