Mercurial > hg > octave-nkf
annotate test/test_classes.m @ 11542:695141f1c05c ss-3-3-55
snapshot 3.3.55
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sat, 15 Jan 2011 04:53:04 -0500 |
parents | fd0a3ac60b0e |
children |
rev | line source |
---|---|
11523 | 1 ## Copyright (C) 2009-2011 Robert T. Short |
9381
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
2 ## |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
3 ## This file is part of Octave. |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
4 ## |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
5 ## Octave is free software; you can redistribute it and/or modify it |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
6 ## under the terms of the GNU General Public License as published by |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
7 ## the Free Software Foundation; either version 3 of the License, or (at |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
8 ## your option) any later version. |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
9 ## |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
10 ## Octave is distributed in the hope that it will be useful, but |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
13 ## General Public License for more details. |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
14 ## |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
15 ## You should have received a copy of the GNU General Public License |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
16 ## along with Octave; see the file COPYING. If not, see |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
17 ## <http://www.gnu.org/licenses/>. |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
18 |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
19 %% Test script for legacy OOP. |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
20 %% Requires the path to contain the test classes. |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
21 %% |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
22 %% Note: This script and all classes are also intended to run |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
23 %% in MATLAB to test compatibility. Don't break that! |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
24 %% |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
25 %% To Do: This script tests to ensure that things done correctly work |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
26 %% corrrectly. It should also check that things done incorrectly |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
27 %% error properly. |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
28 %% |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
29 %% The classes used for the tests reside in the test directory. |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
30 %% |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
31 %% The classes provide the ability to test most of the major features |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
32 %% of the legacy OOP facilities. There are a number of classes, mostly |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
33 %% kind of the same, that create a hierarchy. |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
34 |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
35 %% Test the Snork class. The Snork class has a number of the standard |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
36 %% methods that the others don't so we can test indexing and other |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
37 %% features. |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
38 %!shared snk, snk1, snk2 |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
39 %!test snk = Snork(); |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
40 %! assert(gick(snk),1) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
41 %! assert(snk.gick,1) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
42 %! assert(snk(2),1); |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
43 %! assert(snk{end},3); |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
44 %!test snk = gick(snk,2); |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
45 %! assert(gick(snk),2) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
46 %!test snk = set(snk,'gick',7); |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
47 %! assert(get(snk, 'gick'), 7) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
48 %!test snk.gick = 4; |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
49 %! assert(gick(snk),4) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
50 %! snk(1) = 3; |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
51 %!test snk{end} = 9; |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
52 %! assert(cack(snk),[3 1 2 9]) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
53 %! assert(getStash(snk),1) % Check private functions. |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
54 %! assert(isobject(snk)) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
55 %! assert(class(snk),'Snork') |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
56 %! assert(isa(snk,'Snork')) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
57 %! assert(~isa(snk,'Sneetch')) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
58 %! assert(ismethod(snk,'gick')) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
59 %! assert(~ismethod(snk,'bletch')) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
60 %! assert(exist('snk')) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
61 %! assert(~exist('blink')) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
62 %!test snk1 = Snork(snk); |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
63 %! assert(class(snk1),'Snork') |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
64 %! assert(gick(snk1),4) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
65 %!test snk2 = Snork(-3); |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
66 %! assert(class(snk2),'Snork') |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
67 %! assert(gick(snk2),-3) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
68 %!test x=[1 2 3 4]; |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
69 %! assert(x(snk),1); |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
70 %% x=methods('Snork'); % Need to test the methods function. |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
71 %% save temp snk; |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
72 %% load temp % This load causes a segment fault. |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
73 %% assert(cack(snk),[-1 -2 -3 -4]); % This is a major bug! |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
74 |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
75 %% The Spork class is a near clone of Snork but without as many standard |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
76 %% methods. We are testing no new octave features, but this is makes |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
77 %% sure that we haven't bollixed up the Spork class if we should make |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
78 %% changes. We use Spork in the class hierarchy. |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
79 %!shared sprk |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
80 %!test sprk = Spork(); |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
81 %! assert(geek(sprk),1) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
82 %!test sprk = geek(sprk,3); |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
83 %! assert(geek(sprk),3) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
84 %!test sprk = set(sprk,'geek',7); |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
85 %! assert(get(sprk, 'geek'), 7) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
86 %! assert(class(sprk),'Spork'); |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
87 %! assert(isa(sprk,'Spork')) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
88 |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
89 %% The Blork class is a near clone of Snork but without as many standard |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
90 %% methods. We are testing no new octave features, but this is makes |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
91 %% sure that we haven't bollixed up the Blork class if we should make |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
92 %% changes. We use Blork in the class hierarchy. |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
93 %!shared blrk |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
94 %!test blrk = Blork(); |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
95 %! assert(bleek(blrk),1) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
96 %!test blrk = bleek(blrk,3); |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
97 %! assert(bleek(blrk),3) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
98 %!test blrk = set(blrk,'bleek',13); |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
99 %! assert(get(blrk, 'bleek'), 13) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
100 %! assert(class(blrk),'Blork'); |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
101 %! assert(isa(blrk,'Blork')) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
102 |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
103 %% The Cork class is a near clone of Snork but without as many standard |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
104 %% methods. We are testing no new octave features, but this is makes |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
105 %% sure that we haven't bollixed up the Cork class if we should make |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
106 %% changes. We use Cork in the class hierarchy. |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
107 %!shared crk |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
108 %!test crk = Cork(23); |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
109 %! assert(click(crk),23) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
110 %!test crk = click(crk,3); |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
111 %! assert(click(crk),3) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
112 %!test crk = set(crk,'click',13); |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
113 %! assert(get(crk, 'click'), 13) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
114 %! assert(class(crk),'Cork'); |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
115 %! assert(isa(crk,'Cork')) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
116 |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
117 %% The Dork class tests single inheritance. |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
118 %!shared drk |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
119 %!test drk = Dork(); |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
120 %! assert(gack(drk),0) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
121 %!test drk = gack(drk,-2); |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
122 %! assert(gack(drk),-2) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
123 %!test drk = gick(drk,2); |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
124 %! assert(gick(drk),2); |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
125 %!test drk = set(drk, 'gick',3, 'gack',-3); |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
126 %! assert(get(drk, 'gick'), 3) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
127 %! assert(get(drk, 'gack'), -3) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
128 %! assert(class(drk),'Dork') |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
129 %! assert(isa(drk,'Dork')) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
130 %! assert(isa(drk,'Snork')) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
131 %! assert(getStash(drk),2) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
132 %!test drk1 = Dork(drk); |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
133 %! assert(class(drk1),'Dork') |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
134 %! assert(isa(drk1,'Snork')) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
135 %! assert(gick(drk1),3) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
136 %! assert(gack(drk1),-3) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
137 %!test drk2 = Dork(-4,4); |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
138 %! assert(class(drk2),'Dork') |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
139 %! assert(isa(drk2,'Snork')) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
140 %! assert(gick(drk2),-4) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
141 %! assert(gack(drk2),4) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
142 |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
143 %% The Pork class is essentially a clone of Dork. It is used as part |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
144 %% of the multiple inheritance test. |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
145 %!shared prk, drk |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
146 %!test prk = Pork(); |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
147 %! assert(geek(prk),1) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
148 %! assert(gurk(prk),0) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
149 %!test prk = gurk(prk,-3); |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
150 %! assert(gurk(prk),-3) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
151 %!test prk = geek(prk,9); |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
152 %! assert(geek(prk),9) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
153 %! assert(class(prk),'Pork') |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
154 %! assert(isa(prk,'Pork')) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
155 %! assert(isa(prk,'Spork')) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
156 %!test drk = Dork(); % Precedence. |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
157 %! assert(bling(drk,prk),2) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
158 %! assert(bling(prk,drk),2) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
159 |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
160 %% The Gork class tests aggregation and multiple inheritance. |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
161 %!shared grk |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
162 %!test grk = Gork(); |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
163 %! assert(gick(grk),1) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
164 %! assert(geek(grk),1) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
165 %! assert(gack(grk),0) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
166 %! assert(gurk(grk),0) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
167 %! assert(bleek(grk),1) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
168 %! assert(gark(grk),-2) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
169 %! assert(click(cork(grk)),17) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
170 %! assert(class(cork(grk)),'Cork') |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
171 %!test grk = gick(grk,3); |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
172 %!test grk = geek(grk,4); |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
173 %!test grk = gack(grk,-9); |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
174 %!test grk = gurk(grk,-8); |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
175 %!test grk = bleek(grk,-7); |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
176 %!test grk = gark(grk,-6); |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
177 %!test grk = cork(grk,click(cork(grk),23)); |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
178 %! assert(gick(grk),3) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
179 %! assert(geek(grk),4) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
180 %! assert(gack(grk),-9) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
181 %! assert(gurk(grk),-8) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
182 %! assert(bleek(grk),-7) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
183 %! assert(gark(grk),-6) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
184 %! assert(click(cork(grk)),23) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
185 %!test |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
186 %! cork1 = Cork(13); |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
187 %! grk = set(grk, 'gick',-5, 'gack',-6, 'gark',-7, 'cork',cork1); |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
188 %! assert(get(grk,'gick'),-5) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
189 %! assert(get(grk,'gack'),-6) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
190 %! assert(get(grk,'gark'),-7) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
191 %! assert(click(get(grk, 'cork')),13); |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
192 %!test grk = set(grk, 'cork',12); |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
193 %! assert(click(get(grk, 'cork')),12); |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
194 %! assert(class(cork(grk)),'Cork') |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
195 %! assert(class(grk),'Gork') |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
196 %! assert(isa(grk,'Gork')) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
197 %! assert(isa(grk,'Dork')) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
198 %! assert(isa(grk,'Pork')) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
199 %! assert(isa(grk,'Blork')) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
200 %! assert(isa(grk,'Snork')) |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
diff
changeset
|
201 %! assert(isa(grk,'Spork')) |