changeset 264:9b6fd2953d8c

Add test header printing function.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 17 Feb 2016 13:30:50 +0200
parents 423771158575
children effb2786f6a6
files tests.c
diffstat 1 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/tests.c	Wed Feb 17 13:28:01 2016 +0200
+++ b/tests.c	Wed Feb 17 13:30:50 2016 +0200
@@ -117,6 +117,16 @@
 }
 
 
+void tests_header(const char *str)
+{
+    THPRINT(0,
+        "======================================================\n"
+        " %s tests\n"
+        "======================================================\n",
+        str);
+}
+
+
 int main(int argc, char *argv[])
 {
     (void) argc;
@@ -139,7 +149,7 @@
     //
     // Test series #1
     //
-    THPRINT(0, "printf() family function tests.\n");
+    tests_header("printf() function family");
     int i_vals[] = { 2, 612342, -2, -612342, 0x1fff, 0x8000000, };
     char *i_fmts[] = { "%d", "%x", "%05d", "%5d", "%-5d", "%05x", "%5x", "", };
     size_t i1, i2;
@@ -162,7 +172,7 @@
     //
     // String matching functions
     //
-    THPRINT(0, "string matching function tests.\n");
+    tests_header("String matching");
 
 #define TEST2(fun, str1, str2, ret) do { \
         test_start(# fun  "('%s', '%s')", str1, str2); \