NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/51834: [PATCH] tests/lib/libc/time/t_strptime: use ATF_CHECK_MSG instead of ATF_REQUIRE_MSG



The following reply was made to PR bin/51834; it has been noted by GNATS.

From: "Ngie Cooper (yaneurabeya)" <yaneurabeya%gmail.com@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: bin/51834: [PATCH] tests/lib/libc/time/t_strptime: use
 ATF_CHECK_MSG instead of ATF_REQUIRE_MSG
Date: Wed, 11 Jan 2017 22:10:41 -0800

 --Apple-Mail=_BDE705A5-C2AA-4C61-B348-C9B179A2FFD7
 Content-Transfer-Encoding: 7bit
 Content-Type: text/plain;
 	charset=us-ascii
 
 Patch attached.
 -Ngie
 
 --Apple-Mail=_BDE705A5-C2AA-4C61-B348-C9B179A2FFD7
 Content-Disposition: attachment;
 	filename*0=lib-libc-time-t_strptime-use-ATF_CHECK-instead-of_ATF_REQUIRE-to;
 	filename*1=-catch-all-failures.patch
 Content-Type: application/octet-stream;
 	x-unix-mode=0644;
 	name="lib-libc-time-t_strptime-use-ATF_CHECK-instead-of_ATF_REQUIRE-to-catch-all-failures.patch"
 Content-Transfer-Encoding: 7bit
 
 Index: time/t_strptime.c
 ===================================================================
 RCS file: /cvsroot/src/tests/lib/libc/time/t_strptime.c,v
 retrieving revision 1.12
 diff -u -r1.12 t_strptime.c
 --- time/t_strptime.c	31 Oct 2015 02:25:11 -0000	1.12
 +++ time/t_strptime.c	12 Jan 2017 05:12:29 -0000
 @@ -51,12 +51,12 @@
  	exp = buf + len;
  	ret = strptime(buf, fmt, &tm);
  
 -	ATF_REQUIRE_MSG(ret == exp,
 +	ATF_CHECK_MSG(ret == exp,
  	    "strptime(\"%s\", \"%s\", tm): incorrect return code: "
  	    "expected: %p, got: %p", buf, fmt, exp, ret);
  
  #define H_REQUIRE_FIELD(field)						\
 -		ATF_REQUIRE_MSG(tm.field == field,			\
 +		ATF_CHECK_MSG(tm.field == field,			\
  		    "strptime(\"%s\", \"%s\", tm): incorrect %s: "	\
  		    "expected: %d, but got: %d", buf, fmt,		\
  		    ___STRING(field), field, tm.field)
 @@ -78,7 +78,7 @@
  {
  	struct tm tm = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, NULL };
  
 -	ATF_REQUIRE_MSG(strptime(buf, fmt, &tm) == NULL, "strptime(\"%s\", "
 +	ATF_CHECK_MSG(strptime(buf, fmt, &tm) == NULL, "strptime(\"%s\", "
  	    "\"%s\", &tm) should fail, but it didn't", buf, fmt);
  }
  
 
 --Apple-Mail=_BDE705A5-C2AA-4C61-B348-C9B179A2FFD7--
 


Home | Main Index | Thread Index | Old Index