X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=tools%2Fccanlint%2Ftests%2Fheaders_idempotent.c;h=bf8c9f2dad8e61e406c40b6399aeae98fa12129b;hb=87c679ff36d7b198862cd2652a384d90f89f3b2b;hp=7e0dc300c81307b6b7786c0306e964c94c8fbc86;hpb=299dc8f99ca642943db4f0204b5fe31065545d27;p=ccan diff --git a/tools/ccanlint/tests/headers_idempotent.c b/tools/ccanlint/tests/headers_idempotent.c index 7e0dc300..bf8c9f2d 100644 --- a/tools/ccanlint/tests/headers_idempotent.c +++ b/tools/ccanlint/tests/headers_idempotent.c @@ -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] = '_'; @@ -58,7 +58,7 @@ static void handle_idem(struct manifest *m, struct score *score) if (!ask(q)) continue; - tmpname = maybe_temp_file(score, ".h", false, e->file->name); + tmpname = temp_file(score, ".h", e->file->name); out = fopen(tmpname, "w"); if (!out) err(1, "Opening %s", tmpname); @@ -174,16 +174,17 @@ static void check_idem(struct ccan_file *f, struct score *score) } static void check_idempotent(struct manifest *m, - bool keep, unsigned int *timeleft, struct score *score) { 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 +194,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);