Skip to content

Commit

Permalink
add direct random for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
yxlao committed Jun 24, 2022
1 parent c0dd3dd commit f94dcd1
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions cpp/tests/utility/Random.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,23 @@ TEST(Random, DeviceIndependentRandomValue) {
EXPECT_EQ(vals_with_seed, expected_vals);
}

TEST(Random, DirectRandom) {
// On M1 macOS:
// [Open3D INFO] [0] 2357136044
// [Open3D INFO] [1] 2546248239
// [Open3D INFO] [2] 3071714933
// [Open3D INFO] [3] 3626093760
// [Open3D INFO] [4] 2588848963
// [Open3D INFO] [5] 3684848379
// [Open3D INFO] [6] 2340255427
// [Open3D INFO] [7] 3638918503
// [Open3D INFO] [8] 1819583497
// [Open3D INFO] [9] 2678185683
std::mt19937 rng(0);
for (int i = 0; i < 10; i++) {
utility::LogInfo("[{}] {}", i, rng());
}
}

} // namespace tests
} // namespace open3d

0 comments on commit f94dcd1

Please sign in to comment.