/[ascend]/trunk/models/johnpye/extfn/extrelarray.a4c
ViewVC logotype

Contents of /trunk/models/johnpye/extfn/extrelarray.a4c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 758 - (show annotations) (download) (as text)
Thu Jul 13 01:15:58 2006 UTC (18 years ago) by johnpye
File MIME type: text/x-ascend
File size: 733 byte(s)
Some extfn test cases.
1 REQUIRE "atoms.a4l";
2 IMPORT "johnpye/extfn/extfntest";
3
4 MODEL extrelelement;
5 x IS_A factor;
6 y IS_A factor;
7 do_it: add_one(
8 x : INPUT;
9 y : OUTPUT
10 );
11 END extrelelement;
12
13 (*
14 This is a test model to ensure that repeated instances of the same
15 external relation behave correctly. This is because the 'anoncopy' stuff
16 wasn't working for my extrel hack when I tried it -- JP
17 *)
18 MODEL extrelarray;
19
20 e[1..2] IS_A extrelelement;
21
22 FOR i IN [1] CREATE
23 e[i].y, e[i+1].x ARE_THE_SAME;
24 END FOR;
25
26 METHODS
27 METHOD specify;
28 FIX e[1].x;
29 END specify;
30
31 METHOD values;
32 e[1].x := 1.0;
33 END values;
34
35 METHOD default_self;
36 RUN specify;
37 RUN values;
38 END default_self;
39
40 METHOD self_test;
41 ASSERT e[2].y == 3.0;
42 END self_test;
43
44 END extrelarray;

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22