From dd4f86fbfabec110cf72170404ff7e09ab2f67a5 Mon Sep 17 00:00:00 2001 From: leitner Date: Tue, 25 Feb 2014 18:59:20 +0000 Subject: [PATCH] add some unit tests for the formatting routines --- CHANGES | 3 ++ test/marshal.c | 107 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 110 insertions(+) create mode 100644 test/marshal.c diff --git a/CHANGES b/CHANGES index 4b92e5d..8e8bbb7 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,9 @@ add compiletimeassert.h add haveuint128.h byte.h now defines UNALIGNED_ACCESS_OK on x86 + change buffer to have a destructor function pointer + SECURITY: fmt_strn would write one byte too many (returned right length though, so usually not a problem as that byte would be overwritten with \0 by the caller anyway) + fmt_pad and fmt_fill fail more gracefully when srclen > maxlen 0.29: save 8 bytes in taia.h for 64-bit systems diff --git a/test/marshal.c b/test/marshal.c new file mode 100644 index 0000000..870b0d2 --- /dev/null +++ b/test/marshal.c @@ -0,0 +1,107 @@ +#include +#include +#include +#include +#include + +char buf[100]; + +void zap() { size_t i; for (i=0; i