Print this page
Incorporate rmustacc's review feedback.

@@ -8,11 +8,11 @@
  * source.  A copy of the CDDL is also available via the Internet at
  * http://www.illumos.org/license/CDDL.
  */
 
 /*
- * Copyright 2014 Garrett D'Amore <garrett@damore.org>
+ * Copyright 2015 Garrett D'Amore <garrett@damore.org>
  */
 
 /*
  * Common handling for test programs.
  */

@@ -169,10 +169,11 @@
         } else {
                 (void) printf("TEST SUMMARY: %d / %d (%d failing)\n",
                     passes, tests, tests - passes);
         }
 }
+
 void
 test_debugf(test_t t, const char *format, ...)
 {
         va_list args;
 

@@ -277,19 +278,23 @@
         char            *err;
         int             lineno;
         int             rv;
         int             found;
         char            path[MAXPATHLEN];
+        int             i;
 
         va_start(va, fname);
-        for (int i = 0; i < MAXCB; i++) {
+        for (i = 0; i < MAXCB; i++) {
                 keyws[i] = (const char *)va_arg(va, const char *);
                 if (keyws[i] == NULL)
                         break;
                 callbs[i] = (test_cfg_func_t)va_arg(va, test_cfg_func_t);
         }
         va_end(va);
+        if (i == MAXCB) {
+                test_debugf(t, "too many arguments to function >= %d", MAXCB);
+        }
 
         found = 0;
 
         if (access(fname, F_OK) == 0) {
                 found++;