From 2d23d4bbeba76cad1fabff5bb5447ac14cf503ec Mon Sep 17 00:00:00 2001 From: leitner Date: Fri, 6 Sep 2002 18:00:07 +0000 Subject: [PATCH] a few more tests --- test/b64decode.c | 26 ++++++++++++++++++++++++++ test/b64encode.c | 24 ++++++++++++++++++++++++ test/byte_copy.c | 14 ++++++++++++++ test/urlencode.c | 7 +++++++ 4 files changed, 71 insertions(+) create mode 100644 test/b64decode.c create mode 100644 test/b64encode.c create mode 100644 test/byte_copy.c diff --git a/test/b64decode.c b/test/b64decode.c new file mode 100644 index 0000000..93677e9 --- /dev/null +++ b/test/b64decode.c @@ -0,0 +1,26 @@ +#include +#include "buffer.h" +#include "textcode.h" + +void b64encode(const char* c) { + char* buf=alloca(strlen(c)*2+4); + unsigned int dlen; + scan_base64(c,buf,&dlen); + buffer_put(buffer_1,buf,dlen); + buffer_putnlflush(buffer_1); +} + +main(int argc,char* argv[]) { + int i; + for (i=1; i +#include "buffer.h" +#include "textcode.h" + +void b64encode(const char* c) { + char* buf=alloca(strlen(c)*2+4); + buffer_put(buffer_1,buf,fmt_base64(buf,c,strlen(c))); + buffer_putnlflush(buffer_1); +} + +main(int argc,char* argv[]) { + int i; + for (i=1; i + +int main() { + char buf[4096]; + __write1("both aligned\n"); + byte_copy(buf,16,"this is a test!\n"); + __write1("destination aligned, source unaligned\n"); + byte_copy(buf,1000,buf+1); + __write1("destination unaligned, source aligned\n"); + byte_copy(buf+1,1000,buf); + __write1("both unaligned\n"); + byte_copy(buf+1,1000,buf+3); +} diff --git a/test/urlencode.c b/test/urlencode.c index 51df16e..e2dfa0f 100644 --- a/test/urlencode.c +++ b/test/urlencode.c @@ -13,5 +13,12 @@ main(int argc,char* argv[]) { for (i=1; i