]> git.ozlabs.org Git - ccan/blobdiff - tools/ccanlint/tests/headers_idempotent.c
ccanlint: run tests under valgrind initially.
[ccan] / tools / ccanlint / tests / headers_idempotent.c
index a1d30961f2035bc0dadbd9d557d9444f78f2edd5..f23784e4a2870c4b93cb9f7813aeb3b1d60464ef 100644 (file)
@@ -27,7 +27,7 @@ static void fix_name(char *name)
        unsigned int i;
 
        for (i = 0; name[i]; i++) {
-               if (isalnum(name[i]))
+               if (cisalnum(name[i]))
                        name[i] = toupper(name[i]);
                else
                        name[i] = '_';
@@ -145,18 +145,16 @@ static void check_idem(struct ccan_file *f, struct score *score)
        if (!get_token(&line, "#"))
                abort();
        if (!get_token(&line, "define")) {
-               char *str = talloc_asprintf(score,
-                                           "expected '#define %s'",
-                                           line_info[i].cond->symbol);
-               score_file_error(score, f, i+1, str);
+               score_file_error(score, f, i+1,
+                                "expected '#define %s'",
+                                line_info[i].cond->symbol);
                return;
        }
        sym = get_symbol_token(f, &line);
        if (!sym || !streq(sym, line_info[i].cond->symbol)) {
-               char *str = talloc_asprintf(score,
-                                           "expected '#define %s'",
-                                           line_info[i].cond->symbol);
-               score_file_error(score, f, i+1, str);
+               score_file_error(score, f, i+1,
+                                "expected '#define %s'",
+                                line_info[i].cond->symbol);
                return;
        }
 
@@ -181,11 +179,13 @@ static void check_idempotent(struct manifest *m,
 {
        struct ccan_file *f;
 
+       /* We don't fail ccanlint for this. */
+       score->pass = true;
+
        list_for_each(&m->h_files, f, list) {
                check_idem(f, score);
        }
        if (!score->error) {
-               score->pass = true;
                score->score = score->total;
        }
 }