Rev 6285 | Rev 7878 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6285 | Rev 7746 | ||
---|---|---|---|
1 | #define MEMSIZE 4096*120 |
1 | #define MEMSIZE 4096*120 |
2 | 2 | ||
3 | #include "../lib/io.h" |
3 | #include "../lib/io.h" |
4 | #include "../lib/collection.h" |
4 | #include "../lib/collection.h" |
5 | 5 | ||
6 | 6 | ||
7 | void main() |
7 | void main() |
8 | { |
8 | { |
9 | io.run("/sys/develop/board", ""); |
9 | io.run("/sys/develop/board", ""); |
10 | test1(); |
10 | test1(); |
11 | test2(); |
11 | test2(); |
12 | } |
12 | } |
13 | 13 | ||
14 | void test1() |
14 | void test1() |
15 | collection s; |
15 | collection s; |
16 | { |
16 | { |
17 | s.add("Hello"); |
17 | s.add("Hello"); |
18 | s.add("World!"); |
18 | s.add("World!"); |
19 | debugln(s.get(0)); //-> Hello |
19 | debugln(s.get(0)); //-> Hello |
20 | debugln(s.get(1)); //-> World |
20 | debugln(s.get(1)); //-> World |
21 | s.drop(); |
21 | s.drop(); |
22 | } |
22 | } |
23 | 23 | ||
24 | void test2() |
24 | void test2() |
25 | collection_int ci; |
25 | collection_int ci; |
26 | int i; |
26 | int i; |
27 | { |
27 | { |
28 | ci.add(0); |
28 | ci.add(0); |
29 | ci.add(1); |
29 | ci.add(1); |
30 | ci.add(2); |
30 | ci.add(2); |
31 | ci.add(3); |
31 | ci.add(3); |
- | 32 | debugln("-> 0 1 2 3"); |
|
32 | for (i=0; i |
33 | for (i=0; i |
33 | ci.count--; |
34 | ci.count--; |
34 | ci.count--; |
35 | ci.count--; |
35 | ci.add(4); |
36 | ci.add(4); |
- | 37 | debugln("-> 0 1 4"); |
|
36 | for (i=0; i |
38 | for (i=0; i |
37 | ci.drop(); |
39 | ci.drop(); |
38 | } |
40 | } |