diff --git a/t/t_openpam_ctype.c b/t/t_openpam_ctype.c index 7e91158..3be35c7 100644 --- a/t/t_openpam_ctype.c +++ b/t/t_openpam_ctype.c @@ -75,7 +75,7 @@ static const char oc_pfcs[] = OC_PFCS; crib[(int)oc_##set[i]] = 1; \ for (i = ret = 0; i < sizeof crib; ++i) { \ if (is_##set(i) != crib[i]) { \ - t_verbose("is_%s() incorrect " \ + t_printv("is_%s() incorrect " \ "for %#02x\n", #set, i); \ ++ret; \ } \ diff --git a/t/t_openpam_dispatch.c b/t/t_openpam_dispatch.c index 766eeea..51d6bd0 100644 --- a/t/t_openpam_dispatch.c +++ b/t/t_openpam_dispatch.c @@ -54,7 +54,7 @@ OPENPAM_UNUSED(void *arg)) #define T(n) \ - t_add_test(&t_ ## n ## _func, NULL, t_ ## n ## _desc) + t_add_test(&t_ ## n ## _func, NULL, "%s", t_ ## n ## _desc) const char *pam_return_so; @@ -73,7 +73,7 @@ T_FUNC(empty_policy, "empty policy") t_fprintf(tf, "# empty policy\n"); pam_err = pam_start(tf->name, "test", &pamc, &pamh); if (pam_err != PAM_SUCCESS) { - t_verbose("pam_start() returned %d\n", pam_err); + t_printv("pam_start() returned %d\n", pam_err); return (0); } /* @@ -82,22 +82,22 @@ T_FUNC(empty_policy, "empty policy") * instead. */ pam_err = pam_authenticate(pamh, 0); - t_verbose("pam_authenticate() returned %d\n", pam_err); + t_printv("pam_authenticate() returned %d\n", pam_err); ret = (pam_err == PAM_SYSTEM_ERR); pam_err = pam_setcred(pamh, 0); - t_verbose("pam_setcred() returned %d\n", pam_err); + t_printv("pam_setcred() returned %d\n", pam_err); ret &= (pam_err == PAM_SYSTEM_ERR); pam_err = pam_acct_mgmt(pamh, 0); - t_verbose("pam_acct_mgmt() returned %d\n", pam_err); + t_printv("pam_acct_mgmt() returned %d\n", pam_err); ret &= (pam_err == PAM_SYSTEM_ERR); pam_err = pam_chauthtok(pamh, 0); - t_verbose("pam_chauthtok() returned %d\n", pam_err); + t_printv("pam_chauthtok() returned %d\n", pam_err); ret &= (pam_err == PAM_SYSTEM_ERR); pam_err = pam_open_session(pamh, 0); - t_verbose("pam_open_session() returned %d\n", pam_err); + t_printv("pam_open_session() returned %d\n", pam_err); ret &= (pam_err == PAM_SYSTEM_ERR); pam_err = pam_close_session(pamh, 0); - t_verbose("pam_close_session() returned %d\n", pam_err); + t_printv("pam_close_session() returned %d\n", pam_err); ret &= (pam_err == PAM_SYSTEM_ERR); pam_end(pamh, pam_err); t_fclose(tf); @@ -150,7 +150,7 @@ T_FUNC(mod_return, "module return value") } pam_err = pam_start(tf->name, "test", &pamc, &pamh); if (pam_err != PAM_SUCCESS) { - t_verbose("pam_start() returned %d\n", pam_err); + t_printv("pam_start() returned %d\n", pam_err); t_fclose(tf); continue; } @@ -174,10 +174,10 @@ T_FUNC(mod_return, "module return value") pam_err = pam_chauthtok(pamh, tc->flags); break; } - t_verbose("%s returned %d\n", + t_printv("%s returned %d\n", pam_func_name[tc->primitive], pam_err); pam_end(pamh, pam_err); - t_verbose("here\n"); + t_printv("here\n"); t_fclose(tf); } return (1); @@ -196,7 +196,7 @@ t_prepare(int argc, char *argv[]) (void)argv; if ((pam_return_so = getenv("PAM_RETURN_SO")) == NULL) { - t_verbose("define PAM_RETURN_SO before running these tests\n"); + t_printv("define PAM_RETURN_SO before running these tests\n"); return (0); } diff --git a/t/t_openpam_readlinev.c b/t/t_openpam_readlinev.c index c9b5c20..38b8f4f 100644 --- a/t/t_openpam_readlinev.c +++ b/t/t_openpam_readlinev.c @@ -52,7 +52,7 @@ OPENPAM_UNUSED(void *arg)) #define T(n) \ - t_add_test(&t_ ## n ## _func, NULL, t_ ## n ## _desc) + t_add_test(&t_ ## n ## _func, NULL, "%s", t_ ## n ## _desc) /* * Read a line from the temp file and verify that the result matches our @@ -76,20 +76,20 @@ orlv_expect(struct t_file *tf, const char **expectedv, int lines, int eof) if (t_ferror(tf)) err(1, "%s(): %s", __func__, tf->name); if (expectedv != NULL && gotv == NULL) { - t_verbose("expected %d words, got nothing\n", expectedc); + t_printv("expected %d words, got nothing\n", expectedc); ret = 0; } else if (expectedv == NULL && gotv != NULL) { - t_verbose("expected nothing, got %d words\n", gotc); + t_printv("expected nothing, got %d words\n", gotc); ret = 0; } else if (expectedv != NULL && gotv != NULL) { if (expectedc != gotc) { - t_verbose("expected %d words, got %d\n", + t_printv("expected %d words, got %d\n", expectedc, gotc); ret = 0; } for (i = 0; i < gotc; ++i) { if (strcmp(expectedv[i], gotv[i]) != 0) { - t_verbose("word %d: expected <<%s>>, " + t_printv("word %d: expected <<%s>>, " "got <<%s>>\n", i, expectedv[i], gotv[i]); ret = 0; } @@ -97,15 +97,15 @@ orlv_expect(struct t_file *tf, const char **expectedv, int lines, int eof) } FREEV(gotc, gotv); if (lineno != lines) { - t_verbose("expected to advance %d lines, advanced %d lines\n", + t_printv("expected to advance %d lines, advanced %d lines\n", lines, lineno); ret = 0; } if (eof && !t_feof(tf)) { - t_verbose("expected EOF, but didn't get it\n"); + t_printv("expected EOF, but didn't get it\n"); ret = 0; } else if (!eof && t_feof(tf)) { - t_verbose("didn't expect EOF, but got it anyway\n"); + t_printv("didn't expect EOF, but got it anyway\n"); ret = 0; } return (ret); diff --git a/t/t_openpam_readword.c b/t/t_openpam_readword.c index a7038a7..bb3e6d0 100644 --- a/t/t_openpam_readword.c +++ b/t/t_openpam_readword.c @@ -51,7 +51,7 @@ OPENPAM_UNUSED(void *arg)) #define T(n) \ - t_add_test(&t_ ## n ## _func, NULL, t_ ## n ## _desc) + t_add_test(&t_ ## n ## _func, NULL, "%s", t_ ## n ## _desc) /* * Read a word from the temp file and verify that the result matches our @@ -72,37 +72,37 @@ orw_expect(struct t_file *tf, const char *expected, int lines, int eof, int eol) if (t_ferror(tf)) err(1, "%s(): %s", __func__, tf->name); if (expected != NULL && got == NULL) { - t_verbose("expected <<%s>>, got nothing\n", expected); + t_printv("expected <<%s>>, got nothing\n", expected); ret = 0; } else if (expected == NULL && got != NULL) { - t_verbose("expected nothing, got <<%s>>\n", got); + t_printv("expected nothing, got <<%s>>\n", got); ret = 0; } else if (expected != NULL && got != NULL && strcmp(expected, got) != 0) { - t_verbose("expected <<%s>>, got <<%s>>\n", expected, got); + t_printv("expected <<%s>>, got <<%s>>\n", expected, got); ret = 0; } free(got); if (lineno != lines) { - t_verbose("expected to advance %d lines, advanced %d lines\n", + t_printv("expected to advance %d lines, advanced %d lines\n", lines, lineno); ret = 0; } if (eof && !t_feof(tf)) { - t_verbose("expected EOF, but didn't get it\n"); + t_printv("expected EOF, but didn't get it\n"); ret = 0; } if (!eof && t_feof(tf)) { - t_verbose("didn't expect EOF, but got it anyway\n"); + t_printv("didn't expect EOF, but got it anyway\n"); ret = 0; } ch = fgetc(tf->file); if (t_ferror(tf)) err(1, "%s(): %s", __func__, tf->name); if (eol && ch != '\n') { - t_verbose("expected EOL, but didn't get it\n"); + t_printv("expected EOL, but didn't get it\n"); ret = 0; } else if (!eol && ch == '\n') { - t_verbose("didn't expect EOL, but got it anyway\n"); + t_printv("didn't expect EOL, but got it anyway\n"); ret = 0; } if (ch != EOF) diff --git a/t/t_pam_conv.c b/t/t_pam_conv.c index ec3ebf4..e35797d 100644 --- a/t/t_pam_conv.c +++ b/t/t_pam_conv.c @@ -99,16 +99,16 @@ t_pam_conv(int nm, const struct pam_message **msgs, } switch (msgs[i]->msg_style) { case PAM_PROMPT_ECHO_OFF: - t_verbose("[PAM_PROMPT_ECHO_OFF] %s\n", msgs[i]->msg); + t_printv("[PAM_PROMPT_ECHO_OFF] %s\n", msgs[i]->msg); break; case PAM_PROMPT_ECHO_ON: - t_verbose("[PAM_PROMPT_ECHO_ON] %s\n", msgs[i]->msg); + t_printv("[PAM_PROMPT_ECHO_ON] %s\n", msgs[i]->msg); break; case PAM_ERROR_MSG: - t_verbose("[PAM_ERROR_MSG] %s\n", msgs[i]->msg); + t_printv("[PAM_ERROR_MSG] %s\n", msgs[i]->msg); break; case PAM_TEXT_INFO: - t_verbose("[PAM_TEXT_INFO] %s\n", msgs[i]->msg); + t_printv("[PAM_TEXT_INFO] %s\n", msgs[i]->msg); break; default: asprintf(&s->comment, "invalid message style %d",