Revised commit log;

Log Message:

  svn:ignore's to hide obj/exe's from svn status for win32

  Backport rev's 376406, 376407, 376408 to the old test framework,
  with some feedbacks from list and some special cases for APR 0.9,
  to ensure the testsuite builds clean.

  (wasn't intended to be a recursive commit)

URL: http://svn.apache.org/viewcvs?rev=377009&view=rev

[EMAIL PROTECTED] wrote:
Author: wrowe
Date: Sat Feb 11 10:36:25 2006
New Revision: 377009

URL: http://svn.apache.org/viewcvs?rev=377009&view=rev
Log:

  svn:ignore's to hide obj/exe's from svn status for win32

Modified:
    apr/apr/branches/0.9.x/test/   (props changed)
    apr/apr/branches/0.9.x/test/occhild.c
    apr/apr/branches/0.9.x/test/testdso.c
    apr/apr/branches/0.9.x/test/testdup.c
    apr/apr/branches/0.9.x/test/testfile.c
    apr/apr/branches/0.9.x/test/testmmap.c
    apr/apr/branches/0.9.x/test/testpipe.c
    apr/apr/branches/0.9.x/test/testproc.c
    apr/apr/branches/0.9.x/test/testtime.c

Propchange: apr/apr/branches/0.9.x/test/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Sat Feb 11 10:36:25 2006
@@ -5,6 +5,8 @@
 *.swp
 *.slo
 *.la
+*.obj
+*.exe
 .libs
 .deps
 testmd5

Modified: apr/apr/branches/0.9.x/test/occhild.c
URL: 
http://svn.apache.org/viewcvs/apr/apr/branches/0.9.x/test/occhild.c?rev=377009&r1=377008&r2=377009&view=diff
==============================================================================
--- apr/apr/branches/0.9.x/test/occhild.c (original)
+++ apr/apr/branches/0.9.x/test/occhild.c Sat Feb 11 10:36:25 2006
@@ -1,16 +1,26 @@
 #include "apr.h"
-#include <stdio.h>
-#if APR_HAVE_UNISTD_H
-#include <unistd.h>
-#endif
+#include "apr_file_io.h"
+#include "apr.h"
+
+#if APR_HAVE_STDLIB_H
 #include <stdlib.h>
+#endif
int main(void)
 {
     char buf[256];
+    apr_file_t *err;
+    apr_pool_t *p;
+
+    apr_initialize();
+    atexit(apr_terminate);
+
+    apr_pool_create(&p, NULL);
+    apr_file_open_stdin(&err, p);
while (1) {
-        read(STDERR_FILENO, buf, 256);
+        apr_size_t length = 256;
+        apr_file_read(err, buf, &length);
     }
-    return 0; /* just to keep the compiler happy */
+    exit(0); /* just to keep the compiler happy */
 }

Modified: apr/apr/branches/0.9.x/test/testdso.c
URL: 
http://svn.apache.org/viewcvs/apr/apr/branches/0.9.x/test/testdso.c?rev=377009&r1=377008&r2=377009&view=diff
==============================================================================
--- apr/apr/branches/0.9.x/test/testdso.c (original)
+++ apr/apr/branches/0.9.x/test/testdso.c Sat Feb 11 10:36:25 2006
@@ -21,6 +21,7 @@
 #include "apr_errno.h"
 #include "apr_dso.h"
 #include "apr_strings.h"
+#include "apr_file_info.h"
 #include "apr.h"
 #if APR_HAVE_UNISTD_H
 #include <unistd.h>
@@ -223,9 +224,7 @@
 {
     CuSuite *suite = CuSuiteNew("DSO");
- modname = apr_pcalloc(p, 256);
-    getcwd(modname, 256);
-    modname = apr_pstrcat(p, modname, "/", MOD_NAME, NULL);
+    apr_filepath_merge(&modname, NULL, MOD_NAME, 0, p);
SUITE_ADD_TEST(suite, test_load_module);
     SUITE_ADD_TEST(suite, test_dso_sym);
@@ -233,9 +232,7 @@
     SUITE_ADD_TEST(suite, test_unload_module);
#ifdef LIB_NAME
-    libname = apr_pcalloc(p, 256);
-    getcwd(libname, 256);
-    libname = apr_pstrcat(p, libname, "/", LIB_NAME, NULL);
+    apr_filepath_merge(&libname, NULL, LIB_NAME, 0, p);
SUITE_ADD_TEST(suite, test_load_library);
     SUITE_ADD_TEST(suite, test_dso_sym_library);

Modified: apr/apr/branches/0.9.x/test/testdup.c
URL: 
http://svn.apache.org/viewcvs/apr/apr/branches/0.9.x/test/testdup.c?rev=377009&r1=377008&r2=377009&view=diff
==============================================================================
--- apr/apr/branches/0.9.x/test/testdup.c (original)
+++ apr/apr/branches/0.9.x/test/testdup.c Sat Feb 11 10:36:25 2006
@@ -81,7 +81,7 @@
     fpos = 0;
     rv = apr_file_seek(file1, APR_SET, &fpos);
     CuAssertIntEquals(tc, APR_SUCCESS, rv);
-    CuAssertIntEquals(tc, 0, fpos);
+    CuAssert(tc, "File position mismatch, expected 0", fpos == 0);
txtlen = 50;
     rv = apr_file_read(file1, buff, &txtlen);
@@ -166,7 +166,7 @@
     fpos = 0;
     rv = apr_file_seek(testfile, APR_SET, &fpos);
     CuAssertIntEquals(tc, APR_SUCCESS, rv);
-    CuAssertIntEquals(tc, 0, fpos);
+    CuAssert(tc, "File position mismatch, expected 0", fpos == 0);
txtlen = 50;
     rv = apr_file_read(testfile, buff, &txtlen);

Modified: apr/apr/branches/0.9.x/test/testfile.c
URL: 
http://svn.apache.org/viewcvs/apr/apr/branches/0.9.x/test/testfile.c?rev=377009&r1=377008&r2=377009&view=diff
==============================================================================
--- apr/apr/branches/0.9.x/test/testfile.c (original)
+++ apr/apr/branches/0.9.x/test/testfile.c Sat Feb 11 10:36:25 2006
@@ -466,7 +466,7 @@
     cur = 0;
     rv = apr_file_seek(f, APR_CUR, &cur);
     CuAssertIntEquals(tc, APR_SUCCESS, rv);
-    CuAssertIntEquals(tc, 10, cur);
+    CuAssert(tc, "File Pointer Mismatch, expected 10", cur == 10);
nbytes = sizeof(buf);
     rv = apr_file_read(f, buf, &nbytes);
@@ -476,7 +476,7 @@
     cur = -((apr_off_t)nbytes - 7980);
     rv = apr_file_seek(f, APR_CUR, &cur);
     CuAssertIntEquals(tc, APR_SUCCESS, rv);
-    CuAssertIntEquals(tc, 7990, cur);
+    CuAssert(tc, "File Pointer Mismatch, expected 7990", cur == 7990);
rv = apr_file_gets(buf, 11, f);
     CuAssertIntEquals(tc, APR_SUCCESS, rv);
@@ -522,7 +522,7 @@
rv = apr_stat(&finfo, fname, APR_FINFO_SIZE, p);
     CuAssertIntEquals(tc, APR_SUCCESS, rv);
-    CuAssertIntEquals(tc, 0, finfo.size);
+    CuAssert(tc, "File size mismatch, expected 0 (empty)", finfo.size == 0);
rv = apr_file_remove(fname, p);
     CuAssertIntEquals(tc, APR_SUCCESS, rv);

Modified: apr/apr/branches/0.9.x/test/testmmap.c
URL: 
http://svn.apache.org/viewcvs/apr/apr/branches/0.9.x/test/testmmap.c?rev=377009&r1=377008&r2=377009&view=diff
==============================================================================
--- apr/apr/branches/0.9.x/test/testmmap.c (original)
+++ apr/apr/branches/0.9.x/test/testmmap.c Sat Feb 11 10:36:25 2006
@@ -84,14 +84,15 @@
rv = apr_file_info_get(&finfo, APR_FINFO_NORM, thefile);
     CuAssertIntEquals(tc, rv, APR_SUCCESS);
-    CuAssertIntEquals(tc, fsize, finfo.size);
+    CuAssert(tc, "File size mismatch", fsize == finfo.size);
 }
static void test_mmap_create(CuTest *tc)
 {
     apr_status_t rv;
- rv = apr_mmap_create(&themmap, thefile, 0, finfo.size, APR_MMAP_READ, p); + rv = apr_mmap_create(&themmap, thefile, 0, (apr_size_t)finfo.size, + APR_MMAP_READ, p);
     CuAssertPtrNotNull(tc, themmap);
     CuAssertIntEquals(tc, rv, APR_SUCCESS);
 }

Modified: apr/apr/branches/0.9.x/test/testpipe.c
URL: 
http://svn.apache.org/viewcvs/apr/apr/branches/0.9.x/test/testpipe.c?rev=377009&r1=377008&r2=377009&view=diff
==============================================================================
--- apr/apr/branches/0.9.x/test/testpipe.c (original)
+++ apr/apr/branches/0.9.x/test/testpipe.c Sat Feb 11 10:36:25 2006
@@ -65,14 +65,15 @@
rv = apr_file_pipe_timeout_get(readp, &timeout);
     CuAssertIntEquals(tc, APR_SUCCESS, rv);
-    CuAssertIntEquals(tc, -1, timeout);
+    CuAssert(tc, "Timeout mismatch, expected -1", timeout == -1);
rv = apr_file_pipe_timeout_set(readp, apr_time_from_sec(1));
     CuAssertIntEquals(tc, APR_SUCCESS, rv);
rv = apr_file_pipe_timeout_get(readp, &timeout);
     CuAssertIntEquals(tc, APR_SUCCESS, rv);
-    CuAssertIntEquals(tc, apr_time_from_sec(1), timeout);
+ CuAssert(tc, "Timeout mismatch, expected 1 second", + timeout == apr_time_from_sec(1));
 }
