From 1f71b021d1e929847033104c0fdb952dd9cd4d97 Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Mon, 19 Nov 2012 00:50:00 +0100 Subject: [PATCH] Code cleanup --- tests/string.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/string.c b/tests/string.c index 4021dd6..bb7c447 100644 --- a/tests/string.c +++ b/tests/string.c @@ -16,18 +16,22 @@ #include +#include #include "System/string.h" /* test */ -static int _test(String * s) +static int _test(char const * progname, String * s) { size_t len; size_t i; - if((len = string_length(s)) == 0) + /* string_get_length */ + printf("%s: Testing %s\n", progname, "string_get_length()"); + if((len = string_get_length(s)) == 0) return 2; /* string_clear */ + printf("%s: Testing %s\n", progname, "string_clear()"); string_clear(s); for(i = 0; i <= len; i++) if(s[i] != '\0') @@ -44,7 +48,7 @@ int main(int argc, char * argv[]) if((s = string_new(argv[0])) == NULL) return 2; - ret |= _test(s); + ret |= _test(argv[0], s); string_delete(s); return 0; }