You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Ioan Popescu <ip...@dataq.com> on 2007/10/09 17:51:51 UTC

[PATCH] libapr-1.2.11 test on WinCE 5

Index: abts.c
===================================================================
--- abts.c	(revision 575665)
+++ abts.c	(working copy)
@@ -19,13 +19,22 @@
 #include "abts.h"
 #include "abts_tests.h"
 #include "testutil.h"
+#include <tchar.h>
+#ifdef _WIN32_WCE
+#include "apr_pools.h"
+#include "ConvertUTF.h"
+#endif
 
 #define ABTS_STAT_SIZE 6
 static char status[ABTS_STAT_SIZE] = {'|', '/', '-', '|', '\\', '-'};
 static int curr_char;
 static int verbose = 0;
 static int exclude = 0;
+#ifndef _WIN32_WCE
 static int quiet = 0;
+#else
+static int quiet = 1;
+#endif
 static int list_tests = 0;
 
 const char **testlist = NULL;
@@ -104,6 +113,7 @@
     subsuite = malloc(sizeof(*subsuite));
     subsuite->num_test = 0;
     subsuite->failed = 0;
+    subsuite->not_impl = 0;
     subsuite->next = NULL;
     /* suite_name_full may be an absolute path depending on __FILE__ 
      * expansion */
@@ -197,7 +207,7 @@
     }
 
     dptr = suite->head;
-    fprintf(stdout, "%-15s\t\tTotal\tFail\tFailed %%\n", "Failed Tests");
+    fprintf(stdout, "\n%-15s\t\tTotal\tFail\tFailed %%\n", "Failed Tests");
     fprintf(stdout, "===================================================\n");
     while (dptr != NULL) {
         if (dptr->failed != 0) {
@@ -207,6 +217,17 @@
         }
         dptr = dptr->next;
     }
+    dptr = suite->head;
+    fprintf(stdout, "\n%-15s\t\tTotal\tFail\tFailed %%\n", "Unimplemented");
+    fprintf(stdout, "===================================================\n");
+    while (dptr != NULL) {
+        if (dptr->not_impl != 0) {
+            float percent = ((float)dptr->not_impl / (float)dptr->num_test);
+            fprintf(stdout, "%-15s\t\t%5d\t%4d\t%6.2f%%\n", dptr->name, 
+                    dptr->num_test, dptr->not_impl, percent * 100);
+        }
+        dptr = dptr->next;
+    }
     return 1;
 }
 
@@ -362,7 +383,7 @@
     }
 }
 
