os: complain about unsupported pnprintf directives

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
Peter Hutterer
2013-02-14 16:24:53 +10:00
parent d903d17d7f
commit d9848fb4b1
2 changed files with 8 additions and 0 deletions

View File

@@ -206,6 +206,13 @@ static void logging_format(void)
read_log_msg(logmsg);
assert(strcmp(logmsg, "(EE) test a\n") == 0);
/* something unsupported % */
LogMessageVerbSigSafe(X_ERROR, -1, "test %Q\n");
read_log_msg(logmsg);
assert(strstr(logmsg, "BUG") != NULL);
LogMessageVerbSigSafe(X_ERROR, -1, "\n");
fseek(f, 0, SEEK_END);
/* string substitution */
LogMessageVerbSigSafe(X_ERROR, -1, "%s\n", "substituted string");
read_log_msg(logmsg);