summaryrefslogtreecommitdiff
path: root/srclib/apr/test
diff options
context:
space:
mode:
Diffstat (limited to 'srclib/apr/test')
-rw-r--r--srclib/apr/test/NWGNUaprtest41
-rw-r--r--srclib/apr/test/NWGNUechod8
-rw-r--r--srclib/apr/test/NWGNUglobalmutexchild31
-rw-r--r--srclib/apr/test/NWGNUmakefile8
-rw-r--r--srclib/apr/test/NWGNUmod_test31
-rw-r--r--srclib/apr/test/NWGNUproc_child31
-rw-r--r--srclib/apr/test/NWGNUreadchild31
-rw-r--r--srclib/apr/test/NWGNUsockchild31
-rw-r--r--srclib/apr/test/NWGNUsockperf8
-rw-r--r--srclib/apr/test/NWGNUtestatmc34
-rw-r--r--srclib/apr/test/NWGNUtryread35
-rw-r--r--srclib/apr/test/nw_misc.c3
-rw-r--r--srclib/apr/test/sendfile.c4
-rw-r--r--srclib/apr/test/testdir.c2
-rw-r--r--srclib/apr/test/testdup.c16
-rw-r--r--srclib/apr/test/testfile.c78
-rw-r--r--srclib/apr/test/testfileinfo.c12
-rw-r--r--srclib/apr/test/testflock.c2
-rw-r--r--srclib/apr/test/testfnmatch.c180
-rw-r--r--srclib/apr/test/testmmap.c2
-rw-r--r--srclib/apr/test/testnames.c44
-rw-r--r--srclib/apr/test/testpoll.c64
-rw-r--r--srclib/apr/test/testproc.c6
-rw-r--r--srclib/apr/test/testrand.c2
-rw-r--r--srclib/apr/test/testshm.c2
-rw-r--r--srclib/apr/test/testsock.c44
-rw-r--r--srclib/apr/test/tryread.c2
27 files changed, 532 insertions, 220 deletions
diff --git a/srclib/apr/test/NWGNUaprtest b/srclib/apr/test/NWGNUaprtest
index 0c7f8c75..b142796a 100644
--- a/srclib/apr/test/NWGNUaprtest
+++ b/srclib/apr/test/NWGNUaprtest
@@ -8,7 +8,7 @@
#
ifndef EnvironmentDefined
-include $(APR_WORK)\build\NWGNUhead.inc
+include $(APR_WORK)/build/NWGNUhead.inc
endif
#
@@ -89,18 +89,18 @@ endif
# This is used by the link 'name' directive to name the nlm. If left blank
# TARGET_nlm (see below) will be used.
#
-NLM_NAME =aprtest
+NLM_NAME = aprtest
#
# This is used by the link '-desc ' directive.
# If left blank, NLM_NAME will be used.
#
-NLM_DESCRIPTION = NLM is to test the apr layer
+NLM_DESCRIPTION = NLM is to test the apr layer
#
# This is used by the '-threadname' directive. If left blank,
# NLM_NAME Thread will be used.
#
-NLM_THREAD_NAME = aprtest
+NLM_THREAD_NAME = $(NLM_NAME)
#
# This is used by the '-screenname' directive. If left blank,
@@ -110,24 +110,24 @@ NLM_SCREEN_NAME = aprtest
#
# If this is specified, it will override VERSION value in
-# $(APR_WORK)\build\NWGNUenvironment.inc
+# $(APR_WORK)/build/NWGNUenvironment.inc
#
-NLM_VERSION = 1,0,0
+NLM_VERSION =
#
# If this is specified, it will override the default of 64K
#
-NLM_STACK_SIZE = 524288
+NLM_STACK_SIZE = 524288
#
# If this is specified it will be used by the link '-entry' directive
#
-NLM_ENTRY_SYM = _LibCPrelude
+NLM_ENTRY_SYM =
#
# If this is specified it will be used by the link '-exit' directive
#
-NLM_EXIT_SYM = _LibCPostlude
+NLM_EXIT_SYM =
#
# If this is specified it will be used by the link '-check' directive
@@ -137,14 +137,14 @@ NLM_CHECK_SYM =
#
# If this is specified it will be used by the link '-flags' directive
#
-NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION
+NLM_FLAGS =
#
# If this is specified it will be linked in with the XDCData option in the def
# file instead of the default of $(APR)/misc/netware/apache.xdc. XDCData can
# be disabled by setting APACHE_UNIPROC in the environment
#
-XDCDATA =
+XDCDATA =
#
# Declare all target files (you must add your files here)
@@ -223,7 +223,7 @@ FILES_nlm_objs = \
# These will be added as a library command in the link.opt file.
#
FILES_nlm_libs = \
- libcpre.o \
+ $(PRELUDE) \
$(EOLIST)
#
@@ -255,15 +255,21 @@ FILE_nlm_copyright =
#
FILES_nlm_Ximports = \
@libc.imp \
- @$(APR)/aprlib.imp \
+ @aprlib.imp \
$(EOLIST)
-
+
+# Don't link with Winsock if standard sockets are being used
+ifndef USE_STDSOCKETS
+FILES_nlm_Ximports += @ws2nlm.imp \
+ $(EOLIST)
+endif
+
#
# Any symbols exported to here
#
FILES_nlm_exports = \
$(EOLIST)
-
+
#
# These are the OBJ files needed to create the LIB target above.
# Paths must all use the '/' character
@@ -281,7 +287,7 @@ nlms :: libs $(TARGET_nlm)
#
# Updated this target to create necessary directories and copy files to the
-# correct place. (See $(APR_WORK)\build\NWGNUhead.inc for examples)
+# correct place. (See $(APR_WORK)/build/NWGNUhead.inc for examples)
#
install :: nlms FORCE
@@ -295,6 +301,5 @@ install :: nlms FORCE
# in this makefile
#
-include $(APR_WORK)\build\NWGNUtail.inc
-
+include $(APRBUILD)/NWGNUtail.inc
diff --git a/srclib/apr/test/NWGNUechod b/srclib/apr/test/NWGNUechod
index 45b00c77..f70a53d7 100644
--- a/srclib/apr/test/NWGNUechod
+++ b/srclib/apr/test/NWGNUechod
@@ -123,12 +123,12 @@ NLM_STACK_SIZE =
#
# If this is specified it will be used by the link '-entry' directive
#
-NLM_ENTRY_SYM = _LibCPrelude
+NLM_ENTRY_SYM =
#
# If this is specified it will be used by the link '-exit' directive
#
-NLM_EXIT_SYM = _LibCPostlude
+NLM_EXIT_SYM =
#
# If this is specified it will be used by the link '-check' directive
@@ -178,7 +178,7 @@ FILES_nlm_objs = \
# These will be added as a library command in the link.opt file.
#
FILES_nlm_libs = \
- libcpre.o \
+ $(PRELUDE) \
$(EOLIST)
#
@@ -209,7 +209,7 @@ FILE_nlm_copyright =
# Any additional imports go here
#
FILES_nlm_Ximports = \
- @$(APR)/aprlib.imp \
+ @aprlib.imp \
@libc.imp \
$(EOLIST)
diff --git a/srclib/apr/test/NWGNUglobalmutexchild b/srclib/apr/test/NWGNUglobalmutexchild
index 3d683bab..3db7a106 100644
--- a/srclib/apr/test/NWGNUglobalmutexchild
+++ b/srclib/apr/test/NWGNUglobalmutexchild
@@ -8,7 +8,7 @@
#
ifndef EnvironmentDefined
-include $(APR_WORK)\build\NWGNUhead.inc
+include $(APR_WORK)/build/NWGNUhead.inc
endif
#
@@ -54,7 +54,6 @@ XDEFINES += \
XLFLAGS += \
$(EOLIST)
-
endif
ifeq "$(RELEASE)" "noopt"
@@ -69,8 +68,6 @@ XDEFINES += \
XLFLAGS += \
$(EOLIST)
-
- $(EOLIST)
endif
ifeq "$(RELEASE)" "release"
@@ -92,7 +89,7 @@ endif
# This is used by the link 'name' directive to name the nlm. If left blank
# TARGET_nlm (see below) will be used.
#
-NLM_NAME = globalmutexchild
+NLM_NAME = globalmutexchild
#
# This is used by the link '-desc ' directive.
@@ -104,7 +101,7 @@ NLM_DESCRIPTION = child NLM to test the global Mutex layer
# This is used by the '-threadname' directive. If left blank,
# NLM_NAME Thread will be used.
#
-NLM_THREAD_NAME = globalmutexchild
+NLM_THREAD_NAME = $(NLM_NAME)
#
# This is used by the '-screenname' directive. If left blank,
@@ -114,9 +111,9 @@ NLM_SCREEN_NAME = DEFAULT
#
# If this is specified, it will override VERSION value in
-# $(APR_WORK)\build\NWGNUenvironment.inc
+# $(APR_WORK)/build/NWGNUenvironment.inc
#
-NLM_VERSION = 1,0,0
+NLM_VERSION =
#
# If this is specified, it will override the default of 64K
@@ -126,12 +123,12 @@ NLM_STACK_SIZE =
#
# If this is specified it will be used by the link '-entry' directive
#
-NLM_ENTRY_SYM = _LibCPrelude
+NLM_ENTRY_SYM =
#
# If this is specified it will be used by the link '-exit' directive
#
-NLM_EXIT_SYM = _LibCPostlude
+NLM_EXIT_SYM =
#
# If this is specified it will be used by the link '-check' directive
@@ -141,14 +138,14 @@ NLM_CHECK_SYM =
#
# If this is specified it will be used by the link '-flags' directive
#
-NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION, MULTIPLE
+NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION, MULTIPLE
#
# If this is specified it will be linked in with the XDCData option in the def
# file instead of the default of $(APR)/misc/netware/apache.xdc. XDCData can
# be disabled by setting APACHE_UNIPROC in the environment
#
-XDCDATA =
+XDCDATA =
#
# Declare all target files (you must add your files here)
@@ -180,7 +177,7 @@ FILES_nlm_objs = \
# These will be added as a library command in the link.opt file.
#
FILES_nlm_libs = \
- libcpre.o \
+ $(PRELUDE) \
$(EOLIST)
#
@@ -211,7 +208,7 @@ FILE_nlm_copyright =
# Any additional imports go here
#
FILES_nlm_Ximports = \
- @$(APR)/aprlib.imp \
+ @aprlib.imp \
@libc.imp \
$(EOLIST)
@@ -220,7 +217,7 @@ FILES_nlm_Ximports = \
#
FILES_nlm_exports = \
$(EOLIST)
-
+
#
# These are the OBJ files needed to create the LIB target above.
# Paths must all use the '/' character
@@ -238,7 +235,7 @@ nlms :: libs $(TARGET_nlm)
#
# Updated this target to create necessary directories and copy files to the
-# correct place. (See $(APR_WORK)\build\NWGNUhead.inc for examples)
+# correct place. (See $(APR_WORK)/build/NWGNUhead.inc for examples)
#
install :: nlms FORCE
@@ -251,5 +248,5 @@ install :: nlms FORCE
# in this makefile
#
-include $(APR_WORK)\build\NWGNUtail.inc
+include $(APRBUILD)/NWGNUtail.inc
diff --git a/srclib/apr/test/NWGNUmakefile b/srclib/apr/test/NWGNUmakefile
index d2f8b0ce..b9ebfaf2 100644
--- a/srclib/apr/test/NWGNUmakefile
+++ b/srclib/apr/test/NWGNUmakefile
@@ -10,7 +10,7 @@ SUBDIRS = \
# paths to tools
#
-include $(APR_WORK)\build\NWGNUhead.inc
+include $(APR_WORK)/build/NWGNUhead.inc
#
# build this level's files
@@ -41,10 +41,10 @@ nlms :: libs $(TARGET_nlm)
#
# Updated this target to create necessary directories and copy files to the
-# correct place. (See $(APR_WORK)\build\NWGNUhead.inc for examples)
+# correct place. (See $(APR_WORK)/build/NWGNUhead.inc for examples)
#
install :: nlms FORCE
- copy $(OBJDIR)\*.nlm $(INSTALLBASE)
+ $(call COPY,$(OBJDIR)/*.nlm,$(INSTALLBASE))
#
# Any specialized rules here
@@ -55,5 +55,5 @@ install :: nlms FORCE
# in this makefile
#
-include $(APR_WORK)\build\NWGNUtail.inc
+include $(APRBUILD)/NWGNUtail.inc
diff --git a/srclib/apr/test/NWGNUmod_test b/srclib/apr/test/NWGNUmod_test
index 3dfa6df4..b293de88 100644
--- a/srclib/apr/test/NWGNUmod_test
+++ b/srclib/apr/test/NWGNUmod_test
@@ -8,7 +8,7 @@
#
ifndef EnvironmentDefined
-include $(APR_WORK)\build\NWGNUhead.inc
+include $(APR_WORK)/build/NWGNUhead.inc
endif
#
@@ -54,7 +54,6 @@ XDEFINES += \
XLFLAGS += \
$(EOLIST)
-
endif
ifeq "$(RELEASE)" "noopt"
@@ -69,8 +68,6 @@ XDEFINES += \
XLFLAGS += \
$(EOLIST)
-
- $(EOLIST)
endif
ifeq "$(RELEASE)" "release"
@@ -92,7 +89,7 @@ endif
# This is used by the link 'name' directive to name the nlm. If left blank
# TARGET_nlm (see below) will be used.
#
-NLM_NAME = mod_test
+NLM_NAME = mod_test
#
# This is used by the link '-desc ' directive.
@@ -104,7 +101,7 @@ NLM_DESCRIPTION = DSO NLM to test the apr DSO loading layer
# This is used by the '-threadname' directive. If left blank,
# NLM_NAME Thread will be used.
#
-NLM_THREAD_NAME = mod_test
+NLM_THREAD_NAME = $(NLM_NAME)
#
# This is used by the '-screenname' directive. If left blank,
@@ -114,9 +111,9 @@ NLM_SCREEN_NAME = DEFAULT
#
# If this is specified, it will override VERSION value in
-# $(APR_WORK)\build\NWGNUenvironment.inc
+# $(APR_WORK)/build/NWGNUenvironment.inc
#
-NLM_VERSION = 1,0,0
+NLM_VERSION =
#
# If this is specified, it will override the default of 64K
@@ -126,12 +123,12 @@ NLM_STACK_SIZE =
#
# If this is specified it will be used by the link '-entry' directive
#
-NLM_ENTRY_SYM = _LibCPrelude
+NLM_ENTRY_SYM =
#
# If this is specified it will be used by the link '-exit' directive
#
-NLM_EXIT_SYM = _LibCPostlude
+NLM_EXIT_SYM =
#
# If this is specified it will be used by the link '-check' directive
@@ -141,14 +138,14 @@ NLM_CHECK_SYM =
#
# If this is specified it will be used by the link '-flags' directive
#
-NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION
+NLM_FLAGS =
#
# If this is specified it will be linked in with the XDCData option in the def
# file instead of the default of $(APR)/misc/netware/apache.xdc. XDCData can
# be disabled by setting APACHE_UNIPROC in the environment
#
-XDCDATA =
+XDCDATA =
#
# Declare all target files (you must add your files here)
@@ -180,7 +177,7 @@ FILES_nlm_objs = \
# These will be added as a library command in the link.opt file.
#
FILES_nlm_libs = \
- libcpre.o \
+ $(PRELUDE) \
$(EOLIST)
#
@@ -211,7 +208,7 @@ FILE_nlm_copyright =
# Any additional imports go here
#
FILES_nlm_Ximports = \
- @$(APR)/aprlib.imp \
+ @aprlib.imp \
@libc.imp \
$(EOLIST)
@@ -222,7 +219,7 @@ FILES_nlm_exports = \
print_hello \
count_reps \
$(EOLIST)
-
+
#
# These are the OBJ files needed to create the LIB target above.
# Paths must all use the '/' character
@@ -240,7 +237,7 @@ nlms :: libs $(TARGET_nlm)
#
# Updated this target to create necessary directories and copy files to the
-# correct place. (See $(APR_WORK)\build\NWGNUhead.inc for examples)
+# correct place. (See $(APR_WORK)/build/NWGNUhead.inc for examples)
#
install :: nlms FORCE
@@ -253,5 +250,5 @@ install :: nlms FORCE
# in this makefile
#
-include $(APR_WORK)\build\NWGNUtail.inc
+include $(APRBUILD)/NWGNUtail.inc
diff --git a/srclib/apr/test/NWGNUproc_child b/srclib/apr/test/NWGNUproc_child
index 49c1fab6..4f3f183c 100644
--- a/srclib/apr/test/NWGNUproc_child
+++ b/srclib/apr/test/NWGNUproc_child
@@ -8,7 +8,7 @@
#
ifndef EnvironmentDefined
-include $(APR_WORK)\build\NWGNUhead.inc
+include $(APR_WORK)/build/NWGNUhead.inc
endif
#
@@ -54,7 +54,6 @@ XDEFINES += \
XLFLAGS += \
$(EOLIST)
-
endif
ifeq "$(RELEASE)" "noopt"
@@ -69,8 +68,6 @@ XDEFINES += \
XLFLAGS += \
$(EOLIST)
-
- $(EOLIST)
endif
ifeq "$(RELEASE)" "release"
@@ -92,7 +89,7 @@ endif
# This is used by the link 'name' directive to name the nlm. If left blank
# TARGET_nlm (see below) will be used.
#
-NLM_NAME = proc_child
+NLM_NAME = proc_child
#
# This is used by the link '-desc ' directive.
@@ -104,7 +101,7 @@ NLM_DESCRIPTION = child NLM to test the proc layer
# This is used by the '-threadname' directive. If left blank,
# NLM_NAME Thread will be used.
#
-NLM_THREAD_NAME = proc_child
+NLM_THREAD_NAME = $(NLM_NAME)
#
# This is used by the '-screenname' directive. If left blank,
@@ -114,9 +111,9 @@ NLM_SCREEN_NAME = DEFAULT
#
# If this is specified, it will override VERSION value in
-# $(APR_WORK)\build\NWGNUenvironment.inc
+# $(APR_WORK)/build/NWGNUenvironment.inc
#
-NLM_VERSION = 1,0,0
+NLM_VERSION =
#
# If this is specified, it will override the default of 64K
@@ -126,12 +123,12 @@ NLM_STACK_SIZE =
#
# If this is specified it will be used by the link '-entry' directive
#
-NLM_ENTRY_SYM = _LibCPrelude
+NLM_ENTRY_SYM =
#
# If this is specified it will be used by the link '-exit' directive
#
-NLM_EXIT_SYM = _LibCPostlude
+NLM_EXIT_SYM =
#
# If this is specified it will be used by the link '-check' directive
@@ -141,14 +138,14 @@ NLM_CHECK_SYM =
#
# If this is specified it will be used by the link '-flags' directive
#
-NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION, MULTIPLE
+NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION, MULTIPLE
#
# If this is specified it will be linked in with the XDCData option in the def
# file instead of the default of $(APR)/misc/netware/apache.xdc. XDCData can
# be disabled by setting APACHE_UNIPROC in the environment
#
-XDCDATA =
+XDCDATA =
#
# Declare all target files (you must add your files here)
@@ -180,7 +177,7 @@ FILES_nlm_objs = \
# These will be added as a library command in the link.opt file.
#
FILES_nlm_libs = \
- libcpre.o \
+ $(PRELUDE) \
$(EOLIST)
#
@@ -211,7 +208,7 @@ FILE_nlm_copyright =
# Any additional imports go here
#
FILES_nlm_Ximports = \
- @$(APR)/aprlib.imp \
+ @aprlib.imp \
@libc.imp \
$(EOLIST)
@@ -220,7 +217,7 @@ FILES_nlm_Ximports = \
#
FILES_nlm_exports = \
$(EOLIST)
-
+
#
# These are the OBJ files needed to create the LIB target above.
# Paths must all use the '/' character
@@ -238,7 +235,7 @@ nlms :: libs $(TARGET_nlm)
#
# Updated this target to create necessary directories and copy files to the
-# correct place. (See $(APR_WORK)\build\NWGNUhead.inc for examples)
+# correct place. (See $(APR_WORK)/build/NWGNUhead.inc for examples)
#
install :: nlms FORCE
@@ -251,5 +248,5 @@ install :: nlms FORCE
# in this makefile
#
-include $(APR_WORK)\build\NWGNUtail.inc
+include $(APRBUILD)/NWGNUtail.inc
diff --git a/srclib/apr/test/NWGNUreadchild b/srclib/apr/test/NWGNUreadchild
index 0fd984da..5e6e4848 100644
--- a/srclib/apr/test/NWGNUreadchild
+++ b/srclib/apr/test/NWGNUreadchild
@@ -8,7 +8,7 @@
#
ifndef EnvironmentDefined
-include $(APR_WORK)\build\NWGNUhead.inc
+include $(APR_WORK)/build/NWGNUhead.inc
endif
#
@@ -54,7 +54,6 @@ XDEFINES += \
XLFLAGS += \
$(EOLIST)
-
endif
ifeq "$(RELEASE)" "noopt"
@@ -69,8 +68,6 @@ XDEFINES += \
XLFLAGS += \
$(EOLIST)
-
- $(EOLIST)
endif
ifeq "$(RELEASE)" "release"
@@ -92,7 +89,7 @@ endif
# This is used by the link 'name' directive to name the nlm. If left blank
# TARGET_nlm (see below) will be used.
#
-NLM_NAME = readchild
+NLM_NAME = readchild
#
# This is used by the link '-desc ' directive.
@@ -104,7 +101,7 @@ NLM_DESCRIPTION = child NLM to test the pipe layer
# This is used by the '-threadname' directive. If left blank,
# NLM_NAME Thread will be used.
#
-NLM_THREAD_NAME = readchild
+NLM_THREAD_NAME = $(NLM_NAME)
#
# This is used by the '-screenname' directive. If left blank,
@@ -114,9 +111,9 @@ NLM_SCREEN_NAME = DEFAULT
#
# If this is specified, it will override VERSION value in
-# $(APR_WORK)\build\NWGNUenvironment.inc
+# $(APR_WORK)/build/NWGNUenvironment.inc
#
-NLM_VERSION = 1,0,0
+NLM_VERSION =
#
# If this is specified, it will override the default of 64K
@@ -126,12 +123,12 @@ NLM_STACK_SIZE =
#
# If this is specified it will be used by the link '-entry' directive
#
-NLM_ENTRY_SYM = _LibCPrelude
+NLM_ENTRY_SYM =
#
# If this is specified it will be used by the link '-exit' directive
#
-NLM_EXIT_SYM = _LibCPostlude
+NLM_EXIT_SYM =
#
# If this is specified it will be used by the link '-check' directive
@@ -141,14 +138,14 @@ NLM_CHECK_SYM =
#
# If this is specified it will be used by the link '-flags' directive
#
-NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION, MULTIPLE
+NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION, MULTIPLE
#
# If this is specified it will be linked in with the XDCData option in the def
# file instead of the default of $(APR)/misc/netware/apache.xdc. XDCData can
# be disabled by setting APACHE_UNIPROC in the environment
#
-XDCDATA =
+XDCDATA =
#
# Declare all target files (you must add your files here)
@@ -180,7 +177,7 @@ FILES_nlm_objs = \
# These will be added as a library command in the link.opt file.
#
FILES_nlm_libs = \
- libcpre.o \
+ $(PRELUDE) \
$(EOLIST)
#
@@ -211,7 +208,7 @@ FILE_nlm_copyright =
# Any additional imports go here
#
FILES_nlm_Ximports = \
- @$(APR)/aprlib.imp \
+ @aprlib.imp \
@libc.imp \
$(EOLIST)
@@ -220,7 +217,7 @@ FILES_nlm_Ximports = \
#
FILES_nlm_exports = \
$(EOLIST)
-
+
#
# These are the OBJ files needed to create the LIB target above.
# Paths must all use the '/' character
@@ -238,7 +235,7 @@ nlms :: libs $(TARGET_nlm)
#
# Updated this target to create necessary directories and copy files to the
-# correct place. (See $(APR_WORK)\build\NWGNUhead.inc for examples)
+# correct place. (See $(APR_WORK)/build/NWGNUhead.inc for examples)
#
install :: nlms FORCE
@@ -251,5 +248,5 @@ install :: nlms FORCE
# in this makefile
#
-include $(APR_WORK)\build\NWGNUtail.inc
+include $(APRBUILD)/NWGNUtail.inc
diff --git a/srclib/apr/test/NWGNUsockchild b/srclib/apr/test/NWGNUsockchild
index 16dac9e4..312ddd1f 100644
--- a/srclib/apr/test/NWGNUsockchild
+++ b/srclib/apr/test/NWGNUsockchild
@@ -8,7 +8,7 @@
#
ifndef EnvironmentDefined
-include $(APR_WORK)\build\NWGNUhead.inc
+include $(APR_WORK)/build/NWGNUhead.inc
endif
#
@@ -54,7 +54,6 @@ XDEFINES += \
XLFLAGS += \
$(EOLIST)
-
endif
ifeq "$(RELEASE)" "noopt"
@@ -69,8 +68,6 @@ XDEFINES += \
XLFLAGS += \
$(EOLIST)
-
- $(EOLIST)
endif
ifeq "$(RELEASE)" "release"
@@ -92,7 +89,7 @@ endif
# This is used by the link 'name' directive to name the nlm. If left blank
# TARGET_nlm (see below) will be used.
#
-NLM_NAME = sockchild
+NLM_NAME = sockchild
#
# This is used by the link '-desc ' directive.
@@ -104,7 +101,7 @@ NLM_DESCRIPTION = socket NLM to test sockets
# This is used by the '-threadname' directive. If left blank,
# NLM_NAME Thread will be used.
#
-NLM_THREAD_NAME = sockchild
+NLM_THREAD_NAME = $(NLM_NAME)
#
# This is used by the '-screenname' directive. If left blank,
@@ -114,9 +111,9 @@ NLM_SCREEN_NAME = DEFAULT
#
# If this is specified, it will override VERSION value in
-# $(APR_WORK)\build\NWGNUenvironment.inc
+# $(APR_WORK)/build/NWGNUenvironment.inc
#
-NLM_VERSION = 1,0,0
+NLM_VERSION =
#
# If this is specified, it will override the default of 64K
@@ -126,12 +123,12 @@ NLM_STACK_SIZE =
#
# If this is specified it will be used by the link '-entry' directive
#
-NLM_ENTRY_SYM = _LibCPrelude
+NLM_ENTRY_SYM =
#
# If this is specified it will be used by the link '-exit' directive
#
-NLM_EXIT_SYM = _LibCPostlude
+NLM_EXIT_SYM =
#
# If this is specified it will be used by the link '-check' directive
@@ -141,14 +138,14 @@ NLM_CHECK_SYM =
#
# If this is specified it will be used by the link '-flags' directive
#
-NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION, MULTIPLE
+NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION, MULTIPLE
#
# If this is specified it will be linked in with the XDCData option in the def
# file instead of the default of $(APR)/misc/netware/apache.xdc. XDCData can
# be disabled by setting APACHE_UNIPROC in the environment
#
-XDCDATA =
+XDCDATA =
#
# Declare all target files (you must add your files here)
@@ -180,7 +177,7 @@ FILES_nlm_objs = \
# These will be added as a library command in the link.opt file.
#
FILES_nlm_libs = \
- libcpre.o \
+ $(PRELUDE) \
$(EOLIST)
#
@@ -211,7 +208,7 @@ FILE_nlm_copyright =
# Any additional imports go here
#
FILES_nlm_Ximports = \
- @$(APR)/aprlib.imp \
+ @aprlib.imp \
@libc.imp \
$(EOLIST)
@@ -220,7 +217,7 @@ FILES_nlm_Ximports = \
#
FILES_nlm_exports = \
$(EOLIST)
-
+
#
# These are the OBJ files needed to create the LIB target above.
# Paths must all use the '/' character
@@ -238,7 +235,7 @@ nlms :: libs $(TARGET_nlm)
#
# Updated this target to create necessary directories and copy files to the
-# correct place. (See $(APR_WORK)\build\NWGNUhead.inc for examples)
+# correct place. (See $(APR_WORK)/build/NWGNUhead.inc for examples)
#
install :: nlms FORCE
@@ -251,5 +248,5 @@ install :: nlms FORCE
# in this makefile
#
-include $(APR_WORK)\build\NWGNUtail.inc
+include $(APRBUILD)/NWGNUtail.inc
diff --git a/srclib/apr/test/NWGNUsockperf b/srclib/apr/test/NWGNUsockperf
index c2d5f7d8..f289d874 100644
--- a/srclib/apr/test/NWGNUsockperf
+++ b/srclib/apr/test/NWGNUsockperf
@@ -123,12 +123,12 @@ NLM_STACK_SIZE =
#
# If this is specified it will be used by the link '-entry' directive
#
-NLM_ENTRY_SYM = _LibCPrelude
+NLM_ENTRY_SYM =
#
# If this is specified it will be used by the link '-exit' directive
#
-NLM_EXIT_SYM = _LibCPostlude
+NLM_EXIT_SYM =
#
# If this is specified it will be used by the link '-check' directive
@@ -178,7 +178,7 @@ FILES_nlm_objs = \
# These will be added as a library command in the link.opt file.
#
FILES_nlm_libs = \
- libcpre.o \
+ $(PRELUDE) \
$(EOLIST)
#
@@ -209,7 +209,7 @@ FILE_nlm_copyright =
# Any additional imports go here
#
FILES_nlm_Ximports = \
- @$(APR)/aprlib.imp \
+ @aprlib.imp \
@libc.imp \
$(EOLIST)
diff --git a/srclib/apr/test/NWGNUtestatmc b/srclib/apr/test/NWGNUtestatmc
index dbbe4250..d1308ea3 100644
--- a/srclib/apr/test/NWGNUtestatmc
+++ b/srclib/apr/test/NWGNUtestatmc
@@ -8,7 +8,7 @@
#
ifndef EnvironmentDefined
-include $(APR_WORK)\build\NWGNUhead.inc
+include $(APR_WORK)/build/NWGNUhead.inc
endif
#
@@ -89,30 +89,30 @@ endif
# This is used by the link 'name' directive to name the nlm. If left blank
# TARGET_nlm (see below) will be used.
#
-NLM_NAME =testatmc
+NLM_NAME = testatmc
#
# This is used by the link '-desc ' directive.
# If left blank, NLM_NAME will be used.
#
-NLM_DESCRIPTION = NLM is to test the atomic functions
+NLM_DESCRIPTION = NLM is to test the atomic functions
#
# This is used by the '-threadname' directive. If left blank,
# NLM_NAME Thread will be used.
#
-NLM_THREAD_NAME = testatmc
+NLM_THREAD_NAME = $(NLM_NAME)
#
# This is used by the '-screenname' directive. If left blank,
# 'Apache for NetWare' Thread will be used.
#
-NLM_SCREEN_NAME = testatmc
+NLM_SCREEN_NAME = $(NLM_NAME)
#
# If this is specified, it will override VERSION value in
-# $(APR_WORK)\build\NWGNUenvironment.inc
+# $(APR_WORK)/build/NWGNUenvironment.inc
#
-NLM_VERSION = 1,0,0
+NLM_VERSION =
#
# If this is specified, it will override the default of 64K
@@ -122,12 +122,12 @@ NLM_STACK_SIZE =
#
# If this is specified it will be used by the link '-entry' directive
#
-NLM_ENTRY_SYM = _LibCPrelude
+NLM_ENTRY_SYM =
#
# If this is specified it will be used by the link '-exit' directive
#
-NLM_EXIT_SYM = _LibCPostlude
+NLM_EXIT_SYM =
#
# If this is specified it will be used by the link '-check' directive
@@ -137,14 +137,14 @@ NLM_CHECK_SYM =
#
# If this is specified it will be used by the link '-flags' directive
#
-NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION
+NLM_FLAGS =
#
# If this is specified it will be linked in with the XDCData option in the def
# file instead of the default of $(APR)/misc/netware/apache.xdc. XDCData can
# be disabled by setting APACHE_UNIPROC in the environment
#
-XDCDATA =
+XDCDATA =
#
# Declare all target files (you must add your files here)
@@ -173,13 +173,13 @@ FILES_nlm_objs = \
$(EOLIST)
# Pending tests
-
+
#
# These are the LIB files needed to create the NLM target above.
# These will be added as a library command in the link.opt file.
#
FILES_nlm_libs = \
- libcpre.o \
+ $(PRELUDE) \
$(EOLIST)
#
@@ -211,7 +211,7 @@ FILE_nlm_copyright =
#
FILES_nlm_Ximports = \
@libc.imp \
- @$(APR)/aprlib.imp \
+ @aprlib.imp \
$(EOLIST)
#
@@ -219,7 +219,7 @@ FILES_nlm_Ximports = \
#
FILES_nlm_exports = \
$(EOLIST)
-
+
#
# These are the OBJ files needed to create the LIB target above.
# Paths must all use the '/' character
@@ -237,7 +237,7 @@ nlms :: libs $(TARGET_nlm)
#
# Updated this target to create necessary directories and copy files to the
-# correct place. (See $(APR_WORK)\build\NWGNUhead.inc for examples)
+# correct place. (See $(APR_WORK)/build/NWGNUhead.inc for examples)
#
install :: nlms FORCE
@@ -251,5 +251,5 @@ install :: nlms FORCE
# in this makefile
#
-include $(APR_WORK)\build\NWGNUtail.inc
+include $(APRBUILD)/NWGNUtail.inc
diff --git a/srclib/apr/test/NWGNUtryread b/srclib/apr/test/NWGNUtryread
index cc4aee02..0ed52ead 100644
--- a/srclib/apr/test/NWGNUtryread
+++ b/srclib/apr/test/NWGNUtryread
@@ -8,7 +8,7 @@
#
ifndef EnvironmentDefined
-include $(APR_WORK)\build\NWGNUhead.inc
+include $(APR_WORK)/build/NWGNUhead.inc
endif
#
@@ -54,7 +54,6 @@ XDEFINES += \
XLFLAGS += \
$(EOLIST)
-
endif
ifeq "$(RELEASE)" "noopt"
@@ -69,8 +68,6 @@ XDEFINES += \
XLFLAGS += \
$(EOLIST)
-
- $(EOLIST)
endif
ifeq "$(RELEASE)" "release"
@@ -92,31 +89,31 @@ endif
# This is used by the link 'name' directive to name the nlm. If left blank
# TARGET_nlm (see below) will be used.
#
-NLM_NAME = tryread
+NLM_NAME = tryread
#
# This is used by the link '-desc ' directive.
# If left blank, NLM_NAME will be used.
#
-NLM_DESCRIPTION = reader NLM to test flock
+NLM_DESCRIPTION = reader NLM to test flock
#
# This is used by the '-threadname' directive. If left blank,
# NLM_NAME Thread will be used.
#
-NLM_THREAD_NAME = try_read
+NLM_THREAD_NAME = $(NLM_NAME)
#
# This is used by the '-screenname' directive. If left blank,
# 'Apache for NetWare' Thread will be used.
#
-NLM_SCREEN_NAME = DEFAULT
+NLM_SCREEN_NAME = DEFAULT
#
# If this is specified, it will override VERSION value in
-# $(APR_WORK)\build\NWGNUenvironment.inc
+# $(APR_WORK)/build/NWGNUenvironment.inc
#
-NLM_VERSION = 1,0,0
+NLM_VERSION =
#
# If this is specified, it will override the default of 64K
@@ -126,12 +123,12 @@ NLM_STACK_SIZE =
#
# If this is specified it will be used by the link '-entry' directive
#
-NLM_ENTRY_SYM = _LibCPrelude
+NLM_ENTRY_SYM =
#
# If this is specified it will be used by the link '-exit' directive
#
-NLM_EXIT_SYM = _LibCPostlude
+NLM_EXIT_SYM =
#
# If this is specified it will be used by the link '-check' directive
@@ -141,14 +138,14 @@ NLM_CHECK_SYM =
#
# If this is specified it will be used by the link '-flags' directive
#
-NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION, MULTIPLE
+NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION, MULTIPLE
#
# If this is specified it will be linked in with the XDCData option in the def
# file instead of the default of $(APR)/misc/netware/apache.xdc. XDCData can
# be disabled by setting APACHE_UNIPROC in the environment
#
-XDCDATA =
+XDCDATA =
#
# Declare all target files (you must add your files here)
@@ -180,7 +177,7 @@ FILES_nlm_objs = \
# These will be added as a library command in the link.opt file.
#
FILES_nlm_libs = \
- libcpre.o \
+ $(PRELUDE) \
$(EOLIST)
#
@@ -211,7 +208,7 @@ FILE_nlm_copyright =
# Any additional imports go here
#
FILES_nlm_Ximports = \
- @$(APR)/aprlib.imp \
+ @aprlib.imp \
@libc.imp \
$(EOLIST)
@@ -220,7 +217,7 @@ FILES_nlm_Ximports = \
#
FILES_nlm_exports = \
$(EOLIST)
-
+
#
# These are the OBJ files needed to create the LIB target above.
# Paths must all use the '/' character
@@ -238,7 +235,7 @@ nlms :: libs $(TARGET_nlm)
#
# Updated this target to create necessary directories and copy files to the
-# correct place. (See $(APR_WORK)\build\NWGNUhead.inc for examples)
+# correct place. (See $(APR_WORK)/build/NWGNUhead.inc for examples)
#
install :: nlms FORCE
@@ -251,5 +248,5 @@ install :: nlms FORCE
# in this makefile
#
-include $(APR_WORK)\build\NWGNUtail.inc
+include $(APRBUILD)/NWGNUtail.inc
diff --git a/srclib/apr/test/nw_misc.c b/srclib/apr/test/nw_misc.c
index 2c1e5e2b..b45f9516 100644
--- a/srclib/apr/test/nw_misc.c
+++ b/srclib/apr/test/nw_misc.c
@@ -1,4 +1,6 @@
+#include <stdio.h>
#include <stdlib.h>
+#include <screen.h>
/*
#include "testutil.h"
*/
@@ -6,6 +8,7 @@
/* function to keep the screen open if not launched from bash */
void _NonAppStop( void )
{
+ if (getenv("_IN_NETWARE_BASH_") == NULL) {
printf("\r\n<Press any key to close screen> ");
getcharacter();
}
diff --git a/srclib/apr/test/sendfile.c b/srclib/apr/test/sendfile.c
index 488d2648..e60ec71b 100644
--- a/srclib/apr/test/sendfile.c
+++ b/srclib/apr/test/sendfile.c
@@ -109,7 +109,7 @@ static void create_testfile(apr_pool_t *p, const char *fname)
printf("Creating a test file...\n");
rv = apr_file_open(&f, fname,
- APR_CREATE | APR_WRITE | APR_TRUNCATE | APR_BUFFERED,
+ APR_FOPEN_CREATE | APR_FOPEN_WRITE | APR_FOPEN_TRUNCATE | APR_FOPEN_BUFFERED,
APR_UREAD | APR_UWRITE, p);
if (rv) {
fprintf(stderr, "apr_file_open()->%d/%s\n",
@@ -188,7 +188,7 @@ static int client(client_socket_mode_t socket_mode, char *host)
apr_setup(&p, &sock, &family);
create_testfile(p, TESTFILE);
- rv = apr_file_open(&f, TESTFILE, APR_READ, 0, p);
+ rv = apr_file_open(&f, TESTFILE, APR_FOPEN_READ, 0, p);
if (rv != APR_SUCCESS) {
fprintf(stderr, "apr_file_open()->%d/%s\n",
rv,
diff --git a/srclib/apr/test/testdir.c b/srclib/apr/test/testdir.c
index 63a2f172..417a1d7b 100644
--- a/srclib/apr/test/testdir.c
+++ b/srclib/apr/test/testdir.c
@@ -180,7 +180,7 @@ static void test_uncleared_errno(abts_case *tc, void *data)
rv = apr_dir_make("dir2", APR_OS_DEFAULT, p);
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
rv = apr_file_open(&thefile, "dir1/file1",
- APR_READ | APR_WRITE | APR_CREATE, APR_OS_DEFAULT, p);
+ APR_FOPEN_READ | APR_FOPEN_WRITE | APR_FOPEN_CREATE, APR_OS_DEFAULT, p);
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
rv = apr_file_close(thefile);
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
diff --git a/srclib/apr/test/testdup.c b/srclib/apr/test/testdup.c
index a7463379..fd88f223 100644
--- a/srclib/apr/test/testdup.c
+++ b/srclib/apr/test/testdup.c
@@ -34,8 +34,8 @@ static void test_file_dup(abts_case *tc, void *data)
/* First, create a new file, empty... */
rv = apr_file_open(&file1, FILEPATH "testdup.file",
- APR_READ | APR_WRITE | APR_CREATE |
- APR_DELONCLOSE, APR_OS_DEFAULT, p);
+ APR_FOPEN_READ | APR_FOPEN_WRITE | APR_FOPEN_CREATE |
+ APR_FOPEN_DELONCLOSE, APR_OS_DEFAULT, p);
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
ABTS_PTR_NOTNULL(tc, file1);
@@ -65,8 +65,8 @@ static void test_file_readwrite(abts_case *tc, void *data)
/* First, create a new file, empty... */
rv = apr_file_open(&file1, FILEPATH "testdup.readwrite.file",
- APR_READ | APR_WRITE | APR_CREATE |
- APR_DELONCLOSE, APR_OS_DEFAULT, p);
+ APR_FOPEN_READ | APR_FOPEN_WRITE | APR_FOPEN_CREATE |
+ APR_FOPEN_DELONCLOSE, APR_OS_DEFAULT, p);
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
ABTS_PTR_NOTNULL(tc, file1);
@@ -106,8 +106,8 @@ static void test_dup2(abts_case *tc, void *data)
apr_status_t rv;
rv = apr_file_open(&testfile, FILEPATH "testdup2.file",
- APR_READ | APR_WRITE | APR_CREATE |
- APR_DELONCLOSE, APR_OS_DEFAULT, p);
+ APR_FOPEN_READ | APR_FOPEN_WRITE | APR_FOPEN_CREATE |
+ APR_FOPEN_DELONCLOSE, APR_OS_DEFAULT, p);
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
ABTS_PTR_NOTNULL(tc, testfile);
@@ -143,8 +143,8 @@ static void test_dup2_readwrite(abts_case *tc, void *data)
apr_off_t fpos;
rv = apr_file_open(&testfile, FILEPATH "testdup2.readwrite.file",
- APR_READ | APR_WRITE | APR_CREATE |
- APR_DELONCLOSE, APR_OS_DEFAULT, p);
+ APR_FOPEN_READ | APR_FOPEN_WRITE | APR_FOPEN_CREATE |
+ APR_FOPEN_DELONCLOSE, APR_OS_DEFAULT, p);
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
ABTS_PTR_NOTNULL(tc, testfile);
diff --git a/srclib/apr/test/testfile.c b/srclib/apr/test/testfile.c
index 49d9a3ac..2b465866 100644
--- a/srclib/apr/test/testfile.c
+++ b/srclib/apr/test/testfile.c
@@ -38,7 +38,7 @@ static void test_open_noreadwrite(abts_case *tc, void *data)
apr_file_t *thefile = NULL;
rv = apr_file_open(&thefile, FILENAME,
- APR_CREATE | APR_EXCL,
+ APR_FOPEN_CREATE | APR_FOPEN_EXCL,
APR_UREAD | APR_UWRITE | APR_GREAD, p);
ABTS_TRUE(tc, rv != APR_SUCCESS);
ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_EACCES(rv));
@@ -51,7 +51,7 @@ static void test_open_excl(abts_case *tc, void *data)
apr_file_t *thefile = NULL;
rv = apr_file_open(&thefile, FILENAME,
- APR_CREATE | APR_EXCL | APR_WRITE,
+ APR_FOPEN_CREATE | APR_FOPEN_EXCL | APR_FOPEN_WRITE,
APR_UREAD | APR_UWRITE | APR_GREAD, p);
ABTS_TRUE(tc, rv != APR_SUCCESS);
ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_EEXIST(rv));
@@ -64,7 +64,7 @@ static void test_open_read(abts_case *tc, void *data)
apr_file_t *filetest = NULL;
rv = apr_file_open(&filetest, FILENAME,
- APR_READ,
+ APR_FOPEN_READ,
APR_UREAD | APR_UWRITE | APR_GREAD, p);
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
ABTS_PTR_NOTNULL(tc, filetest);
@@ -96,7 +96,7 @@ static void test_read(abts_case *tc, void *data)
apr_file_t *filetest = NULL;
rv = apr_file_open(&filetest, FILENAME,
- APR_READ,
+ APR_FOPEN_READ,
APR_UREAD | APR_UWRITE | APR_GREAD, p);
APR_ASSERT_SUCCESS(tc, "Opening test file " FILENAME, rv);
@@ -115,7 +115,7 @@ static void test_readzero(abts_case *tc, void *data)
char *str = NULL;
apr_file_t *filetest;
- rv = apr_file_open(&filetest, FILENAME, APR_READ, APR_OS_DEFAULT, p);
+ rv = apr_file_open(&filetest, FILENAME, APR_FOPEN_READ, APR_OS_DEFAULT, p);
APR_ASSERT_SUCCESS(tc, "Opening test file " FILENAME, rv);
rv = apr_file_read(filetest, str, &nbytes);
@@ -132,7 +132,7 @@ static void test_filename(abts_case *tc, void *data)
apr_file_t *filetest = NULL;
rv = apr_file_open(&filetest, FILENAME,
- APR_READ,
+ APR_FOPEN_READ,
APR_UREAD | APR_UWRITE | APR_GREAD, p);
APR_ASSERT_SUCCESS(tc, "Opening test file " FILENAME, rv);
@@ -151,7 +151,7 @@ static void test_fileclose(abts_case *tc, void *data)
apr_file_t *filetest = NULL;
rv = apr_file_open(&filetest, FILENAME,
- APR_READ,
+ APR_FOPEN_READ,
APR_UREAD | APR_UWRITE | APR_GREAD, p);
APR_ASSERT_SUCCESS(tc, "Opening test file " FILENAME, rv);
@@ -170,7 +170,7 @@ static void test_file_remove(abts_case *tc, void *data)
rv = apr_file_remove(FILENAME, p);
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
- rv = apr_file_open(&filetest, FILENAME, APR_READ,
+ rv = apr_file_open(&filetest, FILENAME, APR_FOPEN_READ,
APR_UREAD | APR_UWRITE | APR_GREAD, p);
ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_ENOENT(rv));
}
@@ -182,7 +182,7 @@ static void test_open_write(abts_case *tc, void *data)
filetest = NULL;
rv = apr_file_open(&filetest, FILENAME,
- APR_WRITE,
+ APR_FOPEN_WRITE,
APR_UREAD | APR_UWRITE | APR_GREAD, p);
ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_ENOENT(rv));
ABTS_PTR_EQUAL(tc, NULL, filetest);
@@ -195,7 +195,7 @@ static void test_open_writecreate(abts_case *tc, void *data)
filetest = NULL;
rv = apr_file_open(&filetest, FILENAME,
- APR_WRITE | APR_CREATE,
+ APR_FOPEN_WRITE | APR_FOPEN_CREATE,
APR_UREAD | APR_UWRITE | APR_GREAD, p);
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
@@ -209,7 +209,7 @@ static void test_write(abts_case *tc, void *data)
apr_file_t *filetest = NULL;
rv = apr_file_open(&filetest, FILENAME,
- APR_WRITE | APR_CREATE,
+ APR_FOPEN_WRITE | APR_FOPEN_CREATE,
APR_UREAD | APR_UWRITE | APR_GREAD, p);
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
@@ -226,7 +226,7 @@ static void test_open_readwrite(abts_case *tc, void *data)
filetest = NULL;
rv = apr_file_open(&filetest, FILENAME,
- APR_READ | APR_WRITE,
+ APR_FOPEN_READ | APR_FOPEN_WRITE,
APR_UREAD | APR_UWRITE | APR_GREAD, p);
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
ABTS_PTR_NOTNULL(tc, filetest);
@@ -243,7 +243,7 @@ static void test_seek(abts_case *tc, void *data)
apr_file_t *filetest = NULL;
rv = apr_file_open(&filetest, FILENAME,
- APR_READ,
+ APR_FOPEN_READ,
APR_UREAD | APR_UWRITE | APR_GREAD, p);
APR_ASSERT_SUCCESS(tc, "Open test file " FILENAME, rv);
@@ -267,7 +267,7 @@ static void test_seek(abts_case *tc, void *data)
/* Test for regression of sign error bug with SEEK_END and
buffered files. */
rv = apr_file_open(&filetest, FILENAME,
- APR_READ | APR_BUFFERED,
+ APR_FOPEN_READ | APR_FOPEN_BUFFERED,
APR_UREAD | APR_UWRITE | APR_GREAD, p);
APR_ASSERT_SUCCESS(tc, "Open test file " FILENAME, rv);
@@ -292,7 +292,7 @@ static void test_userdata_set(abts_case *tc, void *data)
apr_file_t *filetest = NULL;
rv = apr_file_open(&filetest, FILENAME,
- APR_WRITE,
+ APR_FOPEN_WRITE,
APR_UREAD | APR_UWRITE | APR_GREAD, p);
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
@@ -310,7 +310,7 @@ static void test_userdata_get(abts_case *tc, void *data)
apr_file_t *filetest = NULL;
rv = apr_file_open(&filetest, FILENAME,
- APR_WRITE,
+ APR_FOPEN_WRITE,
APR_UREAD | APR_UWRITE | APR_GREAD, p);
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
@@ -333,7 +333,7 @@ static void test_userdata_getnokey(abts_case *tc, void *data)
apr_file_t *filetest = NULL;
rv = apr_file_open(&filetest, FILENAME,
- APR_WRITE,
+ APR_FOPEN_WRITE,
APR_UREAD | APR_UWRITE | APR_GREAD, p);
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
@@ -351,7 +351,7 @@ static void test_buffer_set_get(abts_case *tc, void *data)
char * buffer;
rv = apr_file_open(&filetest, FILENAME,
- APR_WRITE | APR_BUFFERED,
+ APR_FOPEN_WRITE | APR_FOPEN_BUFFERED,
APR_UREAD | APR_UWRITE | APR_GREAD, p);
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
@@ -379,7 +379,7 @@ static void test_getc(abts_case *tc, void *data)
apr_status_t rv;
char ch;
- rv = apr_file_open(&f, FILENAME, APR_READ, 0, p);
+ rv = apr_file_open(&f, FILENAME, APR_FOPEN_READ, 0, p);
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
apr_file_getc(&ch, f);
@@ -394,7 +394,7 @@ static void test_ungetc(abts_case *tc, void *data)
apr_status_t rv;
char ch;
- rv = apr_file_open(&f, FILENAME, APR_READ, 0, p);
+ rv = apr_file_open(&f, FILENAME, APR_FOPEN_READ, 0, p);
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
apr_file_getc(&ch, f);
@@ -417,7 +417,7 @@ static void test_gets(abts_case *tc, void *data)
apr_status_t rv;
char *str = apr_palloc(p, 256);
- rv = apr_file_open(&f, FILENAME, APR_READ, 0, p);
+ rv = apr_file_open(&f, FILENAME, APR_FOPEN_READ, 0, p);
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
rv = apr_file_gets(str, 256, f);
@@ -440,7 +440,7 @@ static void test_gets_buffered(abts_case *tc, void *data)
char *str = apr_palloc(p, 256);
/* This will deadlock gets before the r524355 fix. */
- rv = apr_file_open(&f, FILENAME, APR_READ|APR_BUFFERED|APR_XTHREAD, 0, p);
+ rv = apr_file_open(&f, FILENAME, APR_FOPEN_READ|APR_FOPEN_BUFFERED|APR_FOPEN_XTHREAD, 0, p);
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
rv = apr_file_gets(str, 256, f);
@@ -466,7 +466,7 @@ static void test_bigread(abts_case *tc, void *data)
/* Create a test file with known content.
*/
rv = apr_file_open(&f, "data/created_file",
- APR_CREATE | APR_WRITE | APR_TRUNCATE,
+ APR_FOPEN_CREATE | APR_FOPEN_WRITE | APR_FOPEN_TRUNCATE,
APR_UREAD | APR_UWRITE, p);
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
@@ -481,7 +481,7 @@ static void test_bigread(abts_case *tc, void *data)
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
f = NULL;
- rv = apr_file_open(&f, "data/created_file", APR_READ, 0, p);
+ rv = apr_file_open(&f, "data/created_file", APR_FOPEN_READ, 0, p);
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
nbytes = sizeof buf;
@@ -511,7 +511,7 @@ static void test_mod_neg(abts_case *tc, void *data)
const char *fname = "data/modneg.dat";
rv = apr_file_open(&f, fname,
- APR_CREATE | APR_WRITE, APR_UREAD | APR_UWRITE, p);
+ APR_FOPEN_CREATE | APR_FOPEN_WRITE, APR_UREAD | APR_UWRITE, p);
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
s = "body56789\n";
@@ -545,7 +545,7 @@ static void test_mod_neg(abts_case *tc, void *data)
rv = apr_file_close(f);
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
- rv = apr_file_open(&f, fname, APR_READ, 0, p);
+ rv = apr_file_open(&f, fname, APR_FOPEN_READ, 0, p);
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
rv = apr_file_gets(buf, 11, f);
@@ -589,7 +589,7 @@ static void file_contents_equal(abts_case *tc,
apr_file_t *f;
APR_ASSERT_SUCCESS(tc, "open file",
- apr_file_open(&f, fname, APR_READ|APR_BUFFERED,
+ apr_file_open(&f, fname, APR_FOPEN_READ|APR_FOPEN_BUFFERED,
0, p));
APR_ASSERT_SUCCESS(tc, "read from file",
apr_file_read_full(f, actual, expectlen, NULL));
@@ -610,7 +610,7 @@ static void test_puts(abts_case *tc, void *data)
APR_ASSERT_SUCCESS(tc, "open file for writing",
apr_file_open(&f, fname,
- APR_WRITE|APR_CREATE|APR_TRUNCATE,
+ APR_FOPEN_WRITE|APR_FOPEN_CREATE|APR_FOPEN_TRUNCATE,
APR_OS_DEFAULT, p));
APR_ASSERT_SUCCESS(tc, "write line to file",
@@ -633,7 +633,7 @@ static void test_writev(abts_case *tc, void *data)
APR_ASSERT_SUCCESS(tc, "open file for writing",
apr_file_open(&f, fname,
- APR_WRITE|APR_CREATE|APR_TRUNCATE,
+ APR_FOPEN_WRITE|APR_FOPEN_CREATE|APR_FOPEN_TRUNCATE,
APR_OS_DEFAULT, p));
vec[0].iov_base = LINE1;
@@ -675,7 +675,7 @@ static void test_writev_full(abts_case *tc, void *data)
APR_ASSERT_SUCCESS(tc, "open file for writing",
apr_file_open(&f, fname,
- APR_WRITE|APR_CREATE|APR_TRUNCATE,
+ APR_FOPEN_WRITE|APR_FOPEN_CREATE|APR_FOPEN_TRUNCATE,
APR_OS_DEFAULT, p));
vec[0].iov_base = LINE1;
@@ -711,8 +711,8 @@ static void test_writev_buffered(abts_case *tc, void *data)
APR_ASSERT_SUCCESS(tc, "open file for writing",
apr_file_open(&f, fname,
- APR_WRITE | APR_CREATE | APR_TRUNCATE |
- APR_BUFFERED, APR_OS_DEFAULT, p));
+ APR_FOPEN_WRITE | APR_FOPEN_CREATE | APR_FOPEN_TRUNCATE |
+ APR_FOPEN_BUFFERED, APR_OS_DEFAULT, p));
nbytes = strlen(TESTSTR);
APR_ASSERT_SUCCESS(tc, "buffered write",
@@ -745,7 +745,7 @@ static void test_writev_buffered_seek(abts_case *tc, void *data)
APR_ASSERT_SUCCESS(tc, "open file for writing",
apr_file_open(&f, fname,
- APR_WRITE | APR_READ | APR_BUFFERED,
+ APR_FOPEN_WRITE | APR_FOPEN_READ | APR_FOPEN_BUFFERED,
APR_OS_DEFAULT, p));
rv = apr_file_read(f, str, &nbytes);
@@ -783,7 +783,7 @@ static void test_truncate(abts_case *tc, void *data)
apr_file_remove(fname, p);
rv = apr_file_open(&f, fname,
- APR_CREATE | APR_WRITE, APR_UREAD | APR_UWRITE, p);
+ APR_FOPEN_CREATE | APR_FOPEN_WRITE, APR_UREAD | APR_UWRITE, p);
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
s = "some data";
@@ -796,7 +796,7 @@ static void test_truncate(abts_case *tc, void *data)
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
rv = apr_file_open(&f, fname,
- APR_TRUNCATE | APR_WRITE, APR_UREAD | APR_UWRITE, p);
+ APR_FOPEN_TRUNCATE | APR_FOPEN_WRITE, APR_UREAD | APR_UWRITE, p);
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
rv = apr_file_close(f);
@@ -821,7 +821,7 @@ static void test_bigfprintf(abts_case *tc, void *data)
APR_ASSERT_SUCCESS(tc, "open test file",
apr_file_open(&f, fname,
- APR_CREATE|APR_WRITE,
+ APR_FOPEN_CREATE|APR_FOPEN_WRITE,
APR_UREAD|APR_UWRITE, p));
@@ -854,7 +854,7 @@ static void test_fail_write_flush(abts_case *tc, void *data)
APR_ASSERT_SUCCESS(tc, "open test file",
apr_file_open(&f, fname,
- APR_CREATE|APR_READ|APR_BUFFERED,
+ APR_FOPEN_CREATE|APR_FOPEN_READ|APR_FOPEN_BUFFERED,
APR_UREAD|APR_UWRITE, p));
memset(buf, 'A', sizeof buf);
@@ -884,7 +884,7 @@ static void test_fail_read_flush(abts_case *tc, void *data)
APR_ASSERT_SUCCESS(tc, "open test file",
apr_file_open(&f, fname,
- APR_CREATE|APR_READ|APR_BUFFERED,
+ APR_FOPEN_CREATE|APR_FOPEN_READ|APR_FOPEN_BUFFERED,
APR_UREAD|APR_UWRITE, p));
/* this write should be buffered. */
@@ -923,7 +923,7 @@ static void test_xthread(abts_case *tc, void *data)
apr_file_t *f;
const char *fname = "data/testxthread.dat";
apr_status_t rv;
- apr_int32_t flags = APR_CREATE|APR_READ|APR_WRITE|APR_APPEND|APR_XTHREAD;
+ apr_int32_t flags = APR_FOPEN_CREATE|APR_FOPEN_READ|APR_FOPEN_WRITE|APR_FOPEN_APPEND|APR_FOPEN_XTHREAD;
char buf[128] = { 0 };
/* Test for bug 38438, opening file with append + xthread and seeking to
diff --git a/srclib/apr/test/testfileinfo.c b/srclib/apr/test/testfileinfo.c
index ea58e12c..ff085930 100644
--- a/srclib/apr/test/testfileinfo.c
+++ b/srclib/apr/test/testfileinfo.c
@@ -109,7 +109,7 @@ static void test_info_get(abts_case *tc, void *data)
apr_finfo_t finfo;
apr_status_t rv;
- rv = apr_file_open(&thefile, FILENAME, APR_READ, APR_OS_DEFAULT, p);
+ rv = apr_file_open(&thefile, FILENAME, APR_FOPEN_READ, APR_OS_DEFAULT, p);
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
rv = apr_file_info_get(&finfo, APR_FINFO_NORM, thefile);
@@ -155,7 +155,7 @@ static void test_stat_eq_finfo(abts_case *tc, void *data)
apr_finfo_t stat_finfo;
apr_status_t rv;
- rv = apr_file_open(&thefile, FILENAME, APR_READ, APR_OS_DEFAULT, p);
+ rv = apr_file_open(&thefile, FILENAME, APR_FOPEN_READ, APR_OS_DEFAULT, p);
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
rv = apr_file_info_get(&finfo, APR_FINFO_NORM, thefile);
@@ -180,8 +180,8 @@ static void test_buffered_write_size(abts_case *tc, void *data)
apr_size_t bytes;
rv = apr_file_open(&thefile, NEWFILENAME,
- APR_READ | APR_WRITE | APR_CREATE | APR_TRUNCATE
- | APR_BUFFERED | APR_DELONCLOSE,
+ APR_FOPEN_READ | APR_FOPEN_WRITE | APR_FOPEN_CREATE | APR_FOPEN_TRUNCATE
+ | APR_FOPEN_BUFFERED | APR_FOPEN_DELONCLOSE,
APR_OS_DEFAULT, p);
APR_ASSERT_SUCCESS(tc, "open file", rv);
@@ -213,8 +213,8 @@ static void test_mtime_set(abts_case *tc, void *data)
* the epoch.
*/
rv = apr_file_open(&thefile, NEWFILENAME,
- APR_READ | APR_WRITE | APR_CREATE | APR_TRUNCATE
- | APR_BUFFERED | APR_DELONCLOSE,
+ APR_FOPEN_READ | APR_FOPEN_WRITE | APR_FOPEN_CREATE | APR_FOPEN_TRUNCATE
+ | APR_FOPEN_BUFFERED | APR_FOPEN_DELONCLOSE,
APR_OS_DEFAULT, p);
APR_ASSERT_SUCCESS(tc, "open file", rv);
diff --git a/srclib/apr/test/testflock.c b/srclib/apr/test/testflock.c
index 136d9f64..b9e8c792 100644
--- a/srclib/apr/test/testflock.c
+++ b/srclib/apr/test/testflock.c
@@ -63,7 +63,7 @@ static void test_withlock(abts_case *tc, void *data)
apr_status_t rv;
int code;
- rv = apr_file_open(&file, TESTFILE, APR_WRITE|APR_CREATE,
+ rv = apr_file_open(&file, TESTFILE, APR_FOPEN_WRITE|APR_FOPEN_CREATE,
APR_OS_DEFAULT, p);
APR_ASSERT_SUCCESS(tc, "Could not create file.", rv);
ABTS_PTR_NOTNULL(tc, file);
diff --git a/srclib/apr/test/testfnmatch.c b/srclib/apr/test/testfnmatch.c
index 37961988..17a75441 100644
--- a/srclib/apr/test/testfnmatch.c
+++ b/srclib/apr/test/testfnmatch.c
@@ -25,6 +25,184 @@
#define NUM_FILES (5)
+#define APR_FNM_BITS 15
+#define APR_FNM_FAILBIT 256
+
+#define FAILS_IF(X) 0, X
+#define SUCCEEDS_IF(X) X, 256
+#define SUCCEEDS 0, 256
+#define FAILS 256, 0
+
+static struct pattern_s {
+ const char *pattern;
+ const char *string;
+ int require_flags;
+ int fail_flags;
+} patterns[] = {
+
+/* Pattern, String to Test, Flags to Match */
+ {"", "test", FAILS},
+ {"", "*", FAILS},
+ {"test", "*", FAILS},
+ {"test", "test", SUCCEEDS},
+
+ /* Remember C '\\' is a single backslash in pattern */
+ {"te\\st", "test", FAILS_IF(APR_FNM_NOESCAPE)},
+ {"te\\\\st", "te\\st", FAILS_IF(APR_FNM_NOESCAPE)},
+ {"te\\*t", "te*t", FAILS_IF(APR_FNM_NOESCAPE)},
+ {"te\\*t", "test", FAILS},
+ {"te\\?t", "te?t", FAILS_IF(APR_FNM_NOESCAPE)},
+ {"te\\?t", "test", FAILS},
+
+ {"tesT", "test", SUCCEEDS_IF(APR_FNM_CASE_BLIND)},
+ {"test", "Test", SUCCEEDS_IF(APR_FNM_CASE_BLIND)},
+ {"tEst", "teSt", SUCCEEDS_IF(APR_FNM_CASE_BLIND)},
+
+ {"?est", "test", SUCCEEDS},
+ {"te?t", "test", SUCCEEDS},
+ {"tes?", "test", SUCCEEDS},
+ {"test?", "test", FAILS},
+
+ {"*", "", SUCCEEDS},
+ {"*", "test", SUCCEEDS},
+ {"*test", "test", SUCCEEDS},
+ {"*est", "test", SUCCEEDS},
+ {"*st", "test", SUCCEEDS},
+ {"t*t", "test", SUCCEEDS},
+ {"te*t", "test", SUCCEEDS},
+ {"te*st", "test", SUCCEEDS},
+ {"te*", "test", SUCCEEDS},
+ {"tes*", "test", SUCCEEDS},
+ {"test*", "test", SUCCEEDS},
+
+ {".[\\-\\t]", ".t", SUCCEEDS},
+ {"test*?*[a-z]*", "testgoop", SUCCEEDS},
+ {"te[^x]t", "test", SUCCEEDS},
+ {"te[^abc]t", "test", SUCCEEDS},
+ {"te[^x]t", "test", SUCCEEDS},
+ {"te[!x]t", "test", SUCCEEDS},
+ {"te[^x]t", "text", FAILS},
+ {"te[^\\x]t", "text", FAILS},
+ {"te[^x\\", "text", FAILS},
+ {"te[/]t", "text", FAILS},
+ {"te[S]t", "test", SUCCEEDS_IF(APR_FNM_CASE_BLIND)},
+ {"te[r-t]t", "test", SUCCEEDS},
+ {"te[r-t]t", "teSt", SUCCEEDS_IF(APR_FNM_CASE_BLIND)},
+ {"te[r-T]t", "test", SUCCEEDS_IF(APR_FNM_CASE_BLIND)},
+ {"te[R-T]t", "test", SUCCEEDS_IF(APR_FNM_CASE_BLIND)},
+ {"te[r-Tz]t", "tezt", SUCCEEDS},
+ {"te[R-T]t", "tent", FAILS},
+ {"tes[]t]", "test", SUCCEEDS},
+ {"tes[t-]", "test", SUCCEEDS},
+ {"tes[t-]]", "test]", SUCCEEDS},
+ {"tes[t-]]", "test", FAILS},
+ {"tes[u-]", "test", FAILS},
+ {"tes[t-]", "tes[t-]", FAILS},
+ {"test[/-/]", "test[/-/]", SUCCEEDS_IF(APR_FNM_PATHNAME)},
+ {"test[\\/-/]", "test[/-/]", APR_FNM_PATHNAME, APR_FNM_NOESCAPE},
+ {"test[/-\\/]", "test[/-/]", APR_FNM_PATHNAME, APR_FNM_NOESCAPE},
+ {"test[/-/]", "test/", FAILS_IF(APR_FNM_PATHNAME)},
+ {"test[\\/-/]", "test/", FAILS_IF(APR_FNM_PATHNAME)},
+ {"test[/-\\/]", "test/", FAILS_IF(APR_FNM_PATHNAME)},
+
+ {"/", "", FAILS},
+ {"", "/", FAILS},
+ {"/test", "test", FAILS},
+ {"test", "/test", FAILS},
+ {"test/", "test", FAILS},
+ {"test", "test/", FAILS},
+ {"\\/test", "/test", FAILS_IF(APR_FNM_NOESCAPE)},
+ {"*test", "/test", FAILS_IF(APR_FNM_PATHNAME)},
+ {"/*/test/", "/test", FAILS},
+ {"/*/test/", "/test/test/", SUCCEEDS},
+ {"test/this", "test/", FAILS},
+ {"test/", "test/this", FAILS},
+ {"test*/this", "test/this", SUCCEEDS},
+ {"test*/this", "test/that", FAILS},
+ {"test/*this", "test/this", SUCCEEDS},
+
+ {".*", ".this", SUCCEEDS},
+ {"*", ".this", FAILS_IF(APR_FNM_PERIOD)},
+ {"?this", ".this", FAILS_IF(APR_FNM_PERIOD)},
+ {"[.]this", ".this", FAILS_IF(APR_FNM_PERIOD)},
+
+ {"test/this", "test/this", SUCCEEDS},
+ {"test?this", "test/this", FAILS_IF(APR_FNM_PATHNAME)},
+ {"test*this", "test/this", FAILS_IF(APR_FNM_PATHNAME)},
+ {"test[/]this", "test/this", FAILS_IF(APR_FNM_PATHNAME)},
+
+ {"test/.*", "test/.this", SUCCEEDS},
+ {"test/*", "test/.this", FAILS_IF(APR_FNM_PERIOD | APR_FNM_PATHNAME)},
+ {"test/?this", "test/.this", FAILS_IF(APR_FNM_PERIOD | APR_FNM_PATHNAME)},
+ {"test/[.]this", "test/.this", FAILS_IF(APR_FNM_PERIOD | APR_FNM_PATHNAME)},
+
+ {NULL, NULL, 0}
+};
+
+
+
+static void test_fnmatch(abts_case *tc, void *data)
+{
+ struct pattern_s *test = patterns;
+ char buf[80];
+ int i = APR_FNM_BITS + 1;
+ int res;
+
+ for (test = patterns; test->pattern; ++test)
+ {
+ for (i = 0; i <= APR_FNM_BITS; ++i)
+ {
+ res = apr_fnmatch(test->pattern, test->string, i);
+ if (((i & test->require_flags) != test->require_flags)
+ || ((i & test->fail_flags) == test->fail_flags)) {
+ if (res != APR_FNM_NOMATCH)
+ break;
+ }
+ else {
+ if (res != 0)
+ break;
+ }
+ }
+ if (i <= APR_FNM_BITS)
+ break;
+ }
+
+ if (i <= APR_FNM_BITS) {
+ sprintf(buf, "apr_fnmatch(\"%s\", \"%s\", %d) returns %d\n",
+ test->pattern, test->string, i, res);
+ abts_fail(tc, buf, __LINE__);
+ }
+}
+
+static void test_fnmatch_test(abts_case *tc, void *data)
+{
+ static const struct test {
+ const char *pattern;
+ int result;
+ } ft_tests[] = {
+ { "a*b", 1 },
+ { "a?", 1 },
+ { "a\\b?", 1 },
+ { "a[b-c]", 1 },
+ { "a", 0 },
+ { "a\\", 0 },
+ { NULL, 0 }
+ };
+ const struct test *t;
+
+ for (t = ft_tests; t->pattern != NULL; t++) {
+ int res = apr_fnmatch_test(t->pattern);
+
+ if (res != t->result) {
+ char buf[128];
+
+ sprintf(buf, "apr_fnmatch_test(\"%s\") = %d, expected %d\n",
+ t->pattern, res, t->result);
+ abts_fail(tc, buf, __LINE__);
+ }
+ }
+}
+
static void test_glob(abts_case *tc, void *data)
{
int i;
@@ -68,6 +246,8 @@ abts_suite *testfnmatch(abts_suite *suite)
{
suite = ADD_SUITE(suite)
+ abts_run_test(suite, test_fnmatch, NULL);
+ abts_run_test(suite, test_fnmatch_test, NULL);
abts_run_test(suite, test_glob, NULL);
abts_run_test(suite, test_glob_currdir, NULL);
diff --git a/srclib/apr/test/testmmap.c b/srclib/apr/test/testmmap.c
index ee87b3bf..4063ba62 100644
--- a/srclib/apr/test/testmmap.c
+++ b/srclib/apr/test/testmmap.c
@@ -73,7 +73,7 @@ static void test_file_open(abts_case *tc, void *data)
{
apr_status_t rv;
- rv = apr_file_open(&thefile, file1, APR_READ, APR_UREAD | APR_GREAD, p);
+ rv = apr_file_open(&thefile, file1, APR_FOPEN_READ, APR_UREAD | APR_GREAD, p);
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
ABTS_PTR_NOTNULL(tc, thefile);
}
diff --git a/srclib/apr/test/testnames.c b/srclib/apr/test/testnames.c
index ae650b19..7a310faf 100644
--- a/srclib/apr/test/testnames.c
+++ b/srclib/apr/test/testnames.c
@@ -21,6 +21,11 @@
#include "apr_general.h"
#include "apr_pools.h"
#include "apr_lib.h"
+#include "apr_strings.h"
+
+#if defined(WIN32)
+#include <direct.h>
+#endif
#if defined(WIN32) || defined(OS2)
#define ABS_ROOT "C:/"
@@ -175,6 +180,42 @@ static void merge_notabs(abts_case *tc, void *data)
ABTS_STR_EQUAL(tc, "foo/baz", dstpath);
}
+#if defined (WIN32)
+static void merge_lowercasedrive(abts_case *tc, void *data)
+{
+ char current_dir[1024];
+ char current_dir_on_C[1024];
+ char *dir_on_c;
+ char *testdir;
+ apr_status_t rv;
+
+ /* Change the current directory on C: from something like "C:\dir"
+ to something like "c:\dir" to replicate the failing case. */
+ ABTS_PTR_NOTNULL(tc, _getcwd(current_dir, sizeof(current_dir)));
+
+ /* 3 stands for drive C: */
+ ABTS_PTR_NOTNULL(tc, _getdcwd(3, current_dir_on_C,
+ sizeof(current_dir_on_C)));
+
+ /* Use the same path, but now with a lower case driveletter */
+ dir_on_c = apr_pstrdup(p, current_dir_on_C);
+ dir_on_c[0] = (char)tolower(dir_on_c[0]);
+
+ chdir(dir_on_c);
+
+ /* Now merge a drive relative path with an upper case drive letter. */
+ rv = apr_filepath_merge(&testdir, NULL, "C:hi",
+ APR_FILEPATH_NOTRELATIVE, p);
+
+ /* Change back to original directory for next tests */
+ chdir("C:\\"); /* Switch to upper case */
+ chdir(current_dir_on_C); /* Switch cwd on C: */
+ chdir(current_dir); /* Switch back to original cwd */
+
+ ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
+}
+#endif
+
static void root_absolute(abts_case *tc, void *data)
{
apr_status_t rv;
@@ -294,6 +335,9 @@ abts_suite *testnames(abts_suite *suite)
abts_run_test(suite, merge_notabs, NULL);
abts_run_test(suite, merge_notabsfail, NULL);
abts_run_test(suite, merge_dotdot_dotdot_dotdot, NULL);
+#if defined(WIN32)
+ abts_run_test(suite, merge_lowercasedrive, NULL);
+#endif
abts_run_test(suite, root_absolute, NULL);
abts_run_test(suite, root_relative, NULL);
diff --git a/srclib/apr/test/testpoll.c b/srclib/apr/test/testpoll.c
index b298c916..dc209493 100644
--- a/srclib/apr/test/testpoll.c
+++ b/srclib/apr/test/testpoll.c
@@ -769,6 +769,69 @@ static void pollcb_default(abts_case *tc, void *data)
}
}
+static void justsleep(abts_case *tc, void *data)
+{
+ apr_int32_t nsds;
+ const apr_pollfd_t *hot_files;
+ apr_pollset_t *pollset;
+ apr_status_t rv;
+ apr_time_t t1, t2;
+ int i;
+ apr_pollset_method_e methods[] = {
+ APR_POLLSET_DEFAULT,
+ APR_POLLSET_SELECT,
+ APR_POLLSET_KQUEUE,
+ APR_POLLSET_PORT,
+ APR_POLLSET_EPOLL,
+ APR_POLLSET_POLL};
+
+ nsds = 1;
+ t1 = apr_time_now();
+ rv = apr_poll(NULL, 0, &nsds, apr_time_from_msec(200));
+ t2 = apr_time_now();
+ ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_TIMEUP(rv));
+ ABTS_INT_EQUAL(tc, 0, nsds);
+ ABTS_ASSERT(tc,
+ "apr_poll() didn't sleep",
+ (t2 - t1) > apr_time_from_msec(100));
+
+ for (i = 0; i < sizeof methods / sizeof methods[0]; i++) {
+ rv = apr_pollset_create_ex(&pollset, 5, p, 0, methods[i]);
+ if (rv != APR_ENOTIMPL) {
+ ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
+
+ nsds = 1;
+ t1 = apr_time_now();
+ rv = apr_pollset_poll(pollset, apr_time_from_msec(200), &nsds,
+ &hot_files);
+ t2 = apr_time_now();
+ ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_TIMEUP(rv));
+ ABTS_INT_EQUAL(tc, 0, nsds);
+ ABTS_ASSERT(tc,
+ "apr_pollset_poll() didn't sleep",
+ (t2 - t1) > apr_time_from_msec(100));
+
+ rv = apr_pollset_destroy(pollset);
+ ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
+ }
+
+ rv = apr_pollcb_create_ex(&pollcb, 5, p, 0, methods[0]);
+ if (rv != APR_ENOTIMPL) {
+ ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
+
+ t1 = apr_time_now();
+ rv = apr_pollcb_poll(pollcb, apr_time_from_msec(200), NULL, NULL);
+ t2 = apr_time_now();
+ ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_TIMEUP(rv));
+ ABTS_ASSERT(tc,
+ "apr_pollcb_poll() didn't sleep",
+ (t2 - t1) > apr_time_from_msec(100));
+
+ /* no apr_pollcb_destroy() */
+ }
+ }
+}
+
abts_suite *testpoll(abts_suite *suite)
{
suite = ADD_SUITE(suite)
@@ -808,6 +871,7 @@ abts_suite *testpoll(abts_suite *suite)
abts_run_test(suite, close_all_sockets, NULL);
abts_run_test(suite, pollset_default, NULL);
abts_run_test(suite, pollcb_default, NULL);
+ abts_run_test(suite, justsleep, NULL);
return suite;
}
diff --git a/srclib/apr/test/testproc.c b/srclib/apr/test/testproc.c
index 5cf768f1..c983f259 100644
--- a/srclib/apr/test/testproc.c
+++ b/srclib/apr/test/testproc.c
@@ -91,15 +91,15 @@ static void test_file_redir(abts_case *tc, void *data)
testfile = NULL;
rv = apr_file_open(&testfile, "data/stdin",
- APR_READ | APR_WRITE | APR_CREATE | APR_EXCL,
+ APR_FOPEN_READ | APR_FOPEN_WRITE | APR_FOPEN_CREATE | APR_FOPEN_EXCL,
APR_OS_DEFAULT, p);
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
rv = apr_file_open(&testout, "data/stdout",
- APR_READ | APR_WRITE | APR_CREATE | APR_EXCL,
+ APR_FOPEN_READ | APR_FOPEN_WRITE | APR_FOPEN_CREATE | APR_FOPEN_EXCL,
APR_OS_DEFAULT, p);
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
rv = apr_file_open(&testerr, "data/stderr",
- APR_READ | APR_WRITE | APR_CREATE | APR_EXCL,
+ APR_FOPEN_READ | APR_FOPEN_WRITE | APR_FOPEN_CREATE | APR_FOPEN_EXCL,
APR_OS_DEFAULT, p);
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
diff --git a/srclib/apr/test/testrand.c b/srclib/apr/test/testrand.c
index 6ced4a34..333491f3 100644
--- a/srclib/apr/test/testrand.c
+++ b/srclib/apr/test/testrand.c
@@ -63,6 +63,7 @@ static void rand_run_kat(abts_case *tc, rnd_fn *f, apr_random_t *r,
}
}
+#if APR_HAS_FORK
static int rand_check_kat(rnd_fn *f, apr_random_t *r,
const unsigned char expected[128])
{
@@ -76,6 +77,7 @@ static int rand_check_kat(rnd_fn *f, apr_random_t *r,
return 1;
return 0;
}
+#endif
static void rand_add_zeroes(apr_random_t *r)
{
diff --git a/srclib/apr/test/testshm.c b/srclib/apr/test/testshm.c
index 6c192f29..bbaf6250 100644
--- a/srclib/apr/test/testshm.c
+++ b/srclib/apr/test/testshm.c
@@ -31,6 +31,7 @@
#if APR_HAS_SHARED_MEMORY
+#if APR_HAS_FORK
static int msgwait(int sleep_sec, int first_box, int last_box)
{
int i;
@@ -58,6 +59,7 @@ static void msgput(int boxnum, char *msg)
apr_cpystrn(boxes[boxnum].msg, msg, strlen(msg) + 1);
boxes[boxnum].msgavail = 1;
}
+#endif /* APR_HAS_FORK */
static void test_anon_create(abts_case *tc, void *data)
{
diff --git a/srclib/apr/test/testsock.c b/srclib/apr/test/testsock.c
index b1115fd4..37063bf7 100644
--- a/srclib/apr/test/testsock.c
+++ b/srclib/apr/test/testsock.c
@@ -74,6 +74,12 @@ static void test_addr_info(abts_case *tc, void *data)
rv = apr_sockaddr_info_get(&sa, "127.0.0.1", APR_UNSPEC, 80, 0, p);
APR_ASSERT_SUCCESS(tc, "Problem generating sockaddr", rv);
ABTS_STR_EQUAL(tc, "127.0.0.1", sa->hostname);
+
+ rv = apr_sockaddr_info_get(&sa, "127.0.0.1", APR_UNSPEC, 0, 0, p);
+ APR_ASSERT_SUCCESS(tc, "Problem generating sockaddr", rv);
+ ABTS_STR_EQUAL(tc, "127.0.0.1", sa->hostname);
+ ABTS_INT_EQUAL(tc, 0, sa->port);
+ ABTS_INT_EQUAL(tc, 0, ntohs(sa->sa.sin.sin_port));
}
static void test_serv_by_name(abts_case *tc, void *data)
@@ -328,16 +334,20 @@ static void test_get_addr(abts_case *tc, void *data)
apr_status_t rv;
apr_socket_t *ld, *sd, *cd;
apr_sockaddr_t *sa, *ca;
+ apr_pool_t *subp;
char *a, *b;
- ld = setup_socket(tc);
+ APR_ASSERT_SUCCESS(tc, "create subpool", apr_pool_create(&subp, p));
+
+ if ((ld = setup_socket(tc)) != APR_SUCCESS)
+ return;
APR_ASSERT_SUCCESS(tc,
"get local address of bound socket",
apr_socket_addr_get(&sa, APR_LOCAL, ld));
rv = apr_socket_create(&cd, sa->family, SOCK_STREAM,
- APR_PROTO_TCP, p);
+ APR_PROTO_TCP, subp);
APR_ASSERT_SUCCESS(tc, "create client socket", rv);
APR_ASSERT_SUCCESS(tc, "enable non-block mode",
@@ -363,7 +373,7 @@ static void test_get_addr(abts_case *tc, void *data)
}
APR_ASSERT_SUCCESS(tc, "accept connection",
- apr_socket_accept(&sd, ld, p));
+ apr_socket_accept(&sd, ld, subp));
{
/* wait for writability */
@@ -383,18 +393,38 @@ static void test_get_addr(abts_case *tc, void *data)
APR_ASSERT_SUCCESS(tc, "get local address of server socket",
apr_socket_addr_get(&sa, APR_LOCAL, sd));
-
APR_ASSERT_SUCCESS(tc, "get remote address of client socket",
apr_socket_addr_get(&ca, APR_REMOTE, cd));
-
- a = apr_psprintf(p, "%pI", sa);
- b = apr_psprintf(p, "%pI", ca);
+ /* Test that the pool of the returned sockaddr objects exactly
+ * match the socket. */
+ ABTS_PTR_EQUAL(tc, subp, sa->pool);
+ ABTS_PTR_EQUAL(tc, subp, ca->pool);
+
+ /* Check equivalence. */
+ a = apr_psprintf(p, "%pI fam=%d", sa, sa->family);
+ b = apr_psprintf(p, "%pI fam=%d", ca, ca->family);
+ ABTS_STR_EQUAL(tc, a, b);
+
+ /* Check pool of returned sockaddr, as above. */
+ APR_ASSERT_SUCCESS(tc, "get local address of client socket",
+ apr_socket_addr_get(&sa, APR_LOCAL, cd));
+ APR_ASSERT_SUCCESS(tc, "get remote address of server socket",
+ apr_socket_addr_get(&ca, APR_REMOTE, sd));
+
+ /* Check equivalence. */
+ a = apr_psprintf(p, "%pI fam=%d", sa, sa->family);
+ b = apr_psprintf(p, "%pI fam=%d", ca, ca->family);
ABTS_STR_EQUAL(tc, a, b);
+
+ ABTS_PTR_EQUAL(tc, subp, sa->pool);
+ ABTS_PTR_EQUAL(tc, subp, ca->pool);
apr_socket_close(cd);
apr_socket_close(sd);
apr_socket_close(ld);
+
+ apr_pool_destroy(subp);
}
abts_suite *testsock(abts_suite *suite)
diff --git a/srclib/apr/test/tryread.c b/srclib/apr/test/tryread.c
index 729f8e69..569d647c 100644
--- a/srclib/apr/test/tryread.c
+++ b/srclib/apr/test/tryread.c
@@ -33,7 +33,7 @@ int main(int argc, const char * const *argv)
apr_initialize();
apr_pool_create(&p, NULL);
- if (apr_file_open(&file, TESTFILE, APR_WRITE, APR_OS_DEFAULT, p)
+ if (apr_file_open(&file, TESTFILE, APR_FOPEN_WRITE, APR_OS_DEFAULT, p)
!= APR_SUCCESS) {
exit(UNEXPECTED_ERROR);