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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1040 - (show annotations) (download) (as text)
Fri Jan 5 00:26:06 2007 UTC (13 years, 7 months ago) by johnpye
File MIME type: text/x-ascend
File size: 731 byte(s)
Adding missing test models.
1 REQUIRE "atoms.a4l";
2 IMPORT "johnpye/extfn/extfntest";
3
4 (*
5 This tests external relations embedded directly inside a FOR loop.
6 There was a typo in the orignal version of this file that seems to have
7 exposed a bug. This test will identify bug so that it can be fixed.
8 *)
9 MODEL extrelfor;
10
11 n IS_A integer_constant;
12 n :== 5;
13
14 x[1..n] IS_A factor;
15
16 FOR i IN [1..n-1] CREATE
17 do_it: add_one( (* note the missing index after do_it *)
18 x[i] : INPUT;
19 x[i+1] : OUTPUT
20 );
21 END FOR;
22
23 METHODS
24 METHOD specify;
25 FIX x[1];
26 END specify;
27
28 METHOD values;
29 x[1] := 1.0;
30 END values;
31
32 METHOD on_load;
33 RUN specify;
34 RUN values;
35 END on_load;
36
37 METHOD self_test;
38 ASSERT x[1] == 1.0;
39 ASSERT x[n] == 1.0 * n;
40 END self_test;
41
42 END extrelfor;

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