Debian Codegraph @

terps/tads/tads3/test/data/bigvec.t

raw
1 #include <tads.h>
2 #include <vector.h>
3
4 main(args)
5 {
6 testVec(32767);
7 testVec(255*255);
8 testVec(65500);
9 testVec(65535);
10 testVec(65536);
11 testVec(100000);
12 }
13
14 testVec(len)
15 {
16 local v;
17
18 "new(<<len>>)... ";
19
20 try
21 {
22 v = new Vector(len);
23 }
24 catch (Exception exc)
25 {
26 "*** allocating: caught exception: <<exc.displayException()>>\n";
27 return;
28 }
29
30 try
31 {
32 v[1] = 'first';
33 v[len] = 'last';
34 "v[1] = <<v[1]>>; v[<<len>>] = <<v[len]>>\n";
35 }
36 catch (Exception exc)
37 {
38 "*** indexing: caught exception: <<exc.displayException()>>\n";
39 }
40 }