When running --tests, messages cannot be created (externally defined), so that isn't an error we are interested in.

This commit is contained in:
Enno Rehling 2011-02-27 00:11:34 -08:00
parent ca2556c618
commit 12c3324850
3 changed files with 17 additions and 13 deletions

View File

@ -140,7 +140,7 @@ msg_message(const char * name, const char* sig, ...)
memset(args, 0, sizeof(args));
if (!mtype) {
log_error(("trying to create message of unknown type \"%s\"\n", name));
log_warning(("trying to create message of unknown type \"%s\"\n", name));
if (strcmp(name, "missing_message")!=0) {
return msg_message("missing_message", "name", name);
}

View File

@ -24,7 +24,9 @@ CuSuite* get_laws_suite(void);
int RunAllTests(void) {
CuString *output = CuStringNew();
CuSuite* suite = CuSuiteNew();
int flags = log_flags;
log_flags = LOG_FLUSH|LOG_CPERROR;
init_resources();
CuSuiteAddSuite(suite, get_base36_suite());
@ -37,6 +39,8 @@ int RunAllTests(void) {
CuSuiteSummary(suite, output);
CuSuiteDetails(suite, output);
printf("%s\n", output->buffer);
log_flags = flags;
return suite->failCount;
}

View File

@ -161,6 +161,7 @@ check_dupe(const char * format, const char * type)
void
_log_warn(const char * format, ...)
{
if (log_flags & LOG_CPWARNING) {
int dupe = check_dupe(format, "WARNING");
fflush(stdout);
@ -173,7 +174,6 @@ _log_warn(const char * format, ...)
va_end(marker);
}
if (!dupe) {
if (log_flags & LOG_CPWARNING) {
va_list marker;
fputs("WARNING: ", stderr);
va_start(marker, format);