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

Commit 9f89f45

Browse files
committed
unit test for justadudewhohacks#480
1 parent 4bebf5b commit 9f89f45

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,16 @@ describe('Mat', () => {
323323
expect(buf).instanceOf(Buffer).lengthOf(18);
324324
});
325325
});
326-
326+
327+
describe('getData after getRegion', () => {
328+
it('should return buffer of with data of single channeled Mat', () => {
329+
const region = matC3.getRegion(new cv.Rect(0, 0, 2, 2));
330+
const buf = region.getData();
331+
expect(buf).instanceOf(Buffer).lengthOf(12);
332+
expect(new Uint8Array(buf)[6]).to.equal(region.getDataAsArray()[1][0][0])
333+
});
334+
});
335+
327336
describe('async', () => {
328337
it('should return buffer with data of single channeled Mat', (done) => {
329338
matC1.getDataAsync((err, buf) => {

0 commit comments

Comments
 (0)