Skip to content
Snippets Groups Projects
Commit 833254fb authored by Fred Wright's avatar Fred Wright Committed by Christopher Nielsen
Browse files

Fix realpath_nonext for 10.15.

This excludes testing the non-POSIX version on 10.15, which has a bug
(Apple's).

Also reverses order of nonposix cases, for consistency, and expands
the comment.

TESTED:
Now passes on all platforms.
parent ca62f3ea
Branches
No related tags found
No related merge requests found
...@@ -2,6 +2,39 @@ ...@@ -2,6 +2,39 @@
* Version of test_realpath with Darwin extensions disabled. * Version of test_realpath with Darwin extensions disabled.
*/ */
/*
* NOTE: This version of realpath() is completely broken on 10.15.
* This is not the fault of legacy-support, since we don't currently modify
* the OS realpath() behavior on 10.6+. Unless and until we provide a fix
* for that OS bug, we need to carve out an exemption in this test for 10.15,
* to avoid an undeserved test failure.
*
* For simplicity, the OS version test is based on the build-target version
* rather than checking the actual version at runtime. This means that
* running this test on a different OS version than the one it was built
* for may not have the desired result.
*/
#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) \
&& __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 101500 \
&& __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 110000
#include <libgen.h>
#include <stdio.h>
int
main(int argc, char *argv[])
{
(void) argc;
printf("%s is being skipped on 10.15 due to OS brokenness.\n",
basename(argv[0]));
return 0;
}
#else /* Not 10.15 */
#define _POSIX_C_SOURCE 200112L #define _POSIX_C_SOURCE 200112L
#include "test_realpath.c" #include "test_realpath.c"
#endif /* Not 10.15 */
/* /*
* Version of test_realpath with non-POSIX semantics (32-bit only). * Version of test_realpath with non-POSIX semantics (32-bit only).
*
* Attempting a 64-bit build with _NONSTD_SOURCE results in an error.
*/ */
#if !defined(__LP64__) || !__LP64__ #if defined(__LP64__) && __LP64__
#define _NONSTD_SOURCE
#include "test_realpath.c"
#else
#include <libgen.h> #include <libgen.h>
#include <stdio.h> #include <stdio.h>
...@@ -20,4 +17,9 @@ main(int argc, char *argv[]) ...@@ -20,4 +17,9 @@ main(int argc, char *argv[])
return 0; return 0;
} }
#endif #else /* 32-bit */
#define _NONSTD_SOURCE
#include "test_realpath.c"
#endif /* 32-bit */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment