removed obsolete container test case

This commit is contained in:
garbeam 2005-12-21 18:55:34 +02:00
parent ee33e6655b
commit 06d20fd335
2 changed files with 1 additions and 117 deletions

View File

@ -7,19 +7,12 @@ CFLAGS += -I../liblitz -I../libixp -I../libwmii -I../libcext
LDFLAGS += -L../liblitz -llitz -L../libixp -lixp \
-L../libwmii -lwmii -L../libcext -lcext
SRC_container = test_container.c
OBJ_container = ${SRC_container:.c=.o}
all: test_container
all:
@echo built test cases
.c.o:
@echo CC $<
@${CC} -c ${CFLAGS} $<
test_container: ${OBJ_container}
@echo LD $@
@${CC} -o $@ ${OBJ_container} ${LDFLAGS}
clean:
rm -f test_container *.o

View File

@ -1,109 +0,0 @@
/*
* (C)opyright MMIV-MMV Anselm R. Garbe <garbeam at gmail dot com>
* See LICENSE file for license details.
*/
#include <assert.h>
#include <stdio.h>
#include "cext.h"
static void iter_print_container(void *item, void *aux)
{
printf("%d\n", *(int *)item);
}
int main(int argc, char *argv[])
{
Container c = {0};
int i;
printf("--------------------------------\n");
{
int *e = cext_emallocz(sizeof(int));
cext_attach_item(&c, e);
cext_iterate(&c, nil, iter_print_container);
cext_detach_item(&c, e);
cext_iterate(&c, nil, iter_print_container);
}
printf("--------------------------------\n");
printf("--------------------------------\n");
for (i = 0; i < 10; i++) {
int *e = cext_emallocz(sizeof(int));
*e = i;
cext_attach_item(&c, e);
}
cext_iterate(&c, nil, iter_print_container);
printf("--------------------------------\n");
printf("--------------------------------\n");
for (i = 0; i < 10; i++) {
int *e = cext_list_get_item(&c, i);
printf("%d\n", *e);
}
printf("--------------------------------\n");
printf("--------------------------------\n");
{
CItem *itm = c.stack;
for (; itm; itm = itm->down)
printf("%d\n", *(int *)itm->item);
}
printf("--------------------------------\n");
printf("--------------------------------\n");
{
int *e = cext_list_get_item(&c, 5);
cext_stack_top_item(&c, e);
e = cext_stack_get_top_item(&c);
printf("%d (5)\n", *e);
e = cext_stack_get_up_item(&c, cext_stack_get_top_item(&c));
printf("%d (0)\n", *e);
e = cext_stack_get_down_item(&c, cext_stack_get_top_item(&c));
printf("%d (9)\n", *e);
}
printf("--------------------------------\n");
printf("--------------------------------\n");
{
CItem *itm = c.stack;
for (; itm; itm = itm->down)
printf("%d\n", *(int *)itm->item);
}
printf("--------------------------------\n");
printf("--------------------------------\n");
{
int *e = cext_list_get_item(&c, 5);
cext_detach_item(&c, e);
cext_iterate(&c, nil, iter_print_container);
}
printf("--------------------------------\n");
printf("--------------------------------\n");
{
CItem *itm = c.stack;
for (; itm; itm = itm->down)
printf("%d\n", *(int *)itm->item);
}
printf("--------------------------------\n");
printf("--------------------------------\n");
{
int *e = cext_list_get_item(&c, 4);
cext_detach_item(&c, e);
cext_iterate(&c, nil, iter_print_container);
}
printf("--------------------------------\n");
printf("--------------------------------\n");
{
CItem *itm = c.stack;
for (; itm; itm = itm->down)
printf("%d\n", *(int *)itm->item);
}
printf("--------------------------------\n");
return TRUE;
}