5590
|
1 %% Automatically generated from DejaGNU files |
|
2 |
|
3 %% test/octave.test/unwind/unwind-1.m |
|
4 %!function y = f (x) |
|
5 %! global g; |
|
6 %! save_g = g; |
|
7 %! unwind_protect |
|
8 %! g = 0; |
|
9 %! y = g; |
|
10 %! [1,2;x]; |
|
11 %! g = 1; |
|
12 %! y = [y, g]; |
|
13 %! unwind_protect_cleanup |
|
14 %! g = save_g; |
|
15 %! y = [y, g]; |
|
16 %! end_unwind_protect |
|
17 %!test |
|
18 %! global g = -1; |
|
19 %! y = f ([3,4]); |
|
20 %! assert(y,[0,1,-1]); |
|
21 |
|
22 %% test/octave.test/unwind/unwind-2.m |
|
23 %!function y = f (x) |
|
24 %! global g; |
|
25 %! save_g = g; |
|
26 %! unwind_protect |
|
27 %! g = 0; |
|
28 %! y = g; |
|
29 %! [1,2;x]; |
|
30 %! g = 1; |
|
31 %! y = [y, g]; |
|
32 %! unwind_protect_cleanup |
|
33 %! g = save_g; |
|
34 %! y = [y, g]; |
|
35 %! assert(y,[0,-1]); |
|
36 %! end_unwind_protect |
|
37 %!test |
|
38 %! global g = -1; |
|
39 %! fail("y = f (3);","number of columns must match"); |
|
40 |