Skip to content
This repository was archived by the owner on Oct 18, 2023. It is now read-only.

Commit 4bebf5b

Browse files
committed
adding tolerance to cv.solve test to fix unit test on OpenCV 3.1 (see https://travis-ci.org/justadudewhohacks/opencv4nodejs/jobs/466630833)
1 parent f91d873 commit 4bebf5b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

test/tests/core/Mat/Mat.test.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1030,7 +1030,14 @@ describe('Mat', () => {
10301030
getRequiredArgs: () => ([m2]),
10311031
expectOutput: (res, _, args) => {
10321032
expect(res).to.be.instanceOf(cv.Mat);
1033-
expect(res.getDataAsArray()).to.eql(expectedResults);
1033+
const arrayRes = res.getDataAsArray();
1034+
const tolerance = 1e-6;
1035+
arrayRes.forEach((r,i1) => {
1036+
r.forEach((n,i2) => {
1037+
expect(n).to.be.at.least(expectedResults[i1][i2]-tolerance);
1038+
expect(n).to.be.at.most(expectedResults[i1][i2]+tolerance)
1039+
})
1040+
})
10341041
}
10351042
});
10361043
};

0 commit comments

Comments
 (0)