IncludeOS
IncludeOS copied to clipboard
cookie_test unit test case fails on macOS Sierra
On macOS Sierra, the cookie_test unit test, in the "CookieException thrown when creating Cookie with invalid Expires option" case, the following test assertion (on line 329) fails:
EXPECT_THROWS( (Cookie{"name", "value", {"Expires", "Sun Nov 6 08:49:37"}}) );
The lest test runner reports:
failed: didn't get exception: CookieException thrown when creating Cookie with invalid Expires option: (Cookie{"name", "value", {"Expires", "Sun Nov 6 08:49:37"}})
The test passes (gets the expected exception) on OS X El Capitan, Ubuntu 16.04 (both x86 and arm).
Using the following simplified test program:
#include <stdio.h>
#define __USE_XOPEN
#include <time.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
struct tm tm;
if (strptime("Sun Nov 6 08:49:37", "%a, %d %b %Y %H:%M:%S %Z", &tm) == NULL) {
printf ("1 failed as expected\n");
if (strptime("Sun Nov 6 08:49:37", "%a, %d-%b-%y %H:%M:%S %Z", &tm) == NULL) {
printf("2 failed as expected\n");
if (strptime("Sun Nov 6 08:49:37", "%a %b %d %H:%M:%S %Y", &tm) == NULL) {
printf("All failed as expected\n");
exit(1);
}
}
}
printf("tm_sec: %d\n", tm.tm_sec);
printf("tm_min: %d\n", tm.tm_min);
printf("tm_hour: %d\n", tm.tm_hour);
printf("tm_mday: %d\n", tm.tm_mday);
printf("tm_mon: %d\n", tm.tm_mon);
printf("tm_year: %d\n", tm.tm_year);
printf("tm_wday: %d\n", tm.tm_wday);
printf("tm_yday: %d\n", tm.tm_yday);
printf("tm_isdst: %d\n", tm.tm_isdst);
}
gives the following results:
On OS X El Capitan, Ubuntu 16.04 (x86), Ubuntu 16.04 (arm):
$ clang strptime.c && ./a.out
1 failed as expected
2 failed as expected
All failed as expected
On macOS Sierra:
clang strptime.c && ./a.out
1 failed as expected
2 failed as expected
tm_sec: 37
tm_min: 49
tm_hour: 8
tm_mday: 6
tm_mon: 10
tm_year: 0
tm_wday: 0
tm_yday: 0
tm_isdst: 0
Is this fixed?
No. Still failing on macOS Sierra (version 10.12.5 (16F73))