Skip to content

Commit

Permalink
other tests
Browse files Browse the repository at this point in the history
  • Loading branch information
varunagrawal committed Jan 8, 2025
1 parent 72da68e commit c00f663
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
12 changes: 9 additions & 3 deletions gtsam/linear/tests/testGaussianBayesNet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,15 @@ TEST(GaussianBayesNet, sample) {
std::mt19937_64 rng(4242);
auto actual3 = gbn.sample(&rng);
EXPECT_LONGS_EQUAL(2, actual.size());
// regression is not repeatable across platforms/versions :-(
// EXPECT(assert_equal(Vector2(20.0129382, 40.0039798), actual[X(1)], 1e-5));
// EXPECT(assert_equal(Vector2(110.032083, 230.039811), actual[X(0)], 1e-5));

// regressions
#ifdef __APPLE__
EXPECT(assert_equal(Vector2(20.0129382, 40.0039798), actual[X(1)], 1e-5));
EXPECT(assert_equal(Vector2(110.032083, 230.039811), actual[X(0)], 1e-5));
#elif __linux__
EXPECT(assert_equal(Vector2(20.0129382, 40.0039798), actual[X(1)], 1e-5));
EXPECT(assert_equal(Vector2(110.032083, 230.039811), actual[X(0)], 1e-5));
#endif
}

/* ************************************************************************* */
Expand Down
8 changes: 6 additions & 2 deletions gtsam/linear/tests/testGaussianConditional.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -464,8 +464,12 @@ TEST(GaussianConditional, sample) {
std::mt19937_64 rng(4242);
auto actual3 = conditional.sample(given, &rng);
EXPECT_LONGS_EQUAL(1, actual2.size());
// regression is not repeatable across platforms/versions :-(
// EXPECT(assert_equal(Vector2(31.0111856, 64.9850775), actual2[X(0)], 1e-5));
// regressions
#ifdef __APPLE__
EXPECT(assert_equal(Vector2(31.0111856, 64.9850775), actual2[X(0)], 1e-5));
#elif __linux__
EXPECT(assert_equal(Vector2(31.0111856, 64.9850775), actual2[X(0)], 1e-5));
#endif
}

/* ************************************************************************* */
Expand Down

0 comments on commit c00f663

Please sign in to comment.