File tree Expand file tree Collapse file tree 6 files changed +224
-0
lines changed Expand file tree Collapse file tree 6 files changed +224
-0
lines changed Original file line number Diff line number Diff line change
1
+ function tests = test_eq
2
+ % Test suite for the file eq.
3
+ %
4
+ % Test suite for the file eq
5
+ %
6
+ % Example
7
+ % test_eq
8
+ %
9
+ % See also
10
+ % eq
11
+
12
+ % ------
13
+ % Author: David Legland
14
+ % e-mail: david.legland@inrae.fr
15
+ % Created: 2021-02-04, using Matlab 9.8.0.1323502 (R2020a)
16
+ % Copyright 2021 INRAE - BIA-BIBS.
17
+
18
+ tests = functiontests(localfunctions );
19
+
20
+
21
+ function test_Simple(testCase ) % #ok<*DEFNU>
22
+ % Test call of function without argument.
23
+
24
+ lx = 1 : 6 ;
25
+ ly = 10 : 10 : 40 ;
26
+ [x , y ]= meshgrid(lx , ly );
27
+ img = Image(x + y );
28
+
29
+ bin = img == 23 ;
30
+
31
+ assertTrue(testCase , isa(bin , ' Image' ));
32
+ assertEqual(testCase , bin .Type , ' binary' );
33
+ assertEqual(testCase , size(bin ), size(img ));
34
+
35
+ assertFalse(testCase , bin(1 , 1 ));
36
+ assertTrue(testCase , bin(3 , 2 ));
37
+ assertFalse(testCase , bin(6 , 4 ));
Original file line number Diff line number Diff line change
1
+ function tests = test_ge
2
+ % Test suite for the file ge.
3
+ %
4
+ % Test suite for the file ge
5
+ %
6
+ % Example
7
+ % test_ge
8
+ %
9
+ % See also
10
+ % ge
11
+
12
+ % ------
13
+ % Author: David Legland
14
+ % e-mail: david.legland@inrae.fr
15
+ % Created: 2021-02-04, using Matlab 9.8.0.1323502 (R2020a)
16
+ % Copyright 2021 INRAE - BIA-BIBS.
17
+
18
+ tests = functiontests(localfunctions );
19
+
20
+
21
+ function test_Simple(testCase ) % #ok<*DEFNU>
22
+ % Test call of function without argument.
23
+
24
+ lx = 1 : 6 ;
25
+ ly = 10 : 10 : 40 ;
26
+ [x , y ]= meshgrid(lx , ly );
27
+ img = Image(x + y );
28
+
29
+ bin = img >= 23 ;
30
+
31
+ assertTrue(testCase , isa(bin , ' Image' ));
32
+ assertEqual(testCase , bin .Type , ' binary' );
33
+ assertEqual(testCase , size(bin ), size(img ));
34
+
35
+ assertFalse(testCase , bin(1 , 1 ));
36
+ assertTrue(testCase , bin(3 , 2 ));
37
+ assertTrue(testCase , bin(6 , 4 ));
38
+
Original file line number Diff line number Diff line change
1
+ function tests = test_gt
2
+ % Test suite for the file gt.
3
+ %
4
+ % Test suite for the file gt
5
+ %
6
+ % Example
7
+ % test_gt
8
+ %
9
+ % See also
10
+ % gt
11
+
12
+ % ------
13
+ % Author: David Legland
14
+ % e-mail: david.legland@inrae.fr
15
+ % Created: 2021-02-04, using Matlab 9.8.0.1323502 (R2020a)
16
+ % Copyright 2021 INRAE - BIA-BIBS.
17
+
18
+ tests = functiontests(localfunctions );
19
+
20
+
21
+ function test_Simple(testCase ) % #ok<*DEFNU>
22
+ % Test call of function without argument.
23
+
24
+ lx = 1 : 6 ;
25
+ ly = 10 : 10 : 40 ;
26
+ [x , y ]= meshgrid(lx , ly );
27
+ img = Image(x + y );
28
+
29
+ bin = img > 23 ;
30
+
31
+ assertTrue(testCase , isa(bin , ' Image' ));
32
+ assertEqual(testCase , bin .Type , ' binary' );
33
+ assertEqual(testCase , size(bin ), size(img ));
34
+
35
+ assertFalse(testCase , bin(1 , 1 ));
36
+ assertFalse(testCase , bin(3 , 2 ));
37
+ assertTrue(testCase , bin(6 , 4 ));
38
+
Original file line number Diff line number Diff line change
1
+ function tests = test_le
2
+ % Test suite for the file le.
3
+ %
4
+ % Test suite for the file le
5
+ %
6
+ % Example
7
+ % test_le
8
+ %
9
+ % See also
10
+ % le
11
+
12
+ % ------
13
+ % Author: David Legland
14
+ % e-mail: david.legland@inrae.fr
15
+ % Created: 2021-02-04, using Matlab 9.8.0.1323502 (R2020a)
16
+ % Copyright 2021 INRAE - BIA-BIBS.
17
+
18
+ tests = functiontests(localfunctions );
19
+
20
+
21
+ function test_Simple(testCase ) % #ok<*DEFNU>
22
+ % Test call of function without argument.
23
+
24
+ lx = 1 : 6 ;
25
+ ly = 10 : 10 : 40 ;
26
+ [x , y ]= meshgrid(lx , ly );
27
+ img = Image(x + y );
28
+
29
+ bin = img <= 23 ;
30
+
31
+ assertTrue(testCase , isa(bin , ' Image' ));
32
+ assertEqual(testCase , bin .Type , ' binary' );
33
+ assertEqual(testCase , size(bin ), size(img ));
34
+
35
+ assertTrue(testCase , bin(1 , 1 ));
36
+ assertTrue(testCase , bin(3 , 2 ));
37
+ assertFalse(testCase , bin(6 , 4 ));
Original file line number Diff line number Diff line change
1
+ function tests = test_lt
2
+ % Test suite for the file lt.
3
+ %
4
+ % Test suite for the file lt
5
+ %
6
+ % Example
7
+ % test_lt
8
+ %
9
+ % See also
10
+ % lt
11
+
12
+ % ------
13
+ % Author: David Legland
14
+ % e-mail: david.legland@inrae.fr
15
+ % Created: 2021-02-04, using Matlab 9.8.0.1323502 (R2020a)
16
+ % Copyright 2021 INRAE - BIA-BIBS.
17
+
18
+ tests = functiontests(localfunctions );
19
+
20
+
21
+ function test_Simple(testCase ) % #ok<*DEFNU>
22
+ % Test call of function without argument.
23
+
24
+ lx = 1 : 6 ;
25
+ ly = 10 : 10 : 40 ;
26
+ [x , y ]= meshgrid(lx , ly );
27
+ img = Image(x + y );
28
+
29
+ bin = img < 23 ;
30
+
31
+ assertTrue(testCase , isa(bin , ' Image' ));
32
+ assertEqual(testCase , bin .Type , ' binary' );
33
+ assertEqual(testCase , size(bin ), size(img ));
34
+
35
+ assertTrue(testCase , bin(1 , 1 ));
36
+ assertFalse(testCase , bin(3 , 2 ));
37
+ assertFalse(testCase , bin(6 , 4 ));
Original file line number Diff line number Diff line change
1
+ function tests = test_ne
2
+ % Test suite for the file ne.
3
+ %
4
+ % Test suite for the file ne
5
+ %
6
+ % Example
7
+ % test_ne
8
+ %
9
+ % See also
10
+ % ne
11
+
12
+ % ------
13
+ % Author: David Legland
14
+ % e-mail: david.legland@inrae.fr
15
+ % Created: 2021-02-04, using Matlab 9.8.0.1323502 (R2020a)
16
+ % Copyright 2021 INRAE - BIA-BIBS.
17
+
18
+ tests = functiontests(localfunctions );
19
+
20
+
21
+ function test_Simple(testCase ) % #ok<*DEFNU>
22
+ % Test call of function without argument.
23
+
24
+ lx = 1 : 6 ;
25
+ ly = 10 : 10 : 40 ;
26
+ [x , y ]= meshgrid(lx , ly );
27
+ img = Image(x + y );
28
+
29
+ bin = img ~= 23 ;
30
+
31
+ assertTrue(testCase , isa(bin , ' Image' ));
32
+ assertEqual(testCase , bin .Type , ' binary' );
33
+ assertEqual(testCase , size(bin ), size(img ));
34
+
35
+ assertTrue(testCase , bin(1 , 1 ));
36
+ assertFalse(testCase , bin(3 , 2 ));
37
+ assertTrue(testCase , bin(6 , 4 ));
You can’t perform that action at this time.
0 commit comments