diff options
author | Andreas Baumann <abaumann@yahoo.com> | 2012-07-13 14:02:06 +0200 |
---|---|---|
committer | Andreas Baumann <abaumann@yahoo.com> | 2012-07-13 14:02:06 +0200 |
commit | 1454c6b21144b57dc556676313643baf5bc0f31a (patch) | |
tree | 391cfeeb035738eb18fb087000c990f9a6007a2b /tests/libfetch | |
parent | a441d2f44ca233c9d3f0228e76b3072e9cdb7fda (diff) | |
download | crawler-1454c6b21144b57dc556676313643baf5bc0f31a.tar.gz crawler-1454c6b21144b57dc556676313643baf5bc0f31a.tar.bz2 |
added a test for a libfetch_streambuf
Diffstat (limited to 'tests/libfetch')
-rw-r--r-- | tests/libfetch/GNUmakefile | 3 | ||||
-rw-r--r-- | tests/libfetch/test1.c | 5 |
2 files changed, 6 insertions, 2 deletions
diff --git a/tests/libfetch/GNUmakefile b/tests/libfetch/GNUmakefile index a8d7495..6f6099f 100644 --- a/tests/libfetch/GNUmakefile +++ b/tests/libfetch/GNUmakefile @@ -23,6 +23,9 @@ endif TEST_BINS = \ test1$(EXE) +TEST_CPP_BINS = \ + test2$(EXE) + OBJS = -include $(TOPDIR)/makefiles/gmake/sub.mk diff --git a/tests/libfetch/test1.c b/tests/libfetch/test1.c index fd28563..f912e3a 100644 --- a/tests/libfetch/test1.c +++ b/tests/libfetch/test1.c @@ -2,13 +2,13 @@ #include <stdlib.h> #include <unistd.h> -#include <fetch.h> +#include "fetch.h" int main( int argc, char *argv[] ) { char *urlstring; fetchIO *io; - char buf[1024]; + char buf[256]; ssize_t res; if( argc != 2 ) { @@ -27,6 +27,7 @@ int main( int argc, char *argv[] ) } while( ( res = fetchIO_read( io, buf, sizeof( buf ) ) ) != 0 ) { + buf[res] = '\0'; puts( buf ); } |