11function test_setDefaultsPTB()
2-
2+
33 %% test basic cfg creation
4-
4+
55 % test data
66 expectedCFG = returnExpectedCFG();
7-
7+
88 % test
99 cfg = setDefaultsPTB ;
10- testSubFields(expectedCFG , cfg )
11-
10+ testSubFields(expectedCFG , cfg );
11+
1212 %% test that values are not overwritten
13-
14- clear cfg
15-
13+
14+ clear cfg ;
15+
1616 % test data
1717 expectedCFG = returnExpectedCFG();
1818 expectedCFG.screen.monitorWidth = 36 ;
19-
19+
2020 % set up
2121 cfg.screen.monitorWidth = 36 ;
22-
22+
2323 % test
2424 cfg = setDefaultsPTB(cfg );
25- testSubFields(expectedCFG , cfg )
26-
25+ testSubFields(expectedCFG , cfg );
26+
2727 %% test with audio init
28-
29- clear cfg
30-
28+
29+ clear cfg ;
30+
3131 % test data
3232 expectedCFG = returnExpectedCFG();
3333 expectedCFG.audio = struct( ...
@@ -39,20 +39,18 @@ function test_setDefaultsPTB()
3939 ' repeat' , 1 , ...
4040 ' startCue' , 0 , ...
4141 ' waitForDevice' , 1 );
42-
42+
4343 % set up
4444 cfg.audio.do = 1 ;
45-
45+
4646 % test
4747 cfg = setDefaultsPTB(cfg );
48- testSubFields(expectedCFG , cfg )
49-
50-
51- end
48+ testSubFields(expectedCFG , cfg );
5249
50+ end
5351
5452function expectedCFG = returnExpectedCFG()
55-
53+
5654 expectedCFG = struct( ...
5755 ' testingDevice' , ' pc' , ...
5856 ' debug' , struct(' do' , true , ' transpWin' , true , ' smallWin' , true ), ...
@@ -62,12 +60,12 @@ function test_setDefaultsPTB()
6260 ' screen' , struct( ...
6361 ' monitorWidth' , 42 , ...
6462 ' monitorDistance' , 134 ));
65-
63+
6664 expectedCFG.keyboard.keyboard = [];
6765 expectedCFG.keyboard.responseBox = [];
6866 expectedCFG.keyboard.responseKey = {};
6967 expectedCFG.keyboard.escapeKey = ' ESCAPE' ;
70-
68+
7169end
7270
7371function testSubFields(expectedStructure , cfg )
0 commit comments