1
+ classdef testDisk < matlab .unittest .TestCase
2
+
3
+ properties
4
+ map
5
+ end
6
+
7
+
8
+ % methods(TestMethodSetup)
9
+ % function createFigure(testCase)
10
+ % end
11
+ % end
12
+ %
13
+ % methods(TestMethodTeardown)
14
+ % end
15
+
16
+ methods (TestClassSetup )
17
+ function createMap(testCase )
18
+ opt = sctool .scmapopt(' trace' ,0 ,' tol' ,1e- 12 );
19
+ p = polygon([4 2i - 2 + 4i - 3 - 3 - 1i 2 - 2i ]);
20
+ testCase.map = diskmap(p ,opt );
21
+ end
22
+ end
23
+
24
+ methods (Test )
25
+
26
+ function testForwardMap(testCase )
27
+ result = testCase .map([0.5 + 0.5i - 0.9 - 0.8 + 0.3i (1 + 1i )/sqrt(2 )]);
28
+ expected = [
29
+ - 2.301479291389453 + 0.891455618349974i ,...
30
+ - 2.959017053517382 - 0.004724964608807i ,...
31
+ - 2.920229222824237 + 0.110570172682907i ,...
32
+ - 2.699042997340806 + 1.203828010636846i ,...
33
+ ];
34
+ testCase .verifyEqual(result ,expected ,' abstol' ,1e- 10 );
35
+ end
36
+
37
+ function testInverseMap(testCase )
38
+ val = testCase .map([0.5 + 0.5i - 0.9 - 0.8 + 0.3i (1 + 1i )/sqrt(2 )]);
39
+ result = evalinv( testCase .map , val ) ;
40
+ expected = [0.5 + 0.5i - 0.9 - 0.8 + 0.3i (1 + 1i )/sqrt(2 )];
41
+ testCase .verifyEqual(result ,expected ,' abstol' ,1e- 10 );
42
+ end
43
+
44
+ function testCenter(testCase )
45
+ f = center(testCase .map ,0 );
46
+ result = f(0 );
47
+ testCase .verifyEqual(result ,0 ,' abstol' ,1e- 11 );
48
+ end
49
+
50
+ function testPlot(testCase )
51
+ fig = figure ;
52
+ plot(testCase .map ,4 ,3 )
53
+ close(fig )
54
+ end
55
+
56
+ end
57
+
58
+
59
+
60
+ end
0 commit comments