de9b63ce9e
git-svn-id: svn://kolibrios.org@7887 a494cfbc-eb01-0410-851d-a64ba20cac60
46 lines
819 B
C
46 lines
819 B
C
#define MEMSIZE 4096*120
|
|
|
|
#include "../lib/io.h"
|
|
#include "../lib/collection.h"
|
|
|
|
|
|
void main()
|
|
{
|
|
io.run("/sys/develop/board", "");
|
|
test1();
|
|
test2();
|
|
}
|
|
|
|
void test1()
|
|
collection s;
|
|
{
|
|
s.add("Hello");
|
|
s.add("World");
|
|
debugln(s.get(0)); //-> Hello
|
|
debugln(s.get(1)); //-> World
|
|
s.pop();
|
|
debugln(s.get(0)); //-> Hello
|
|
debugln(s.get(1)); //-> 0
|
|
s.add("Kolibri");
|
|
debugln(s.get(0)); //-> Hello
|
|
debugln(s.get(1)); //-> Kolibri
|
|
s.drop();
|
|
}
|
|
|
|
void test2()
|
|
collection_int ci;
|
|
int i;
|
|
{
|
|
ci.add(0);
|
|
ci.add(1);
|
|
ci.add(2);
|
|
ci.add(3);
|
|
debugln("-> 0 1 2 3");
|
|
for (i=0; i<ci.count; i++) debugln(itoa(ci.get(i))); //-> 0 1 2 3
|
|
ci.count--;
|
|
ci.count--;
|
|
ci.add(4);
|
|
debugln("-> 0 1 4");
|
|
for (i=0; i<ci.count; i++) debugln(itoa(ci.get(i))); //-> 0 1 4
|
|
ci.drop();
|
|
} |