-
-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy patharray_test.dart
95 lines (81 loc) · 2.69 KB
/
array_test.dart
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
import 'package:test/test.dart';
import 'package:opencv_dart/opencv_dart.dart' as cv;
void main() {
test('cv.U8Array', () {
final array = cv.U8Array(10, 1);
expect(array[0], 1);
array[1] = 2;
expect(array[1], 2);
array[1] = 1;
expect(array.toList(), List.generate(10, (i) => 1));
final array2 = cv.U8Array.fromList(List.generate(array.length, (i) => 1));
expect(array2.props, isNotEmpty);
expect(array2.toList(), array2.toList());
});
test('cv.I8Array', () {
final array = cv.I8Array(10, 1);
expect(array[0], 1);
array[1] = 2;
expect(array[1], 2);
array[1] = 1;
expect(array.toList(), List.generate(10, (i) => 1));
final array2 = cv.I8Array.fromList(List.generate(array.length, (i) => 1));
expect(array2.props, isNotEmpty);
expect(array2.toList(), array2.toList());
});
test('cv.U16Array', () {
final array = cv.U16Array(10, 1);
expect(array[0], 1);
array[1] = 2;
expect(array[1], 2);
array[1] = 1;
expect(array.toList(), List.generate(10, (i) => 1));
final array2 = cv.U16Array.fromList(List.generate(array.length, (i) => 1));
expect(array2.props, isNotEmpty);
expect(array2.toList(), array2.toList());
});
test('cv.I16Array', () {
final array = cv.I16Array(10, 1);
expect(array[0], 1);
array[1] = 2;
expect(array[1], 2);
array[1] = 1;
expect(array.toList(), List.generate(10, (i) => 1));
final array2 = cv.I16Array.fromList(List.generate(array.length, (i) => 1));
expect(array2.props, isNotEmpty);
expect(array2.toList(), array2.toList());
});
test('cv.I32Array', () {
final array = cv.I32Array(10, 1);
expect(array[0], 1);
array[1] = 2;
expect(array[1], 2);
array[1] = 1;
expect(array.toList(), List.generate(10, (i) => 1));
final array2 = cv.I32Array.fromList(List.generate(array.length, (i) => 1));
expect(array2.props, isNotEmpty);
expect(array2.toList(), array2.toList());
});
test('cv.F32Array', () {
final array = cv.F32Array(10, 1);
expect(array[0], 1);
array[1] = 2;
expect(array[1], 2);
array[1] = 1;
expect(array.toList(), List.generate(10, (i) => 1));
final array2 = cv.F32Array.fromList(List.generate(array.length, (i) => 1));
expect(array2.props, isNotEmpty);
expect(array2.toList(), array2.toList());
});
test('cv.F64Array', () {
final array = cv.F64Array(10, 1);
expect(array[0], 1);
array[1] = 2;
expect(array[1], 2);
array[1] = 1;
expect(array.toList(), List.generate(10, (i) => 1));
final array2 = cv.F64Array.fromList(List.generate(array.length, (i) => 1));
expect(array2.props, isNotEmpty);
expect(array2.toList(), array2.toList());
});
}