static void read_write(CuTest *tc)

Modified: apr/apr/branches/0.9.x/test/testproc.c
URL: 
http://svn.apache.org/viewcvs/apr/apr/branches/0.9.x/test/testproc.c?rev=377009&r1=377008&r2=377009&view=diff
==============================================================================
--- apr/apr/branches/0.9.x/test/testproc.c (original)
+++ apr/apr/branches/0.9.x/test/testproc.c Sat Feb 11 10:36:25 2006
@@ -117,7 +117,7 @@
     offset = 0;
     rv = apr_file_seek(testfile, APR_SET, &offset);
     CuAssertIntEquals(tc, APR_SUCCESS, rv);
-    CuAssertIntEquals(tc, 0, offset);
+    CuAssert(tc, "File position mismatch, expected 0", offset == 0);
rv = apr_procattr_create(&attr, p);
     CuAssertIntEquals(tc, APR_SUCCESS, rv);

Modified: apr/apr/branches/0.9.x/test/testtime.c
URL: 
http://svn.apache.org/viewcvs/apr/apr/branches/0.9.x/test/testtime.c?rev=377009&r1=377008&r2=377009&view=diff
==============================================================================
--- apr/apr/branches/0.9.x/test/testtime.c (original)
+++ apr/apr/branches/0.9.x/test/testtime.c Sat Feb 11 10:36:25 2006
@@ -86,8 +86,9 @@
 {
     apr_status_t rv;
     apr_time_exp_t xt;
-    struct tm *libc_exp;
-    time_t now_secs = apr_time_sec(now);
+    time_t posix_secs = (time_t)apr_time_sec(now);
+    apr_time_t now_secs = apr_time_sec(now);
+    struct tm *posix_exp = localtime(&posix_secs);
rv = apr_time_exp_lt(&xt, now);
     if (rv == APR_ENOTIMPL) {
@@ -95,10 +96,8 @@
     }
     CuAssertTrue(tc, rv == APR_SUCCESS);
- libc_exp = localtime(&now_secs);
-
 #define CHK_FIELD(f) \
-    CuAssertIntEquals(tc, libc_exp->f, xt.f)
+    CuAssert(tc, "Mismatch in " #f, posix_exp->f == xt.f)
CHK_FIELD(tm_sec);
     CHK_FIELD(tm_min);
@@ -182,14 +181,14 @@
     apr_status_t rv;
     char apr_str[STR_SIZE];
     char libc_str[STR_SIZE];
-    time_t now_sec = apr_time_sec(now);
+    time_t posix_sec = (time_t)apr_time_sec(now);
rv = apr_ctime(apr_str, now);
     if (rv == APR_ENOTIMPL) {
         CuNotImpl(tc, "apr_ctime");
     }
     CuAssertTrue(tc, rv == APR_SUCCESS);
-    strcpy(libc_str, ctime(&now_sec));
+    strcpy(libc_str, ctime(&posix_sec));
     *strchr(libc_str, '\n') = '\0';
CuAssertStrEquals(tc, libc_str, apr_str);

Reply via email to