From c7e25c1457a7b51716f324ba79e17f08c9d5c230 Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Mon, 15 Oct 2012 20:56:49 +0000 Subject: [PATCH] Fixed the test (not the error reported) --- tests/email.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/tests/email.c b/tests/email.c index 79d5209..d0a0cf0 100644 --- a/tests/email.c +++ b/tests/email.c @@ -28,14 +28,21 @@ static int _email(char const * progname, char const * name, char const * email, char * n; char * e; + printf("%s: Testing \"%s\"\n", progname, str); n = mailer_helper_get_name(str); e = mailer_helper_get_email(str); if(strcmp(name, n) != 0) - fprintf(stderr, "%s: %s: %s (\"%s\")\n", progname, str, - "The name does not match", n); + { + fprintf(stderr, "%s: %s: %s\n", progname, n, + "Does not match the name"); + ret |= 2; + } if(strcmp(email, e) != 0) - fprintf(stderr, "%s: %s: %s (\"%s\")\n", progname, str, - "The e-mail does not match", e); + { + fprintf(stderr, "%s: %s: %s\n", progname, e, + "Does not match the e-mail"); + ret |= 3; + } free(e); free(n); return ret; @@ -51,5 +58,5 @@ int main(int argc, char * argv[]) "john@doe.com (John Doe)"); ret |= _email(argv[0], "John Doe", "john@doe.com", "John Doe "); - return ret; + return (ret == 0) ? 0 : 2; }