Skip to content

Commit

Permalink
relax tolerance in the xlapack.solveCholesky test
Browse files Browse the repository at this point in the history
The xlapack.solveCholesky test in test_lapack.cpp fails on 32-bit architectures (i386/i686):
[ RUN      ] xlapack.solveCholesky
/tmp/autopkgtest-lxc.gg3nslld/downtmp/autopkgtest_tmp/test_lapack.cpp:166: Failure
Expected equality of these values:
  x_expected[i]
    Which is: 0.13757507429403265
  x[i]
    Which is: 0.13757507429403248
[  FAILED  ] xlapack.solveCholesky (0 ms)

This patch relaxes test tolerance by using EXPECT_NEAR with abstol=2e-16 instead of EXPECT_DOUBLE_EQ.

Fixes Issue xtensor-stack#211.
  • Loading branch information
drew-parsons authored Oct 16, 2021
1 parent 0aee299 commit 4a2eb67
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/test_lapack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ namespace xt
-1.3449222878385465 , -1.81183493755905478};

for (int i = 0; i < x_expected.shape()[0]; ++i) {
EXPECT_DOUBLE_EQ(x_expected[i], x[i]);
EXPECT_NEAR(x_expected[i], x[i], 2e-16);
}
}

Expand Down

0 comments on commit 4a2eb67

Please sign in to comment.