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

test_fdopendir: Add versions with 32/64-bit inodes.

This ensures that both 32- and 64-bit inode cases are tested,
regardless of the platform default.

TESTED:
Pass (except known ino32 bug) on all platforms, with all applicable
SDKs.
parent 13d13438
Branches
No related tags found
No related merge requests found
......@@ -169,6 +169,9 @@ TESTSYSRUNS := $(patsubst \
REALPATHSRCS_C := $(wildcard $(TESTNAMEPREFIX)realpath*.c)
REALPATHRUNS := $(patsubst \
$(TESTNAMEPREFIX)%.c,$(TESTRUNPREFIX)%,$(REALPATHSRCS_C))
FDOPENDIRSRCS_C := $(wildcard $(TESTNAMEPREFIX)fdopendir*.c)
FDOPENDIRRUNS := $(patsubst \
$(TESTNAMEPREFIX)%.c,$(TESTRUNPREFIX)%,$(FDOPENDIRSRCS_C))
# Tests that are only run manually
MANTESTDIR = manual_tests
......@@ -475,6 +478,10 @@ $(TESTNAMEPREFIX)realpath_nonext.o: $(TESTNAMEPREFIX)realpath.c
$(TESTNAMEPREFIX)realpath_nonposix.o: $(TESTNAMEPREFIX)realpath.c
$(TESTNAMEPREFIX)realpath_compat.o: $(TESTNAMEPREFIX)realpath.c
# The fdopendir_ino?? tests include the fdopendir source
$(TESTNAMEPREFIX)fdopendir_ino32.o: $(TESTNAMEPREFIX)fdopendir.c
$(TESTNAMEPREFIX)fdopendir_ino64.o: $(TESTNAMEPREFIX)fdopendir.c
# Provide a target for all "darwin_c" tests
$(XTESTRUNPREFIX)darwin_c_all: $(DARWINRUNS)
......@@ -484,6 +491,9 @@ $(XTESTRUNPREFIX)scandir_all: $(SCANDIRRUNS)
# Provide a target for all "realpath" tests
$(TESTRUNPREFIX)realpath_all: $(REALPATHRUNS)
# Provide a target for all "fdopendir" tests
$(TESTRUNPREFIX)fdopendir_all: $(FDOPENDIRRUNS)
$(MANTESTRUNS): $(MANRUNPREFIX)%: $(MANTESTPREFIX)%
$< $(TEST_ARGS)
......@@ -544,6 +554,7 @@ clean: $(MANRUNPREFIX)clean test_clean
.PHONY: $(TESTRUNS) $(XTESTRUNS) $(MANTESTRUNS)
.PHONY: $(MANRUNPREFIX)clean test_clean xtest_clean
.PHONY: $(XTESTRUNPREFIX)scandir_all
.PHONY: $(TESTRUNPREFIX)fdopendir_all
.PHONY: install install-headers install-lib install-dlib install-slib
.PHONY: tiger-bins install-tiger
.PHONY: allobjs dlibobjs slibobjs syslibobjs
/*
* Version of test_fdopendir with 32-bit inodes (if possible).
*
* This doesn't work on arm64.
*/
#if defined(__arm64__) && __arm64__
#include <libgen.h>
#include <stdio.h>
int
main(int argc, char *argv[])
{
(void) argc;
printf("%s doesn't work on arm64.\n", basename(argv[0]));
return 0;
}
#else /* !arm64 */
#define _DARWIN_NO_64_BIT_INODE 1
#include "test_fdopendir.c"
#endif /* !arm64 */
/*
* Version of test_fdopendir with 64-bit inodes (if possible).
*
* This is primarily for 10.5, where 64-bit inodes are supported
* but not the default.
*
* Currently, 64-bit inodes don't work on 10.4. Although requesting
* 64-bit inode support is ignored by the 10.4 SDK, it can work when
* building with a 10.5+ SDK, so we explicitly disable it here.
*/
#if !defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) \
|| __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1050
#include <libgen.h>
#include <stdio.h>
int
main(int argc, char *argv[])
{
(void) argc;
printf("%s doesn't work on 10.4.\n", basename(argv[0]));
return 0;
}
#else /* >= 10.5 */
#define _DARWIN_USE_64_BIT_INODE 1
#include "test_fdopendir.c"
#endif /* >= 10.5 */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment