Check-in [b40db3d46d]

Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
SHA1 Hash:b40db3d46db4607b60d6d8b1305c92728e829997
Date: 2008-11-13 17:29:29
User: stephan
Comment:egg - some test code for whclob.c
Changes
hide diffs unified diffs patch

Added src/test-clob.c

Old () New (1e003859b6d93841)
> 1 #include <stdio.h>
> 2 #include <stdlib.h>
> 3 #include <string.h>
> 4 #include <ctype.h>
> 5 #include <assert.h>
> 6
> 7 #include "s11n.net/c11n/detail/whclob.h"
> 8
> 9 #if 1
> 10 #define MARKER if(1) printf("MARKER: %s:%d:%s(): ",__FILE__,__LINE__,__func__); if(1) printf
> 11 #else
> 12 #define MARKER if(0) printf
> 13 #endif
> 14
> 15 #define DUMP(CL) MARKER("clob@%p size=%ld capacity=%ld data=[%s]\n",(void const *)CL,whclob_size(CL),whclob_capacity(CL),whclob_bufferc(CL))
> 16
> 17 int main( int argc, char const ** argv )
> 18 {
> 19 char const * input =
> 20 //"a b c"
> 21 "A <B> C*D \"inner string\""
> 22 ;
> 23 whclob * cb = whclob_new_n(40);
> 24 DUMP(cb);
> 25 whclob_appendf( cb, "%s", input );
> 26 DUMP(cb);
> 27 whclob_truncate(cb,3,1);
> 28 DUMP(cb);
> 29 whclob_append( cb, "HIHI", 4 );
> 30 DUMP(cb);
> 31 whclob_truncate(cb,5,0);
> 32 DUMP(cb);
> 33 whclob_truncate(cb,8,-1);
> 34 DUMP(cb);
> 35 whclob_finalize(cb);
> 36 return 0;
> 37 }