cfad47cfa3/t3compiler/tads3/test/data/bigvec.t

4b825dc642cb6eb9a060e54bf8d69288fbee4904cfad47cfa334b206c65f22086bcc5d63e6f70944
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
}