]> git.ozlabs.org Git - ccan/blobdiff - tools/ccanlint/tests/headers_idempotent.c
ccanlint: use traversal to trim tests we want to skip.
[ccan] / tools / ccanlint / tests / headers_idempotent.c
index 7e0dc300c81307b6b7786c0306e964c94c8fbc86..4b98b246bfcdacc24608e5b6352ec9a77c4b2de3 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] = '_';
@@ -179,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;
        }
 }
@@ -193,7 +195,7 @@ struct ccanlint headers_idempotent = {
        .name = "Module headers are #ifndef/#define wrapped",
        .check = check_idempotent,
        .handle = handle_idem,
-       .needs = ""
+       .needs = "info_exists main_header_exists"
 };
 
 REGISTER_TEST(headers_idempotent);