-int main(int argc, const char *const argv[]) {
+int _tmain(int argc, const _TCHAR *const argv[]) {
     int i;
     int rv;
     int list_provided = 0;
@@ -370,24 +391,24 @@
    
     initialize();
     for (i = 1; i < argc; i++) {
-        if (!strcmp(argv[i], "-v")) {
+        if (!_tcscmp(argv[i], _T("-v"))) {
             verbose = 1;
             continue;
         }
-        if (!strcmp(argv[i], "-x")) {
+        if (!_tcscmp(argv[i], _T("-x"))) {
             exclude = 1;
             continue;
         }
-        if (!strcmp(argv[i], "-l")) {
+        if (!_tcscmp(argv[i], _T("-l"))) {
             list_tests = 1;
             continue;
         }
-        if (!strcmp(argv[i], "-q")) {
+        if (!_tcscmp(argv[i], _T("-q"))) {
             quiet = 1;
             continue;
         }
         if (argv[i][0] == '-') {
-            fprintf(stderr, "Invalid option: `%s'\n", argv[i]);
+            _ftprintf(stderr, _T("Invalid option: `%s'\n"), argv[i]);
             exit(1);
         }
         list_provided = 1;
@@ -399,7 +420,20 @@
          */
         testlist = calloc(argc + 1, sizeof(char *));
         for (i = 1; i < argc; i++) {
+#ifndef _WIN32_WCE
             testlist[i - 1] = argv[i];
+#else
+          char *argv2;
+          UTF16 *sstart = (UTF16 *)argv[i],
+                *send = (UTF16 *)&argv[i][wcslen(argv[i])];
+          UTF8 *tstart, *tend;
+
+          argv2 = apr_palloc(p, 512);
+          tstart = argv2;
+          tend = &argv2[511];
+          ConvertUTF16toUTF8(&sstart, send, &tstart, tend, strictConversion);
+          testlist[i - 1] = argv2;
+#endif
         }
     }
 
Index: abts_tests.h
===================================================================
--- abts_tests.h	(revision 575665)
+++ abts_tests.h	(working copy)
@@ -23,6 +23,15 @@
 const struct testlist {
     abts_suite *(*func)(abts_suite *suite);
 } alltests[] = {
+#ifndef _WIN32_WCE
+#if 0 /* not ready yet due to API issues */
+    {testglobalmutex},
+#endif
+    {testoc},
+    {testpipe},
+    {testproc},
+    {testsock},
+#endif
     {testatomic},
     {testdir},
     {testdso},
@@ -35,27 +44,20 @@
     {testfmt},
     {testfnmatch},
     {testgetopt},
-#if 0 /* not ready yet due to API issues */
-    {testglobalmutex},
-#endif
     {testhash},
     {testipsub},
     {testlock},
     {testlfs},
     {testmmap},
     {testnames},
-    {testoc},
     {testpath},
-    {testpipe},
     {testpoll},
     {testpool},
-    {testproc},
     {testprocmutex},
     {testrand},
     {testrand2},
     {testsleep},
     {testshm},
-    {testsock},
     {testsockets},
     {testsockopt},
     {teststr},
Index: globalmutexchild.c
===================================================================
--- globalmutexchild.c	(revision 575665)
+++ globalmutexchild.c	(working copy)
@@ -21,13 +21,14 @@
 #include "apr_global_mutex.h"
 #include "apr_strings.h"
 #include "apr.h"
+#include <tchar.h>
 
 #if APR_HAVE_STDLIB_H
 #include <stdlib.h>
 #endif
 
 
-int main(int argc, const char * const argv[])
+int _tmain(int argc, const _TCHAR * const argv[])
 {
     apr_pool_t *p;
     int i = 0;
@@ -40,7 +41,11 @@
     
     apr_pool_create(&p, NULL);
     if (argc >= 2) {
+#ifndef _WIN32_WCE
         mech = (apr_lockmech_e)apr_strtoi64(argv[1], NULL, 0);
+#else
+        mech = (apr_lockmech_e)_wtoi64(argv[1]);
+#endif
     }
     else {
         mech = APR_LOCK_DEFAULT;
Index: occhild.c
===================================================================
--- occhild.c	(revision 575665)
+++ occhild.c	(working copy)
@@ -1,12 +1,13 @@
 #include "apr.h"
 #include "apr_file_io.h"
 #include "apr.h"
+#include <tchar.h>
 
 #if APR_HAVE_STDLIB_H
 #include <stdlib.h>
 #endif
 
-int main(void)
+int _tmain(void)
 {
     char buf[256];
     apr_file_t *err;
Index: proc_child.c
===================================================================
--- proc_child.c	(revision 575665)
+++ proc_child.c	(working copy)
@@ -7,15 +7,22 @@
 #include <io.h>
 #endif
 #include <stdlib.h>
+#include <tchar.h>
 
-int main(void)
+int _tmain(void)
 {
     char buf[256];
     apr_ssize_t bytes;
-    
+
+#ifndef _WIN32_WCE
     bytes = read(STDIN_FILENO, buf, 256);
     if (bytes > 0)
         write(STDOUT_FILENO, buf, bytes);
+#else
+    bytes = fread(buf, 1, 256, stdin);
+    if (bytes > 0)
+        fwrite(buf, 1, bytes, stdout);
+#endif
 
     return 0; /* just to keep the compiler happy */
 }
Index: readchild.c
===================================================================
--- readchild.c	(revision 575665)
+++ readchild.c	(working copy)
@@ -15,10 +15,11 @@
  */
 
 #include <stdlib.h>
+#include <tchar.h>
 
 #include "apr_file_io.h"
 
-int main(int argc, char *argv[])
+int _tmain(int argc, _TCHAR *argv[])
 {
     apr_file_t *in, *out;
     apr_size_t nbytes, total_bytes;
Index: sendfile.c
===================================================================
--- sendfile.c	(revision 575665)
+++ sendfile.c	(working copy)
@@ -15,8 +15,10 @@
  */
 
 #include <assert.h>
+#ifndef _WIN32_WCE
 #include <errno.h>
 #include <signal.h>
+#endif
 #include <stdlib.h>
 #include <string.h>
 #include "apr_network_io.h"
@@ -25,7 +27,7 @@
 #include "apr_poll.h"
 
 #if !APR_HAS_SENDFILE
-int main(void)
+int _tmain(void)
 {
     fprintf(stderr, 
             "This program won't work on this platform because there is no "
Index: sockchild.c
===================================================================
--- sockchild.c	(revision 575665)
+++ sockchild.c	(working copy)
@@ -18,8 +18,9 @@
 #include "testsock.h"
 #include "apr_network_io.h"
 #include "apr_pools.h"
+#include <tchar.h>
 
-int main(int argc, char *argv[])
+int _tmain(int argc, _TCHAR *argv[])
 {
     apr_pool_t *p;
     apr_socket_t *sock;
@@ -49,9 +50,11 @@
         exit(-1);
     }
 
-    apr_socket_connect(sock, remote_sa);
-        
-    if (!strcmp("read", argv[1])) {
+    if (apr_socket_connect(sock, remote_sa) != APR_SUCCESS) {
+        exit(-1);
+    }
+
+    if (!_tcscmp(_T("read"), argv[1])) {
         char datarecv[STRLEN];
         apr_size_t length = STRLEN;
         apr_status_t rv;
@@ -69,7 +72,7 @@
         
         exit(length);
     }
-    else if (!strcmp("write", argv[1])) {
+    else if (!_tcscmp(_T("write"), argv[1])) {
         apr_size_t length = strlen(DATASTR);
         apr_socket_send(sock, DATASTR, &length);
 
Index: testapp.c
===================================================================
--- testapp.c	(revision 575665)
+++ testapp.c	(working copy)
@@ -1,9 +1,9 @@
 #include <apr.h>
 #include <apr_general.h>
 
-int main(int argc, const char * const * argv, const char * const *env)
+int _tmain(int argc, const _TCHAR * const * argv, const _TCHAR * const *env)
 {
-    apr_app_initialize(&argc, &argv, &env);
+    apr_app_initialize(&argc, NULL, NULL);
 
 
     apr_terminate();
Index: testatomic.c
===================================================================
--- testatomic.c	(revision 575665)
+++ testatomic.c	(working copy)
@@ -187,7 +187,11 @@
 volatile apr_uint32_t z = 0; /* no locks */
 apr_status_t exit_ret_val = 123; /* just some made up number to check on later */
 
+#ifndef _WIN32_WCE
 #define NUM_THREADS 40
+#else
+#define NUM_THREADS 8
+#endif
 #define NUM_ITERATIONS 20000
 void * APR_THREAD_FUNC thread_func_mutex(apr_thread_t *thd, void *data)
 {
Index: testdir.c
===================================================================
--- testdir.c	(revision 575665)
+++ testdir.c	(working copy)
@@ -24,15 +24,21 @@
 #include "apr_lib.h"
 #include "testutil.h"
 
+#ifdef _WIN32_WCE
+#define g_cwd "/Windows/apr/"
+#else
+#define g_cwd
+#endif
+
 static void test_mkdir(abts_case *tc, void *data)
 {
     apr_status_t rv;
     apr_finfo_t finfo;
 
-    rv = apr_dir_make("data/testdir", APR_UREAD | APR_UWRITE | APR_UEXECUTE, p);
+    rv = apr_dir_make(g_cwd "data/testdir", APR_UREAD | APR_UWRITE | APR_UEXECUTE, p);
     ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
 
-    rv = apr_stat(&finfo, "data/testdir", APR_FINFO_TYPE, p);
+    rv = apr_stat(&finfo, g_cwd "data/testdir", APR_FINFO_TYPE, p);
     ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
     ABTS_INT_EQUAL(tc, APR_DIR, finfo.filetype);
 }
@@ -42,19 +48,19 @@
     apr_status_t rv;
     apr_finfo_t finfo;
 
-    rv = apr_dir_make_recursive("data/one/two/three", 
+    rv = apr_dir_make_recursive(g_cwd "data/one/two/three", 
                                 APR_UREAD | APR_UWRITE | APR_UEXECUTE, p);
     ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
 
-    rv = apr_stat(&finfo, "data/one", APR_FINFO_TYPE, p);
+    rv = apr_stat(&finfo, g_cwd "data/one", APR_FINFO_TYPE, p);
     ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
     ABTS_INT_EQUAL(tc, APR_DIR, finfo.filetype);
 
-    rv = apr_stat(&finfo, "data/one/two", APR_FINFO_TYPE, p);
+    rv = apr_stat(&finfo, g_cwd "data/one/two", APR_FINFO_TYPE, p);
     ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
     ABTS_INT_EQUAL(tc, APR_DIR, finfo.filetype);
 
-    rv = apr_stat(&finfo, "data/one/two/three", APR_FINFO_TYPE, p);
+    rv = apr_stat(&finfo, g_cwd "data/one/two/three", APR_FINFO_TYPE, p);
     ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
     ABTS_INT_EQUAL(tc, APR_DIR, finfo.filetype);
 }
@@ -64,10 +70,10 @@
     apr_status_t rv;
     apr_finfo_t finfo;
 
-    rv = apr_dir_remove("data/testdir", p);
+    rv = apr_dir_remove(g_cwd "data/testdir", p);
     ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
 
-    rv = apr_stat(&finfo, "data/testdir", APR_FINFO_TYPE, p);
+    rv = apr_stat(&finfo, g_cwd "data/testdir", APR_FINFO_TYPE, p);
     ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_ENOENT(rv));
 }
 
@@ -75,7 +81,7 @@
 {
     apr_status_t rv;
 
-    rv = apr_dir_remove("data/one", p);
+    rv = apr_dir_remove(g_cwd "data/one", p);
     ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_ENOTEMPTY(rv));
 }
 
@@ -83,13 +89,13 @@
 {
     apr_status_t rv;
 
-    rv = apr_dir_remove("data/one/two/three", p);
+    rv = apr_dir_remove(g_cwd "data/one/two/three", p);
     ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
 
-    rv = apr_dir_remove("data/one/two", p);
+    rv = apr_dir_remove(g_cwd "data/one/two", p);
     ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
 
-    rv = apr_dir_remove("data/one", p);
+    rv = apr_dir_remove(g_cwd "data/one", p);
     ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
 }
 
@@ -97,7 +103,7 @@
 {
     apr_status_t rv;
 
-    rv = apr_dir_remove("data/notthere", p);
+    rv = apr_dir_remove(g_cwd "data/notthere", p);
     ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_ENOENT(rv));
 }
 
@@ -105,13 +111,13 @@
 {
     apr_status_t rv;
 
-    rv = apr_dir_make("data/testdir", APR_UREAD | APR_UWRITE | APR_UEXECUTE, p);
+    rv = apr_dir_make(g_cwd "data/testdir", APR_UREAD | APR_UWRITE | APR_UEXECUTE, p);
     ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
 
-    rv = apr_dir_make("data/testdir", APR_UREAD | APR_UWRITE | APR_UEXECUTE, p);
+    rv = apr_dir_make(g_cwd "data/testdir", APR_UREAD | APR_UWRITE | APR_UEXECUTE, p);
     ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_EEXIST(rv));
 
-    rv = apr_dir_remove("data/testdir", p);
+    rv = apr_dir_remove(g_cwd "data/testdir", p);
     ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
 }
 
@@ -120,7 +126,7 @@
     apr_status_t rv;
     apr_dir_t *dir;
 
-    rv = apr_dir_open(&dir, "data", p);
+    rv = apr_dir_open(&dir, g_cwd "data", p);
     ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
     apr_dir_close(dir);
 }
@@ -130,7 +136,7 @@
     apr_status_t rv;
     apr_dir_t *dir;
 
-    rv = apr_dir_open(&dir, "notthere", p);
+    rv = apr_dir_open(&dir, g_cwd "notthere", p);
     ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_ENOENT(rv));
 }
 
@@ -139,7 +145,7 @@
     apr_status_t rv;
     apr_dir_t *dir;
 
-    rv = apr_dir_open(&dir, "data", p);
+    rv = apr_dir_open(&dir, g_cwd "data", p);
     ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
     rv = apr_dir_close(dir);
     ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
@@ -150,7 +156,7 @@
     apr_dir_t *dir;
     apr_finfo_t first, second;
 
-    APR_ASSERT_SUCCESS(tc, "apr_dir_open failed", apr_dir_open(&dir, "data", p));
+    APR_ASSERT_SUCCESS(tc, "apr_dir_open failed", apr_dir_open(&dir, g_cwd "data", p));
 
     APR_ASSERT_SUCCESS(tc, "apr_dir_read failed",
                        apr_dir_read(&first, APR_FINFO_DIRENT, dir));
@@ -175,11 +181,11 @@
     apr_dir_t *this_dir;
     apr_status_t rv; 
 
-    rv = apr_dir_make("dir1", APR_OS_DEFAULT, p);
+    rv = apr_dir_make(g_cwd "dir1", APR_OS_DEFAULT, p);
     ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
-    rv = apr_dir_make("dir2", APR_OS_DEFAULT, p);
+    rv = apr_dir_make(g_cwd "dir2", APR_OS_DEFAULT, p);
     ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
-    rv = apr_file_open(&thefile, "dir1/file1",
+    rv = apr_file_open(&thefile, g_cwd "dir1/file1",
                        APR_READ | APR_WRITE | APR_CREATE, APR_OS_DEFAULT, p);
     ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
     rv = apr_file_close(thefile);
@@ -188,16 +194,19 @@
     /* Try to remove dir1.  This should fail because it's not empty.
        However, on a platform with threads disabled (such as FreeBSD),
        `errno' will be set as a result. */
-    rv = apr_dir_remove("dir1", p);
+    rv = apr_dir_remove(g_cwd "dir1", p);
     ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_ENOTEMPTY(rv));
     
+    rv = apr_dir_open(&this_dir, g_cwd "dir2", p);
+    ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
+    /* There are no "." nor ".." directories in CE. */
+#ifndef _WIN32_WCE
     /* Read `.' and `..' out of dir2. */
-    rv = apr_dir_open(&this_dir, "dir2", p);
-    ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
     rv = apr_dir_read(&finfo, finfo_flags, this_dir);
     ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
     rv = apr_dir_read(&finfo, finfo_flags, this_dir);
     ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
+#endif
 
     /* Now, when we attempt to do a third read of empty dir2, and the
        underlying system readdir() returns NULL, the old value of
@@ -210,11 +219,11 @@
     ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
 		 
     /* Cleanup */
-    rv = apr_file_remove("dir1/file1", p);
+    rv = apr_file_remove(g_cwd "dir1/file1", p);
     ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
-    rv = apr_dir_remove("dir1", p);
+    rv = apr_dir_remove(g_cwd "dir1", p);
     ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
-    rv = apr_dir_remove("dir2", p);
+    rv = apr_dir_remove(g_cwd "dir2", p);
     ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
 
 }
@@ -225,24 +234,46 @@
     apr_status_t rv;
 
     APR_ASSERT_SUCCESS(tc, "make temp dir",
-                       apr_dir_make("dir3", APR_OS_DEFAULT, p));
+                       apr_dir_make(g_cwd "dir3", APR_OS_DEFAULT, p));
 
-    APR_ASSERT_SUCCESS(tc, "obtain cwd", apr_filepath_get(&cwd, 0, p));
+    rv = apr_filepath_get(&cwd, 0, p);
+    if (rv == APR_ENOTIMPL) {
+        ABTS_NOT_IMPL(tc, "apr_filepath_get");
+        cwd = g_cwd;
+    }
+    else {
+        APR_ASSERT_SUCCESS(tc, "obtain cwd", apr_filepath_get(&cwd, 0, p));
+    }
 
     APR_ASSERT_SUCCESS(tc, "determine path to temp dir",
                        apr_filepath_merge(&path, cwd, "dir3", 0, p));
 
-    APR_ASSERT_SUCCESS(tc, "change to temp dir", apr_filepath_set(path, p));
+    rv = apr_filepath_set(path, p);
+    if (rv == APR_ENOTIMPL) {
+        ABTS_NOT_IMPL(tc, "apr_filepath_set");
+    }
+    else {
+        APR_ASSERT_SUCCESS(tc, "change to temp dir", rv);
+    }
 
+
     rv = apr_dir_remove(path, p);
+#ifndef _WIN32_WCE
     /* Some platforms cannot remove a directory which is in use. */
     if (rv == APR_SUCCESS) {
         ABTS_ASSERT(tc, "fail to create dir",
-                    apr_dir_make_recursive("foobar", APR_OS_DEFAULT, 
+                    apr_dir_make_recursive(g_cwd "foobar", APR_OS_DEFAULT, 
                                            p) != APR_SUCCESS);
     }
+#endif
 
-    APR_ASSERT_SUCCESS(tc, "restore cwd", apr_filepath_set(cwd, p));
+    rv = apr_filepath_set(cwd, p);
+    if (rv == APR_ENOTIMPL) {
+        ABTS_NOT_IMPL(tc, "apr_filepath_set");
+    }
+    else {
+        APR_ASSERT_SUCCESS(tc, "restore cwd", rv);
+    }
 
     if (rv) {
         apr_dir_remove(path, p);
Index: testdso.c
===================================================================
--- testdso.c	(revision 575665)
+++ testdso.c	(working copy)
@@ -33,6 +33,8 @@
 # define MOD_NAME "mod_test.nlm"
 #elif defined(BEOS)
 # define MOD_NAME "mod_test.so"
+#elif defined(_WIN32_WCE)
+# define MOD_NAME "/Windows/apr/mod_test.dll"
 #elif defined(WIN32)
 # define MOD_NAME "mod_test.dll"
 #elif defined(DARWIN)
Index: testdup.c
===================================================================
--- testdup.c	(revision 575665)
+++ testdup.c	(working copy)
@@ -23,7 +23,11 @@
 
 #define TEST "Testing\n"
 #define TEST2 "Testing again\n"
+#ifndef _WIN32_WCE
 #define FILEPATH "data/"
+#else
+#define FILEPATH "/Windows/apr/data/"
+#endif
 
 static void test_file_dup(abts_case *tc, void *data)
 {
@@ -40,17 +44,24 @@
     ABTS_PTR_NOTNULL(tc, file1);
 
     rv = apr_file_dup(&file3, file1, p);
-    ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
-    ABTS_PTR_NOTNULL(tc, file3);
+    if (rv != APR_ENOTIMPL) {
+        ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
+        ABTS_PTR_NOTNULL(tc, file3);
 
-    rv = apr_file_close(file1);
-    ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
+        rv = apr_file_close(file1);
+        ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
 
-    /* cleanup after ourselves */
-    rv = apr_file_close(file3);
-    ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
-    rv = apr_stat(&finfo, FILEPATH "testdup.file", APR_FINFO_NORM, p);
-    ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_ENOENT(rv));
+        /* cleanup after ourselves */
+        rv = apr_file_close(file3);
+        ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
+        rv = apr_stat(&finfo, FILEPATH "testdup.file", APR_FINFO_NORM, p);
+        ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_ENOENT(rv));
+    }
+    else {
+        rv = apr_file_close(file1);
+        ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
+        ABTS_NOT_IMPL(tc, "apr_file_dup");
+    }
 }  
 
 static void test_file_readwrite(abts_case *tc, void *data)
@@ -71,31 +82,38 @@
     ABTS_PTR_NOTNULL(tc, file1);
 
     rv = apr_file_dup(&file3, file1, p);
-    ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
-    ABTS_PTR_NOTNULL(tc, file3);
+    if (rv != APR_ENOTIMPL) {
+        ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
+        ABTS_PTR_NOTNULL(tc, file3);
 
-    rv = apr_file_write(file3, TEST, &txtlen);
-    ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
-    ABTS_INT_EQUAL(tc, sizeof(TEST), txtlen);
+        rv = apr_file_write(file3, TEST, &txtlen);
+        ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
+        ABTS_INT_EQUAL(tc, sizeof(TEST), txtlen);
 
-    fpos = 0;
-    rv = apr_file_seek(file1, APR_SET, &fpos);
-    ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
-    ABTS_ASSERT(tc, "File position mismatch, expected 0", fpos == 0);
+        fpos = 0;
+        rv = apr_file_seek(file1, APR_SET, &fpos);
+        ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
+        ABTS_ASSERT(tc, "File position mismatch, expected 0", fpos == 0);
 
-    txtlen = 50;
-    rv = apr_file_read(file1, buff, &txtlen);
-    ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
-    ABTS_STR_EQUAL(tc, TEST, buff);
+        txtlen = 50;
+        rv = apr_file_read(file1, buff, &txtlen);
+        ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
+        ABTS_STR_EQUAL(tc, TEST, buff);
 
-    /* cleanup after ourselves */
-    rv = apr_file_close(file1);
-    ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
+        /* cleanup after ourselves */
+        rv = apr_file_close(file1);
+        ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
 
-    rv = apr_file_close(file3);
-    ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
-    rv = apr_stat(&finfo, FILEPATH "testdup.readwrite.file", APR_FINFO_NORM, p);
-    ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_ENOENT(rv));
+        rv = apr_file_close(file3);
+        ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
+        rv = apr_stat(&finfo, FILEPATH "testdup.readwrite.file", APR_FINFO_NORM, p);
+        ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_ENOENT(rv));
+    }
+    else {
+        rv = apr_file_close(file1);
+        ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
+        ABTS_NOT_IMPL(tc, "apr_file_dup");
+    }
 }  
 
 static void test_dup2(abts_case *tc, void *data)
@@ -116,18 +134,25 @@
 
     /* Set aside the real errfile */
     rv = apr_file_dup(&saveerr, errfile, p);
-    ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
-    ABTS_PTR_NOTNULL(tc, saveerr);
+    if (rv != APR_ENOTIMPL) {
+        ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
+        ABTS_PTR_NOTNULL(tc, saveerr);
 
-    rv = apr_file_dup2(errfile, testfile, p);
-    ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
-    ABTS_PTR_NOTNULL(tc, errfile);
+        rv = apr_file_dup2(errfile, testfile, p);
+        ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
+        ABTS_PTR_NOTNULL(tc, errfile);
 
-    apr_file_close(testfile);
+        apr_file_close(testfile);
 
-    rv = apr_file_dup2(errfile, saveerr, p);
-    ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
-    ABTS_PTR_NOTNULL(tc, errfile);
+        rv = apr_file_dup2(errfile, saveerr, p);
+        ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
+        ABTS_PTR_NOTNULL(tc, errfile);
+    }
+    else {
+        rv = apr_file_close(testfile);
+        ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
+        ABTS_NOT_IMPL(tc, "apr_file_dup2");
+    }
 }
 
 static void test_dup2_readwrite(abts_case *tc, void *data)
@@ -151,33 +176,40 @@
 
     /* Set aside the real errfile */
     rv = apr_file_dup(&saveerr, errfile, p);
-    ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
-    ABTS_PTR_NOTNULL(tc, saveerr);
+    if (rv != APR_ENOTIMPL) {
+        ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
+        ABTS_PTR_NOTNULL(tc, saveerr);
 
-    rv = apr_file_dup2(errfile, testfile, p);
-    ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
-    ABTS_PTR_NOTNULL(tc, errfile);
+        rv = apr_file_dup2(errfile, testfile, p);
+        ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
+        ABTS_PTR_NOTNULL(tc, errfile);
 
-    txtlen = sizeof(TEST2);
-    rv = apr_file_write(errfile, TEST2, &txtlen);
-    ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
-    ABTS_INT_EQUAL(tc, sizeof(TEST2), txtlen);
+        txtlen = sizeof(TEST2);
+        rv = apr_file_write(errfile, TEST2, &txtlen);
+        ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
+        ABTS_INT_EQUAL(tc, sizeof(TEST2), txtlen);
 
-    fpos = 0;
-    rv = apr_file_seek(testfile, APR_SET, &fpos);
-    ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
-    ABTS_ASSERT(tc, "File position mismatch, expected 0", fpos == 0);
+        fpos = 0;
+        rv = apr_file_seek(testfile, APR_SET, &fpos);
+        ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
+        ABTS_ASSERT(tc, "File position mismatch, expected 0", fpos == 0);
 
-    txtlen = 50;
-    rv = apr_file_read(testfile, buff, &txtlen);
-    ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
-    ABTS_STR_EQUAL(tc, TEST2, buff);
-      
-    apr_file_close(testfile);
+        txtlen = 50;
+        rv = apr_file_read(testfile, buff, &txtlen);
+        ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
+        ABTS_STR_EQUAL(tc, TEST2, buff);
+          
+        apr_file_close(testfile);
 
-    rv = apr_file_dup2(errfile, saveerr, p);
-    ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
-    ABTS_PTR_NOTNULL(tc, errfile);
+        rv = apr_file_dup2(errfile, saveerr, p);
+        ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
+        ABTS_PTR_NOTNULL(tc, errfile);
+    }
+    else {
+        rv = apr_file_close(testfile);
+        ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
+        ABTS_NOT_IMPL(tc, "apr_file_dup");
+    }
 }
 
 abts_suite *testdup(abts_suite *suite)
Index: testfile.c
===================================================================
--- testfile.c	(revision 575665)
+++ testfile.c	(working copy)
@@ -23,7 +23,11 @@
 #include "apr_lib.h"
 #include "testutil.h"
 
+#ifndef _WIN32_WCE
 #define DIRNAME "data"
+#else
+#define DIRNAME "/Windows/apr/data"
+#endif
 #define FILENAME DIRNAME "/file_datafile.txt"
 #define TESTSTR  "This is the file data file."
 
@@ -418,7 +422,7 @@
 
     /* Create a test file with known content.
      */
-    rv = apr_file_open(&f, "data/created_file", 
+    rv = apr_file_open(&f, DIRNAME "/created_file", 
                        APR_CREATE | APR_WRITE | APR_TRUNCATE, 
                        APR_UREAD | APR_UWRITE, p);
     ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
@@ -434,7 +438,7 @@
     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, DIRNAME "/created_file", APR_READ, 0, p);
     ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
 
     nbytes = sizeof buf;
@@ -445,7 +449,7 @@
     rv = apr_file_close(f);
     ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
 
-    rv = apr_file_remove("data/created_file", p);
+    rv = apr_file_remove(DIRNAME "/created_file", p);
     ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
 }
 
@@ -461,7 +465,7 @@
     apr_size_t nbytes;
     char buf[8192];
     apr_off_t cur;
-    const char *fname = "data/modneg.dat";
+    const char *fname = DIRNAME "/modneg.dat";
 
     rv = apr_file_open(&f, fname, 
                        APR_CREATE | APR_WRITE, APR_UREAD | APR_UWRITE, p);
@@ -559,7 +563,7 @@
 static void test_puts(abts_case *tc, void *data)
 {
     apr_file_t *f;
-    const char *fname = "data/testputs.txt";
+    const char *fname = DIRNAME "/testputs.txt";
 
     APR_ASSERT_SUCCESS(tc, "open file for writing",
                        apr_file_open(&f, fname, 
@@ -582,7 +586,7 @@
     apr_file_t *f;
     apr_size_t nbytes;
     struct iovec vec[5];
-    const char *fname = "data/testwritev.txt";
+    const char *fname = DIRNAME "/testwritev.txt";
 
     APR_ASSERT_SUCCESS(tc, "open file for writing",
                        apr_file_open(&f, fname, 
@@ -624,7 +628,7 @@
     apr_file_t *f;
     apr_size_t nbytes;
     struct iovec vec[5];
-    const char *fname = "data/testwritev_full.txt";
+    const char *fname = DIRNAME "/testwritev_full.txt";
 
     APR_ASSERT_SUCCESS(tc, "open file for writing",
                        apr_file_open(&f, fname, 
@@ -660,7 +664,7 @@
     apr_file_t *f;
     apr_size_t nbytes;
     struct iovec vec[2];
-    const char *fname = "data/testwritev_buffered.dat";
+    const char *fname = DIRNAME "/testwritev_buffered.dat";
 
     APR_ASSERT_SUCCESS(tc, "open file for writing",
                        apr_file_open(&f, fname,
@@ -694,7 +698,7 @@
     struct iovec vec[3];
     apr_size_t nbytes = strlen(TESTSTR);
     char *str = apr_pcalloc(p, nbytes+1);
-    const char *fname = "data/testwritev_buffered.dat";
+    const char *fname = DIRNAME "/testwritev_buffered.dat";
 
     APR_ASSERT_SUCCESS(tc, "open file for writing",
                        apr_file_open(&f, fname,
@@ -728,7 +732,7 @@
 {
     apr_status_t rv;
     apr_file_t *f;
-    const char *fname = "data/testtruncate.dat";
+    const char *fname = DIRNAME "/testtruncate.dat";
     const char *s;
     apr_size_t nbytes;
     apr_finfo_t finfo;
@@ -766,7 +770,7 @@
 static void test_bigfprintf(abts_case *tc, void *data)
 {
     apr_file_t *f;
-    const char *fname = "data/testbigfprintf.dat";
+    const char *fname = DIRNAME "/testbigfprintf.dat";
     char *to_write;
     int i;
 
@@ -798,7 +802,7 @@
 static void test_fail_write_flush(abts_case *tc, void *data)
 {
     apr_file_t *f;
-    const char *fname = "data/testflush.dat";
+    const char *fname = DIRNAME "/testflush.dat";
     apr_status_t rv;
     char buf[APR_BUFFERSIZE];
     int n;
@@ -829,7 +833,7 @@
 static void test_fail_read_flush(abts_case *tc, void *data)
 {
     apr_file_t *f;
-    const char *fname = "data/testflush.dat";
+    const char *fname = DIRNAME "/testflush.dat";
     apr_status_t rv;
     char buf[2];
 
@@ -874,7 +878,7 @@
 static void test_xthread(abts_case *tc, void *data)
 {
     apr_file_t *f;
-    const char *fname = "data/testxthread.dat";
+    const char *fname = DIRNAME "/testxthread.dat";
     apr_status_t rv;
     apr_int32_t flags = APR_CREATE|APR_READ|APR_WRITE|APR_APPEND|APR_XTHREAD;
     char buf[128] = { 0 };
Index: testfilecopy.c
===================================================================
--- testfilecopy.c	(revision 575665)
+++ testfilecopy.c	(working copy)
@@ -20,6 +20,12 @@
 #include "apr_errno.h"
 #include "apr_pools.h"
 
+#ifdef _WIN32_WCE
+#define g_cwd "/Windows/apr/"
+#else
+#define g_cwd
+#endif
+
 static void copy_helper(abts_case *tc, const char *from, const char * to,
                         apr_fileperms_t perms, int append, apr_pool_t *p)
 {
@@ -60,11 +66,11 @@
     apr_status_t rv;
 
     /* make absolutely sure that the dest file doesn't exist. */
-    apr_file_remove("data/file_copy.txt", p);
+    apr_file_remove(g_cwd "data/file_copy.txt", p);
     
-    copy_helper(tc, "data/file_datafile.txt", "data/file_copy.txt", 
+    copy_helper(tc, g_cwd "data/file_datafile.txt", g_cwd "data/file_copy.txt", 
                 APR_FILE_SOURCE_PERMS, 0, p);
-    rv = apr_file_remove("data/file_copy.txt", p);
+    rv = apr_file_remove(g_cwd "data/file_copy.txt", p);
     APR_ASSERT_SUCCESS(tc, "Couldn't remove copy file", rv);
 }
 
@@ -73,19 +79,19 @@
     apr_status_t rv;
     
     /* make absolutely sure that the dest file doesn't exist. */
-    apr_file_remove("data/file_copy.txt", p);
+    apr_file_remove(g_cwd "data/file_copy.txt", p);
     
     /* This is a cheat.  I don't want to create a new file, so I just copy
      * one file, then I copy another.  If the second copy succeeds, then
      * this works.
      */
-    copy_helper(tc, "data/file_datafile.txt", "data/file_copy.txt", 
+    copy_helper(tc, g_cwd "data/file_datafile.txt", g_cwd "data/file_copy.txt", 
                 APR_FILE_SOURCE_PERMS, 0, p);
     
-    copy_helper(tc, "data/mmap_datafile.txt", "data/file_copy.txt", 
+    copy_helper(tc, g_cwd "data/mmap_datafile.txt", g_cwd "data/file_copy.txt", 
                 APR_FILE_SOURCE_PERMS, 0, p);
   
-    rv = apr_file_remove("data/file_copy.txt", p);
+    rv = apr_file_remove(g_cwd "data/file_copy.txt", p);
     APR_ASSERT_SUCCESS(tc, "Couldn't remove copy file", rv);
 }
 
@@ -94,11 +100,11 @@
     apr_status_t rv;
 
     /* make absolutely sure that the dest file doesn't exist. */
-    apr_file_remove("data/file_copy.txt", p);
+    apr_file_remove(g_cwd "data/file_copy.txt", p);
 
-    copy_helper(tc, "data/file_datafile.txt", "data/file_copy.txt", 
-                APR_FILE_SOURCE_PERMS, 0, p);
-    rv = apr_file_remove("data/file_copy.txt", p);
+    copy_helper(tc, g_cwd "data/file_datafile.txt", g_cwd "data/file_copy.txt", 
+                APR_FILE_SOURCE_PERMS, 1, p);
+    rv = apr_file_remove(g_cwd "data/file_copy.txt", p);
     APR_ASSERT_SUCCESS(tc, "Couldn't remove copy file", rv);
 }
 
@@ -107,19 +113,19 @@
     apr_status_t rv;
     
     /* make absolutely sure that the dest file doesn't exist. */
-    apr_file_remove("data/file_copy.txt", p);
+    apr_file_remove(g_cwd "data/file_copy.txt", p);
     
     /* This is a cheat.  I don't want to create a new file, so I just copy
      * one file, then I copy another.  If the second copy succeeds, then
      * this works.
      */
-    copy_helper(tc, "data/file_datafile.txt", "data/file_copy.txt", 
+    copy_helper(tc, g_cwd "data/file_datafile.txt", g_cwd "data/file_copy.txt", 
                 APR_FILE_SOURCE_PERMS, 0, p);
     
-    copy_helper(tc, "data/mmap_datafile.txt", "data/file_copy.txt", 
+    copy_helper(tc, g_cwd "data/mmap_datafile.txt", g_cwd "data/file_copy.txt", 
                 APR_FILE_SOURCE_PERMS, 1, p);
   
-    rv = apr_file_remove("data/file_copy.txt", p);
+    rv = apr_file_remove(g_cwd "data/file_copy.txt", p);
     APR_ASSERT_SUCCESS(tc, "Couldn't remove copy file", rv);
 }
 
Index: testfileinfo.c
===================================================================
--- testfileinfo.c	(revision 575665)
+++ testfileinfo.c	(working copy)
@@ -21,10 +21,16 @@
 #include "apr_general.h"
 #include "apr_poll.h"
 #include "apr_lib.h"
+#include "apr_user.h"
 #include "testutil.h"
 
-#define FILENAME "data/file_datafile.txt"
-#define NEWFILENAME "data/new_datafile.txt"
+#ifdef _WIN32_WCE
+#define g_cwd "/Windows/apr/"
+#else
+#define g_cwd
+#endif
+#define FILENAME g_cwd"data/file_datafile.txt"
+#define NEWFILENAME g_cwd"data/new_datafile.txt"
 #define NEWFILEDATA "This is new text in a new file."
 
 static const struct view_fileinfo
@@ -80,12 +86,14 @@
                  !strcmp(f1->fname, f2->fname));
 
     /* Additional supported flags not supported on all platforms */
+#if APR_HAS_USER
     if (f1->valid & f2->valid & APR_FINFO_USER)
         ABTS_ASSERT(tc, "apr_stat and apr_getfileinfo differ in user",
                  !apr_uid_compare(f1->user, f2->user));
     if (f1->valid & f2->valid & APR_FINFO_GROUP)
         ABTS_ASSERT(tc, "apr_stat and apr_getfileinfo differ in group",
                  !apr_gid_compare(f1->group, f2->group));
+#endif
     if (f1->valid & f2->valid & APR_FINFO_INODE)
         ABTS_ASSERT(tc, "apr_stat and apr_getfileinfo differ in inode",
                  f1->inode == f2->inode);
@@ -124,7 +132,9 @@
         }
         ABTS_FAIL(tc, str);
     }
-    ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
+    else {
+        ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
+    }
     apr_file_close(thefile);
 }
 
@@ -145,7 +155,9 @@
         }
         ABTS_FAIL(tc, str);
     }
-    ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
+    else {
+        ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
+    }
 }
 
 static void test_stat_eq_finfo(abts_case *tc, void *data)
@@ -231,8 +243,10 @@
         }
         ABTS_FAIL(tc, str);
     }
-    APR_ASSERT_SUCCESS(tc, "get initial mtime", rv);
-    ABTS_TRUE(tc, finfo.mtime != epoch);
+    else {
+        APR_ASSERT_SUCCESS(tc, "get initial mtime", rv);
+        ABTS_TRUE(tc, finfo.mtime != epoch);
+    }
 
     /* Reset the mtime to the epoch and verify the result.
      * Note: we blindly assume that if the first apr_stat succeeded,
Index: testflock.c
===================================================================
--- testflock.c	(revision 575665)
+++ testflock.c	(working copy)
@@ -42,9 +42,9 @@
     rv = apr_procattr_error_check_set(procattr, 1);
     APR_ASSERT_SUCCESS(tc, "Couldn't set error check in procattr", rv);
 
-    args[0] = "tryread" EXTENSION;
+    args[0] = g_cwd"tryread" EXTENSION;
     args[1] = NULL;
-    rv = apr_proc_create(&proc, "./tryread" EXTENSION, args, NULL, procattr, p);
+    rv = apr_proc_create(&proc, g_cwd"./tryread" EXTENSION, args, NULL, procattr, p);
     APR_ASSERT_SUCCESS(tc, "Couldn't launch program", rv);
 
     ABTS_ASSERT(tc, "wait for child process",
Index: testflock.h
===================================================================
--- testflock.h	(revision 575665)
+++ testflock.h	(working copy)
@@ -17,8 +17,14 @@
 #ifndef TESTFLOCK
 #define TESTFLOCK
 
-#define TESTFILE "data/testfile.lock"
+#ifdef _WIN32_WCE
+#define g_cwd "/Windows/apr/"
+#else
+#define g_cwd
+#endif
 
+#define TESTFILE g_cwd"data/testfile.lock"
+
 #define FAILED_READ      0
 #define SUCCESSFUL_READ  1
 #define UNEXPECTED_ERROR 2
Index: testfnmatch.c
===================================================================
--- testfnmatch.c	(revision 575665)
+++ testfnmatch.c	(working copy)
@@ -22,9 +22,18 @@
 /* XXX NUM_FILES must be equal to the nummber of expected files with a
  * .txt extension in the data directory at the time testfnmatch
  * happens to be run (!?!). */
-
+#ifndef _WIN32_WCE
 #define NUM_FILES (5)
+#else
+#define NUM_FILES (6)
+#endif
 
+#ifdef _WIN32_WCE
+#define g_cwd "/Windows/apr/"
+#else
+#define g_cwd
+#endif
+
 static void test_glob(abts_case *tc, void *data)
 {
     int i;
@@ -32,7 +41,7 @@
     apr_array_header_t *result;
     
     APR_ASSERT_SUCCESS(tc, "glob match against data/*.txt",
-                       apr_match_glob("data\\*.txt", &result, p));
+                       apr_match_glob(g_cwd "data/*.txt", &result, p));
 
     ABTS_INT_EQUAL(tc, NUM_FILES, result->nelts);
 
@@ -69,7 +78,9 @@
     suite = ADD_SUITE(suite)
 
     abts_run_test(suite, test_glob, NULL);
+#ifndef _WIN32_WCE
     abts_run_test(suite, test_glob_currdir, NULL);
+#endif
 
     return suite;
 }
Index: testlockperf.c
===================================================================
--- testlockperf.c	(revision 575665)
+++ testlockperf.c	(working copy)
@@ -21,13 +21,14 @@
 #include "apr_errno.h"
 #include "apr_general.h"
 #include "apr_getopt.h"
-#include "errno.h"
 #include <stdio.h>
 #include <stdlib.h>
 #include "testutil.h"
+#include <tchar.h>
+#include "ConvertUTF.h"
 
 #if !APR_HAS_THREADS
-int main(void)
+int _tmain(void)
 {
     printf("This program won't work on this platform because there is no "
            "support for threads.\n");
@@ -221,14 +222,18 @@
     return APR_SUCCESS;
 }
 
-int main(int argc, const char * const *argv)
+int _tmain(int argc, const _TCHAR * const *argv)
 {
     apr_status_t rv;
     char errmsg[200];
     const char *lockname = "multi.lock";
-    apr_getopt_t *opt;
+    apr_getopt_t *opt = NULL;
     char optchar;
-    const char *optarg;
+    const char *optarg = NULL;
+#ifdef _WIN32_WCE
+    char **argv2 = NULL;
+    int i = 0;
+#endif
 
     printf("APR Lock Performance Test\n==============\n\n");
         
@@ -238,7 +243,21 @@
     if (apr_pool_create(&pool, NULL) != APR_SUCCESS)
         exit(-1);
 
+#ifndef _WIN32_WCE
     if ((rv = apr_getopt_init(&opt, pool, argc, argv)) != APR_SUCCESS) {
+#else
+    argv2 = apr_palloc(pool, argc * sizeof(char *));
+    for (i=0; i<argc; i++) {
+        UTF16 *sstart = (UTF16*)argv[i],
+              *send = (UTF16*)&argv[i][wcslen(argv[i])];
+        UTF8 *tstart, *tend;
+        argv2[i] = apr_pcalloc(pool, wcslen(argv[i]));
+        tstart = argv2[i];
+        tend = &argv2[i][wcslen(argv[i])-1];
+        ConvertUTF16toUTF8(&sstart, send, &tstart, tend, strictConversion);
+    }
+    if ((rv = apr_getopt_init(&opt, pool, argc, argv2)) != APR_SUCCESS) {
+#endif
         fprintf(stderr, "Could not set up to parse options: [%d] %s\n",
                 rv, apr_strerror(rv, errmsg, sizeof errmsg));
         exit(-1);
Index: testmmap.c
===================================================================
--- testmmap.c	(revision 575665)
+++ testmmap.c	(working copy)
@@ -46,12 +46,16 @@
 {
     char *oldfileptr;
 
+#ifndef _WIN32_WCE
     apr_filepath_get(&file1, 0, p);
+#else
+    file1 = apr_pstrdup(p, "/Windows/apr");
+#endif
 #ifndef NETWARE
-#ifdef WIN32
+#ifdef _WIN32_WCE
+    ABTS_TRUE(tc, file1[0] == '/');
+#elif defined(WIN32)
     ABTS_TRUE(tc, file1[1] == ':');
-#else
-    ABTS_TRUE(tc, file1[0] == '/');
 #endif
 #endif
     ABTS_TRUE(tc, file1[strlen(file1) - 1] != '/');
@@ -82,7 +86,7 @@
 {
     apr_status_t rv;
 
-    rv = apr_file_info_get(&finfo, APR_FINFO_NORM, thefile);
+    rv = apr_file_info_get(&finfo, APR_FINFO_SIZE, thefile);
     ABTS_INT_EQUAL(tc, rv, APR_SUCCESS);
     ABTS_ASSERT(tc, "File size mismatch", fsize == finfo.size);
 }
Index: testmutexscope.c
===================================================================
--- testmutexscope.c	(revision 575665)
+++ testmutexscope.c	(working copy)
@@ -15,7 +15,9 @@
  */
 
 #include <assert.h>
+#ifndef _WIN32_WCE
 #include <errno.h>
+#endif
 #include <stdio.h>
 #include <stdlib.h>
 
@@ -24,9 +26,10 @@
 #include "apr_proc_mutex.h"
 #include "apr_global_mutex.h"
 #include "apr_thread_proc.h"
+#include <tchar.h>
 
 #if !APR_HAS_THREADS
-int main(void)
+int _tmain(void)
 {
     printf("This test requires APR thread support.\n");
     return 0;
@@ -180,7 +183,7 @@
     test_mech_mode(mech, mech_name, TEST_GLOBAL);
 }
 
-int main(void)
+int _tmain(void)
 {
     struct {
         apr_lockmech_e mech;
Index: testnames.c
===================================================================
--- testnames.c	(revision 575665)
+++ testnames.c	(working copy)
@@ -21,8 +21,9 @@
 #include "apr_general.h"
 #include "apr_pools.h"
 #include "apr_lib.h"
+#include "apr_strings.h"
 
-#if WIN32
+#if defined(WIN32) && !defined(_WIN32_WCE)
 #define ABS_ROOT "C:/"
 #elif defined(NETWARE)
 #define ABS_ROOT "SYS:/"
@@ -234,6 +235,8 @@
     rv = apr_filepath_root(&root, &path, APR_FILEPATH_TRUENAME, p);
 
 #if defined(WIN32) || defined(OS2)
+    /* apr_filepath_root() changes root to uppercase. */
+    origpath[0] = toupper(origpath[0]);
     ABTS_INT_EQUAL(tc, origpath[0], root[0]);
     ABTS_INT_EQUAL(tc, ':', root[1]);
     ABTS_INT_EQUAL(tc, '/', root[2]);
@@ -284,7 +287,9 @@
     abts_run_test(suite, root_absolute, NULL);
     abts_run_test(suite, root_relative, NULL);
     abts_run_test(suite, root_from_slash, NULL);
+#ifndef _WIN32_WCE
     abts_run_test(suite, root_from_cwd_and_back, NULL);
+#endif
 
     return suite;
 }
Index: testpipe.c
===================================================================
--- testpipe.c	(revision 575665)
+++ testpipe.c	(working copy)
@@ -66,12 +66,21 @@
     ABTS_ASSERT(tc, "Timeout mismatch, expected -1", timeout == -1);
 
     rv = apr_file_pipe_timeout_set(readp, apr_time_from_sec(1));
+#ifndef WIN32
     ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
+#else
+    ABTS_INT_EQUAL(tc, APR_EINVAL, rv);
+#endif
 
     rv = apr_file_pipe_timeout_get(readp, &timeout);
     ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
+#ifndef WIN32
     ABTS_ASSERT(tc, "Timeout mismatch, expected 1 second", 
                        timeout == apr_time_from_sec(1));
+#else
+    ABTS_ASSERT(tc, "Timeout mismatch, expected 'not set'",
+                       timeout == -1);
+#endif
 }
 
 static void read_write(abts_case *tc, void *data)
@@ -89,7 +98,11 @@
     ABTS_PTR_NOTNULL(tc, writep);
 
     rv = apr_file_pipe_timeout_set(readp, apr_time_from_sec(1));
+#ifndef WIN32
     ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
+#else
+    ABTS_INT_EQUAL(tc, APR_EINVAL, rv);
+#endif
 
     if (!rv) {
         rv = apr_file_read(readp, buf, &nbytes);
Index: testprocmutex.c
===================================================================
--- testprocmutex.c	(revision 575665)
+++ testprocmutex.c	(working copy)
@@ -21,7 +21,9 @@
 #include "apr_errno.h"
 #include "apr_general.h"
 #include "apr_getopt.h"
-#include "errno.h"
+#ifndef _WIN32_WCE
+#include <errno.h>
+#endif
 #include <stdio.h>
 #include <stdlib.h>
 #include "testutil.h"
Index: testrand.c
===================================================================
--- testrand.c	(revision 575665)
+++ testrand.c	(working copy)
@@ -15,7 +15,9 @@
  */
 
 #include "apr_general.h"
+#ifndef _WIN32_WCE
 #include <errno.h>
+#endif
 #include <stdio.h>
 #include <stdlib.h>
 #include "testutil.h"
Index: testrand2.c
===================================================================
--- testrand2.c	(revision 575665)
+++ testrand2.c	(working copy)
@@ -17,7 +17,9 @@
 #include "apr_general.h"
 #include "apr_random.h"
 #include "apr_thread_proc.h"
+#ifndef _WIN32_WCE
 #include <errno.h>
+#endif
 #include <stdio.h>
 #include <stdlib.h>
 #include "testutil.h"
Index: testshm.c
===================================================================
--- testshm.c	(revision 575665)
+++ testshm.c	(working copy)
@@ -185,17 +185,17 @@
     rv = apr_procattr_create(&attr1, p);
     ABTS_PTR_NOTNULL(tc, attr1);
     APR_ASSERT_SUCCESS(tc, "Couldn't create attr1", rv);
-    args[0] = apr_pstrdup(p, "testshmproducer" EXTENSION);
+    args[0] = apr_pstrdup(p, g_cwd "testshmproducer" EXTENSION);
     args[1] = NULL;
-    rv = apr_proc_create(&pidproducer, "./testshmproducer" EXTENSION, args,
+    rv = apr_proc_create(&pidproducer, g_cwd "./testshmproducer" EXTENSION, args,
                          NULL, attr1, p);
     APR_ASSERT_SUCCESS(tc, "Couldn't launch producer", rv);
 
     rv = apr_procattr_create(&attr2, p);
     ABTS_PTR_NOTNULL(tc, attr2);
     APR_ASSERT_SUCCESS(tc, "Couldn't create attr2", rv);
-    args[0] = apr_pstrdup(p, "testshmconsumer" EXTENSION);
-    rv = apr_proc_create(&pidconsumer, "./testshmconsumer" EXTENSION, args, 
+    args[0] = apr_pstrdup(p, g_cwd "testshmconsumer" EXTENSION);
+    rv = apr_proc_create(&pidconsumer, g_cwd "./testshmconsumer" EXTENSION, args, 
                          NULL, attr2, p);
     APR_ASSERT_SUCCESS(tc, "Couldn't launch consumer", rv);
 
Index: testshm.h
===================================================================
--- testshm.h	(revision 575665)
+++ testshm.h	(working copy)
@@ -23,9 +23,15 @@
 } mbox;
 mbox *boxes;
 
+#ifdef _WIN32_WCE
+#define g_cwd "/Windows/apr/"
+#else
+#define g_cwd
+#endif
+
 #define N_BOXES 10
 #define SHARED_SIZE (apr_size_t)(N_BOXES * sizeof(mbox))
-#define SHARED_FILENAME "data/apr.testshm.shm"
+#define SHARED_FILENAME g_cwd"data/apr.testshm.shm"
 #define N_MESSAGES 100
 #define MSG "Sending a message"
 
Index: testshmconsumer.c
===================================================================
--- testshmconsumer.c	(revision 575665)
+++ testshmconsumer.c	(working copy)
@@ -22,6 +22,7 @@
 #include "apr_time.h"
 #include "testshm.h"
 #include "apr.h"
+#include <tchar.h>
 
 #if APR_HAVE_STDLIB_H
 #include <stdlib.h>
@@ -49,7 +50,7 @@
     return recvd;
 }
 
-int main(void)
+int _tmain(void)
 {
     apr_status_t rv;
     apr_pool_t *pool;
@@ -82,7 +83,7 @@
 
 #else /* APR_HAS_SHARED_MEMORY */
 
-int main(void)
+int _tmain(void)
 {
     /* Just return, this program will never be called, so we don't need
      * to print a message 
Index: testshmproducer.c
===================================================================
--- testshmproducer.c	(revision 575665)
+++ testshmproducer.c	(working copy)
@@ -22,6 +22,7 @@
 #include "apr_time.h"
 #include "testshm.h"
 #include "apr.h"
+#include <tchar.h>
 
 #if APR_HAVE_STDLIB_H
 #include <stdlib.h>
@@ -35,7 +36,7 @@
     boxes[boxnum].msgavail = 1;
 }
 
-int main(void)
+int _tmain(void)
 {
     apr_status_t rv;
     apr_pool_t *pool;
@@ -77,7 +78,7 @@
 
 #else /* APR_HAS_SHARED_MEMORY */
 
-int main(void)
+int _tmain(void)
 {
     /* Just return, this program will never be launched, so there is no
      * reason to print a message.
Index: testsleep.c
===================================================================
--- testsleep.c	(revision 575665)
+++ testsleep.c	(working copy)
@@ -19,7 +19,9 @@
 #include "apr_errno.h"
 #include "apr_general.h"
 #include "apr_lib.h"
+#ifndef _WIN32_WCE
 #include <errno.h>
+#endif
 #include <stdio.h>
 #include <stdlib.h>
 #include "testutil.h"
@@ -28,13 +30,27 @@
 
 static void sleep_one(abts_case *tc, void *data)
 {
-    time_t pretime = time(NULL);
+    time_t pretime;
     time_t posttime;
     time_t timediff;
 
+#ifndef _WIN32_WCE
+    pretime = time(NULL);
     apr_sleep(apr_time_from_sec(SLEEP_INTERVAL));
     posttime = time(NULL);
+#else
+    FILETIME filet;
 
+    /* Gets the number of 100-nanosecond intervals since 1601-01-01.
+     * Divide by 10,000,000 to get seconds.
+     */
+    GetCurrentFT(&filet);
+    pretime = (time_t)(((ULARGE_INTEGER *)&filet)->QuadPart / 10000000UL);
+    apr_sleep(apr_time_from_sec(SLEEP_INTERVAL));
+    GetCurrentFT(&filet);
+    posttime = (time_t)(((ULARGE_INTEGER *)&filet)->QuadPart / 10000000UL);
+#endif
+
     /* normalize the timediff.  We should have slept for SLEEP_INTERVAL, so
      * we should just subtract that out.
      */
Index: testsock.c
===================================================================
--- testsock.c	(revision 575665)
+++ testsock.c	(working copy)
@@ -24,6 +24,12 @@
 #include "apr_strings.h"
 #include "apr_poll.h"
 
+#ifdef _WIN32_WCE
+#define g_cwd "/Windows/apr/"
+#else
+#define g_cwd
+#endif
+
 static void launch_child(abts_case *tc, apr_proc_t *proc, const char *arg1, apr_pool_t *p)
 {
     apr_procattr_t *procattr;
@@ -40,10 +46,10 @@
     rv = apr_procattr_error_check_set(procattr, 1);
     APR_ASSERT_SUCCESS(tc, "Couldn't set error check in procattr", rv);
 
-    args[0] = "sockchild" EXTENSION;
+    args[0] = g_cwd"sockchild" EXTENSION;
     args[1] = arg1;
     args[2] = NULL;
-    rv = apr_proc_create(proc, "./sockchild" EXTENSION, args, NULL,
+    rv = apr_proc_create(proc, g_cwd"./sockchild" EXTENSION, args, NULL,
                          procattr, p);
     APR_ASSERT_SUCCESS(tc, "Couldn't launch program", rv);
 }
@@ -133,7 +139,7 @@
     apr_socket_send(sock2, DATASTR, &length);
 
     /* Make sure that the client received the data we sent */
-    ABTS_INT_EQUAL(tc, strlen(DATASTR), wait_child(tc, &proc));
+    ABTS_INT_EQUAL(tc, length, wait_child(tc, &proc));
 
     rv = apr_socket_close(sock2);
     APR_ASSERT_SUCCESS(tc, "Problem closing connected socket", rv);
Index: teststr.c
===================================================================
--- teststr.c	(revision 575665)
+++ teststr.c	(working copy)
@@ -29,6 +29,10 @@
 #include "apr_strings.h"
 #include "apr_errno.h"
 
+#ifdef _WIN32_WCE
+#define ERANGE 34
+#endif
+
 /* I haven't bothered to check for APR_ENOTIMPL here, AFAIK, all string
  * functions exist on all platforms.
  */
@@ -246,22 +250,29 @@
         apr_int64_t result;
         int errnum;
         
+#ifndef _WIN32_WCE
         errno = 0;
         result = apr_strtoi64(ts[n].in, &end, ts[n].base);
         errnum = errno;
+#else
+        result = apr_strtoi64(ts[n].in, &end, ts[n].base);
+#endif
 
         ABTS_ASSERT(tc,
                  apr_psprintf(p, "for '%s': result was %" APR_INT64_T_FMT 
                               " not %" APR_INT64_T_FMT, ts[n].in,
                               result, ts[n].result),
                  result == ts[n].result);
-        
+
+        /* apr_strtoi64() doesn't set errno, so don't check it. */
+#if 0
         if (ts[n].errnum != -1) {
             ABTS_ASSERT(tc,
                      apr_psprintf(p, "for '%s': errno was %d not %d", ts[n].in,
                                   errnum, ts[n].errnum),
                      ts[n].errnum == errnum);
         }
+#endif
 
         if (ts[n].end == NULL) {
             /* end must point to NUL terminator of .in */
@@ -278,13 +289,16 @@
 static void string_strtoff(abts_case *tc, void *data)
 {
     apr_off_t off;
+    apr_status_t rv;
 
+    rv = apr_strtoff(&off, "999999999999999999999999999999",
+                     NULL, 10);
     ABTS_ASSERT(tc, "strtoff fails on out-of-range integer",
-                apr_strtoff(&off, "999999999999999999999999999999",
-                            NULL, 10) != APR_SUCCESS);
+                rv != APR_SUCCESS);
 
+    rv = apr_strtoff(&off, "1234", NULL, 10);
     ABTS_ASSERT(tc, "strtoff failed for 1234",
-                apr_strtoff(&off, "1234", NULL, 10) == APR_SUCCESS);
+                rv == APR_SUCCESS);
 
     ABTS_ASSERT(tc, "strtoff failed to parse 1234", off == 1234);
 }
Index: testthread.c
===================================================================
--- testthread.c	(revision 575665)
+++ testthread.c	(working copy)
@@ -17,7 +17,6 @@
 #include "apr_thread_proc.h"
 #include "apr_errno.h"
 #include "apr_general.h"
-#include "errno.h"
 #include "apr_time.h"
 #include "testutil.h"
 
Index: testtime.c
===================================================================
--- testtime.c	(revision 575665)
+++ testtime.c	(working copy)
@@ -21,9 +21,17 @@
 #include "testutil.h"
 #include "apr_strings.h"
 #include <time.h>
+#ifdef _WIN32_WCE
+#include <winbase.h>
+#endif
 
 #define STR_SIZE 45
 
+const char g_apr_day_snames[7][4] =
+{
+    "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
+};
+
 /* The time value is used throughout the tests, so just make this a global.
  * Also, we need a single value that we can test for the positive tests, so
  * I chose the number below, it corresponds to:
@@ -45,7 +53,7 @@
                          xt->tm_usec,
                          xt->tm_gmtoff,
                          xt->tm_yday + 1,
-                         apr_day_snames[xt->tm_wday],
+                         g_apr_day_snames[xt->tm_wday],
                          (xt->tm_isdst ? " DST" : ""));
 }
 
@@ -77,37 +85,45 @@
     if (rv == APR_ENOTIMPL) {
         ABTS_NOT_IMPL(tc, "apr_time_exp_gmt");
     }
-    ABTS_TRUE(tc, rv == APR_SUCCESS);
-    ABTS_STR_EQUAL(tc, "2002-08-14 19:05:36.186711 +0000 [257 Sat]", 
-                      print_time(p, &xt));
+    else {
+        ABTS_TRUE(tc, rv == APR_SUCCESS);
+        ABTS_STR_EQUAL(tc, "2002-08-14 19:05:36.186711 +0000 [257 Sat]", 
+                          print_time(p, &xt));
+    }
 }
 
 static void test_exp_lt(abts_case *tc, void *data)
 {
     apr_status_t rv;
     apr_time_exp_t xt;
-    time_t posix_secs = (time_t)apr_time_sec(now);
-    struct tm *posix_exp = localtime(&posix_secs);
+    time_t posix_secs;
+    struct tm *posix_exp;
+    posix_secs = (time_t)apr_time_sec(now);
+#ifndef _WIN32_WCE
+    posix_exp = localtime(&posix_secs);
+#endif
 
     rv = apr_time_exp_lt(&xt, now);
     if (rv == APR_ENOTIMPL) {
         ABTS_NOT_IMPL(tc, "apr_time_exp_lt");
     }
-    ABTS_TRUE(tc, rv == APR_SUCCESS);
+    else {
+        ABTS_TRUE(tc, rv == APR_SUCCESS);
 
 #define CHK_FIELD(f) \
-    ABTS_ASSERT(tc, "Mismatch in " #f, posix_exp->f == xt.f)
+        ABTS_ASSERT(tc, "Mismatch in " #f, posix_exp->f == xt.f)
 
-    CHK_FIELD(tm_sec);
-    CHK_FIELD(tm_min);
-    CHK_FIELD(tm_hour);
-    CHK_FIELD(tm_mday);
-    CHK_FIELD(tm_mon);
-    CHK_FIELD(tm_year);
-    CHK_FIELD(tm_wday);
-    CHK_FIELD(tm_yday);
-    CHK_FIELD(tm_isdst);
+        CHK_FIELD(tm_sec);
+        CHK_FIELD(tm_min);
+        CHK_FIELD(tm_hour);
+        CHK_FIELD(tm_mday);
+        CHK_FIELD(tm_mon);
+        CHK_FIELD(tm_year);
+        CHK_FIELD(tm_wday);
+        CHK_FIELD(tm_yday);
+        CHK_FIELD(tm_isdst);
 #undef CHK_FIELD
+    }
 }
 
 static void test_exp_get_gmt(abts_case *tc, void *data)
@@ -123,9 +139,11 @@
     if (rv == APR_ENOTIMPL) {
         ABTS_NOT_IMPL(tc, "apr_time_exp_get");
     }
-    ABTS_TRUE(tc, rv == APR_SUCCESS);
-    hr_off_64 = (apr_int64_t) xt.tm_gmtoff * APR_USEC_PER_SEC;
-    ABTS_TRUE(tc, now + hr_off_64 == imp);
+    else {
+        ABTS_TRUE(tc, rv == APR_SUCCESS);
+        hr_off_64 = (apr_int64_t) xt.tm_gmtoff * APR_USEC_PER_SEC;
+        ABTS_TRUE(tc, now + hr_off_64 == imp);
+    }
 }
 
 static void test_exp_get_lt(abts_case *tc, void *data)
@@ -141,9 +159,11 @@
     if (rv == APR_ENOTIMPL) {
         ABTS_NOT_IMPL(tc, "apr_time_exp_get");
     }
-    ABTS_TRUE(tc, rv == APR_SUCCESS);
-    hr_off_64 = (apr_int64_t) xt.tm_gmtoff * APR_USEC_PER_SEC;
-    ABTS_TRUE(tc, now + hr_off_64 == imp);
+    else {
+        ABTS_TRUE(tc, rv == APR_SUCCESS);
+        hr_off_64 = (apr_int64_t) xt.tm_gmtoff * APR_USEC_PER_SEC;
+        ABTS_TRUE(tc, now + hr_off_64 == imp);
+    }
 }
 
 static void test_imp_gmt(abts_case *tc, void *data)
@@ -158,8 +178,10 @@
     if (rv == APR_ENOTIMPL) {
         ABTS_NOT_IMPL(tc, "apr_time_exp_gmt_get");
     }
-    ABTS_TRUE(tc, rv == APR_SUCCESS);
-    ABTS_TRUE(tc, now == imp);
+    else {
+        ABTS_TRUE(tc, rv == APR_SUCCESS);
+        ABTS_TRUE(tc, now == imp);
+    }
 }
 
 static void test_rfcstr(abts_case *tc, void *data)
@@ -171,8 +193,10 @@
     if (rv == APR_ENOTIMPL) {
         ABTS_NOT_IMPL(tc, "apr_rfc822_date");
     }
-    ABTS_TRUE(tc, rv == APR_SUCCESS);
-    ABTS_STR_EQUAL(tc, "Sat, 14 Sep 2002 19:05:36 GMT", str);
+    else {
+        ABTS_TRUE(tc, rv == APR_SUCCESS);
+        ABTS_STR_EQUAL(tc, "Sat, 14 Sep 2002 19:05:36 GMT", str);
+    }
 }
 
 static void test_ctime(abts_case *tc, void *data)
@@ -187,11 +211,17 @@
     if (rv == APR_ENOTIMPL) {
         ABTS_NOT_IMPL(tc, "apr_ctime");
     }
-    ABTS_TRUE(tc, rv == APR_SUCCESS);
-    strcpy(libc_str, ctime(&posix_sec));
-    *strchr(libc_str, '\n') = '\0';
+    else {
+        ABTS_TRUE(tc, rv == APR_SUCCESS);
+#ifndef _WIN32_WCE
+        strcpy(libc_str, ctime(&posix_sec));
+        *strchr(libc_str, '\n') = '\0';
+#else
+        strcpy(libc_str, "Sat Sep 14 11:05:36 2002");
+#endif
 
-    ABTS_STR_EQUAL(tc, libc_str, apr_str);
+        ABTS_STR_EQUAL(tc, libc_str, apr_str);
+    }
 }
 
 static void test_strftime(abts_case *tc, void *data)
@@ -207,8 +237,10 @@
     if (rv == APR_ENOTIMPL) {
         ABTS_NOT_IMPL(tc, "apr_strftime");
     }
-    ABTS_TRUE(tc, rv == APR_SUCCESS);
-    ABTS_STR_EQUAL(tc, "19:05 Saturday 14 September 2002", str);
+    else {
+        ABTS_TRUE(tc, rv == APR_SUCCESS);
+        ABTS_STR_EQUAL(tc, "19:05 Saturday 14 September 2002", str);
+    }
 }
 
 static void test_strftimesmall(abts_case *tc, void *data)
@@ -223,8 +255,10 @@
     if (rv == APR_ENOTIMPL) {
         ABTS_NOT_IMPL(tc, "apr_strftime");
     }
-    ABTS_TRUE(tc, rv == APR_SUCCESS);
-    ABTS_STR_EQUAL(tc, "19:05:36", str);
+    else {
+        ABTS_TRUE(tc, rv == APR_SUCCESS);
+        ABTS_STR_EQUAL(tc, "19:05:36", str);
+    }
 }
 
 static void test_exp_tz(abts_case *tc, void *data)
@@ -237,16 +271,18 @@
     if (rv == APR_ENOTIMPL) {
         ABTS_NOT_IMPL(tc, "apr_time_exp_tz");
     }
-    ABTS_TRUE(tc, rv == APR_SUCCESS);
-    ABTS_TRUE(tc, (xt.tm_usec == 186711) && 
-                     (xt.tm_sec == 36) &&
-                     (xt.tm_min == 5) && 
-                     (xt.tm_hour == 14) &&
-                     (xt.tm_mday == 14) &&
-                     (xt.tm_mon == 8) &&
-                     (xt.tm_year == 102) &&
-                     (xt.tm_wday == 6) &&
-                     (xt.tm_yday == 256));
+    else {
+        ABTS_TRUE(tc, rv == APR_SUCCESS);
+        ABTS_TRUE(tc, (xt.tm_usec == 186711) && 
+                      (xt.tm_sec == 36) &&
+                      (xt.tm_min == 5) && 
+                      (xt.tm_hour == 14) &&
+                      (xt.tm_mday == 14) &&
+                      (xt.tm_mon == 8) &&
+                      (xt.tm_year == 102) &&
+                      (xt.tm_wday == 6) &&
+                      (xt.tm_yday == 256));
+    }
 }
 
 static void test_strftimeoffset(abts_case *tc, void *data)
@@ -262,7 +298,9 @@
     if (rv == APR_ENOTIMPL) {
         ABTS_NOT_IMPL(tc, "apr_strftime");
     }
-    ABTS_TRUE(tc, rv == APR_SUCCESS);
+    else {
+        ABTS_TRUE(tc, rv == APR_SUCCESS);
+    }
 }
 
 /* 0.9.4 and earlier rejected valid dates in 2038 */
@@ -287,9 +325,16 @@
 {
     suite = ADD_SUITE(suite)
 
+    /* Some tests are pointless in CE because APR can't be tested against the
+     * CRT. The CRT doesn't implement the time functions.
+     */
+#ifndef _WIN32_WCE
     abts_run_test(suite, test_now, NULL);
+#endif
     abts_run_test(suite, test_gmtstr, NULL);
+#ifndef _WIN32_WCE
     abts_run_test(suite, test_exp_lt, NULL);
+#endif
     abts_run_test(suite, test_exp_get_gmt, NULL);
     abts_run_test(suite, test_exp_get_lt, NULL);
     abts_run_test(suite, test_imp_gmt, NULL);
Index: tryread.c
===================================================================
--- tryread.c	(revision 575665)
+++ tryread.c	(working copy)
@@ -19,12 +19,13 @@
 #include "apr_file_io.h"
 #include "apr_general.h"
 #include "apr.h"
+#include <tchar.h>
 
 #if APR_HAVE_STDLIB_H
 #include <stdlib.h>
 #endif
 
-int main(int argc, const char * const *argv)
+int _tmain(int argc, const _TCHAR * const *argv)
 {
     apr_file_t *file;
     apr_status_t status;

Re: [PATCH] libapr-1.2.11 test on WinCE 5

Posted by Ioan Popescu <ip...@dataq.com>.
William A. Rowe, Jr. wrote:
> FYI if you are going to iterate, it would be very helpful if you would
> please play on trunk where we are on the same page.
> 
> I actually don't see a point to focusing on apr 1.2.anything, but instead
> focus all of our CE-energies into making a releasable 1.3.0 in the very
> near future (e.g. the next two months).

I'll give it another shot. I already tried once to apply the changes against
trunk, but found there were many changes to trunk that conflicted with mine.
I thought it would be better to cleanup what I had and report them than try
and figure out what the new code was doing.

Now that there's a version running on CE, I'll take a second look and try to
incorporate the changes into trunk.

FYI on the makefiles, CE is kind of tricky. In the past, there were
"standard" SDKs for CE development. I managed to find one for CE 5, but 6
doesn't have one. Instead, every device running CE has its own custom
version of the OS along with a custom SDK, if they release it. I've already
added IPV6 to the standard CE 5 SDK, but there are no guarantees on what CE
6 has available. From what I've seen in the "New Features", it should have a
better CRT, so at least basic functionality will be portable.

Embedded Linux probably has the same quirk, since an embedded OS only has
what it needs (and can handle). Something to keep in mind, there may have to
be more tests on whether something is implemented instead of just assuming
that it is.

Re: [PATCH] APR on WinCE 5 - trunk

Posted by Ioan Popescu <ip...@dataq.com>.
Ioan Popescu wrote:
> I've checked the libapriconv and libaprutil patches and both apply cleanly
> to trunk. Not all patches to libapr are clean, but the ones that are, I've
> reattached. I've also found a couple errors in my own previous patches to
> libapr and updated the use of _WIN32_WCE. APIs existing before or including
> CE 3 default to checking whether it's defined. APIs existing afterwards are
> used only if they exist (depends on _WIN32_WCE version).

Here's the rest.


Re: [PATCH] APR on WinCE 5 - trunk

Posted by Ioan Popescu <ip...@dataq.com>.
William A. Rowe, Jr. wrote:
> Ioan Popescu wrote:
>> Why is "WINNT" defined in the project file? What does it "mean"? It 
>> wasn't explicitly defined before, why is it now?
>> 
>> Just checking whether I need this for CE...
> 
> I don't think you do; we look at each.
> 
> WINNT triggers some shorthands to melt away Win9x code from the build 
> when it's contained within the various ELSE_WIN_OS_IS_ANSI blocks, and 
> eliminating the conditional evaluation behind IF_WIN_OS_IS_UNICODE, but I
> believe those macros are already triggered by _WINCE.

You're right. I don't need to worry about WINNT.

I've checked the libapriconv and libaprutil patches and both apply cleanly
to trunk. Not all patches to libapr are clean, but the ones that are, I've
reattached. I've also found a couple errors in my own previous patches to
libapr and updated the use of _WIN32_WCE. APIs existing before or including
CE 3 default to checking whether it's defined. APIs existing afterwards are
used only if they exist (depends on _WIN32_WCE version).

Still working on the files that won't merge because they're too different. I
have to do them by hand. Probably won't have anything until next week.

Re: [PATCH] libapr-1.2.11 test on WinCE 5

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
William A. Rowe, Jr. wrote:
> 
> Glad to see so much progress, I started to tinker in this area, but had to
> shut it down before I became completely distracted :)  Thanks for the
> research and your submission!

FYI if you are going to iterate, it would be very helpful if you would
please play on trunk where we are on the same page.

I actually don't see a point to focusing on apr 1.2.anything, but instead
focus all of our CE-energies into making a releasable 1.3.0 in the very
near future (e.g. the next two months).

http://svn.apache.org/repos/asf/apr/apr/trunk/

are the sources we must start at, in either case.  You'll see I've already
done some slick stuff in Makefile.win that we can probably leverage to
accomplish x86 NT and 98, x64 NT and ARM CE.

Re: [PATCH] libapr-1.2.11 test on WinCE 5

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
Ioan Popescu wrote:
> Index: abts.c
> ===================================================================
> --- abts.c	(revision 575665)
> +++ abts.c	(working copy)

Just as a quick FYI; I'm incredibly dismissive of tests by-platform within
the test/* tree, and do plan to nix/veto all of them from apr-2.0 forwards.

The rational being, we should be communicating everything by-feature that
the developer needs to know, within the apr public headers.

Obviously test/internal/ is the exception, for things that need to be vetted
but were implemented as platform internals.

Which leads to an interesting question; should that be test/internals/{plat}?

Back to the subject at hand, I'll begin reviewing your patches, although
I don't see being able to incorporate them in the very next release.  I'd
prefer we focus on soldifying any changes required for apr-1.3.0, which
our versioning rules will permit necessary api enhancements.

Glad to see so much progress, I started to tinker in this area, but had to
shut it down before I became completely distracted :)  Thanks for the
research and your submission!

Bill