bglibs: adt/gqueue_test.c

- Main Page
- Modules
- Data Structures
- Files
- Directories
- Related Pages
- Examples

# adt/gqueue_test.c

    00001 /* $Id: gqueue_test.c 712 2006-07-27 22:32:39Z bruce $ */
    00002 #include <stdlib.h>
    00003 #include <string.h>
    00004
    00005 #include "gqueue.h"
    00006
    00007 #ifdef SELFTEST_MAIN
    00008 #include "selftest.c"
    00009
    00010 GQUEUE_DECL(test,int);
    00011 GQUEUE_DEFN(test,int,0,0);
    00012 static struct gqueue queue;
    00013
    00014 MAIN
    00015 {
    00016   int i;
    00017   int* p;
    00018   for (i = 0; i < 4; ++i)
    00019     debugfn(test_push(&queue, &i));
    00020   while ((p = test_top(&queue)) != 0) {
    00021     obuf_puti(&outbuf, *p); NL();
    00022     test_pop(&queue);
    00023   }
    00024 }
    00025
    00026 #endif
    00027 #ifdef SELFTEST_EXP
    00028 result=1
    00029 result=1
    00030 result=1
    00031 result=1
    00032 0
    00033 1
    00034 2
    00035 3
    00036 #endif