forked from justadudewhohacks/opencv4nodejs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconstructorTests.js
More file actions
116 lines (100 loc) · 3.22 KB
/
Copy pathconstructorTests.js
File metadata and controls
116 lines (100 loc) · 3.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
module.exports = function ({ cv, utils }) {
const {
assertError,
assertPropsWithValue
} = utils;
describe('constructor', () => {
it('should throw if args empty', () => {
assertError(() => new cv.Vec(), 'expected arguments');
});
it('should throw if insufficient args', () => {
assertError(() => new cv.Vec(0), 'expected arguments');
});
it('should throw for trying to insantiate invalid vec5', () => {
assertError(() => new cv.Vec(5, 10, 20, 30, 40), 'Vec::New - expected arguments (u, v), (w), x, y, (z)');
});
});
describe('Vec2', () => {
it('should have int positions', () => {
const x = 100;
const y = 200;
assertPropsWithValue(new cv.Vec(x, y))({ x, y });
});
it('should have double positions', () => {
const x = 100.12345;
const y = 200.89764;
assertPropsWithValue(new cv.Vec(x, y))({ x, y });
});
it('should have negative int positions', () => {
const x = -100;
const y = -200;
assertPropsWithValue(new cv.Vec(x, y))({ x, y });
});
it('should have negative double positions', () => {
const x = -100.12345;
const y = -200.89764;
assertPropsWithValue(new cv.Vec(x, y))({ x, y });
});
});
describe('Vec3', () => {
it('should have int positions', () => {
const x = 100;
const y = 200;
const z = 300;
assertPropsWithValue(new cv.Vec(x, y, z))({ x, y, z });
});
it('should have double positions', () => {
const x = 100.12345;
const y = 200.89764;
const z = 300.034;
assertPropsWithValue(new cv.Vec(x, y, z))({ x, y, z });
});
it('should have negative int positions', () => {
it('should have int positions', () => {
const x = -100;
const y = -200;
const z = -300;
assertPropsWithValue(new cv.Vec(x, y, z))({ x, y, z });
});
});
it('should have negative double positions', () => {
const x = -100.12345;
const y = -200.89764;
const z = -300.034;
assertPropsWithValue(new cv.Vec(x, y, z))({ x, y, z });
});
});
describe('Vec4', () => {
it('should have int positions', () => {
const w = 50;
const x = 100;
const y = 200;
const z = 300;
assertPropsWithValue(new cv.Vec(w, x, y, z))({ w, x, y, z });
});
it('should have double positions', () => {
const w = 50.99;
const x = 100.12345;
const y = 200.89764;
const z = 300.034;
assertPropsWithValue(new cv.Vec(w, x, y, z))({ w, x, y, z });
});
it('should have negative int positions', () => {
it('should have int positions', () => {
const w = -50;
const x = -100;
const y = -200;
const z = -300;
assertPropsWithValue(new cv.Vec(w, x, y, z))({ w, x, y, z });
});
});
it('should have negative double positions', () => {
const w = -50.99;
const x = -100.12345;
const y = -200.89764;
const z = -300.034;
assertPropsWithValue(new cv.Vec(w, x, y, z))({ w, x, y, z });
});
});
});
};