Skip to content

Commit 5d72ffd

Browse files
committed
Add env var for FE_OVERFLOW.
1 parent f54569a commit 5d72ffd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

openvdb/openvdb/unittest/main.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,12 @@ main(int argc, char *argv[])
2424
::testing::InitGoogleTest(&argc, argv);
2525

2626
#if defined(__linux__) && defined(OPENVDB_TESTS_FPE)
27-
feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW);
27+
int excepts = FE_DIVBYZERO | FE_INVALID;
28+
if (getenv("OPENVDB_TEST_OVERFLOW")) {
29+
// when set, test for FP overflow as well.
30+
excepts = excepts | FE_OVERFLOW;
31+
}
32+
feenableexcept(excepts);
2833
#endif
2934

3035
return RUN_ALL_TESTS();

0 commit comments

Comments
 (0)