diff options
author | dreid <dreid@13f79535-47bb-0310-9956-ffa450edef68> | 2004-06-07 21:21:35 +0000 |
---|---|---|
committer | dreid <dreid@13f79535-47bb-0310-9956-ffa450edef68> | 2004-06-07 21:21:35 +0000 |
commit | a9ba3b84bee7872b82dc38e6f4ded710b2f65c8a (patch) | |
tree | 6b948a49808b3ef086fbcd00ff9fb4207df836b1 /test | |
parent | e519c61cf1cd50ccf8f4c2561a4295299a2d89a8 (diff) | |
download | libapr-a9ba3b84bee7872b82dc38e6f4ded710b2f65c8a.tar.gz |
Presently if we fail in apr_assert_success we get the line number for
testutil.c reported. Not very useful. This change adds the passing of
the (correct) line number and also a macro to ease said passing.
I've changed all instances of apr_assert_success to use the new macro, but
not all the tests build on this platform so others should check that all
is well for them.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@65171 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test')
-rw-r--r-- | test/Makefile.in | 4 | ||||
-rw-r--r-- | test/testapp.c | 2 | ||||
-rw-r--r-- | test/testatomic.c | 4 | ||||
-rw-r--r-- | test/testdir.c | 10 | ||||
-rw-r--r-- | test/testenv.c | 6 | ||||
-rw-r--r-- | test/testfile.c | 12 | ||||
-rw-r--r-- | test/testfilecopy.c | 14 | ||||
-rw-r--r-- | test/testfileinfo.c | 14 | ||||
-rw-r--r-- | test/testflock.c | 14 | ||||
-rw-r--r-- | test/testglobalmutex.c | 10 | ||||
-rw-r--r-- | test/testlfs.c | 56 | ||||
-rw-r--r-- | test/testlock.c | 18 | ||||
-rw-r--r-- | test/testprocmutex.c | 4 | ||||
-rw-r--r-- | test/testrand.c | 2 | ||||
-rw-r--r-- | test/testshm.c | 36 | ||||
-rw-r--r-- | test/testsock.c | 40 | ||||
-rw-r--r-- | test/testsockopt.c | 2 | ||||
-rw-r--r-- | test/testtemp.c | 6 | ||||
-rw-r--r-- | test/testtime.c | 2 | ||||
-rw-r--r-- | test/testuser.c | 20 | ||||
-rw-r--r-- | test/testutil.c | 7 | ||||
-rw-r--r-- | test/testutil.h | 5 |
22 files changed, 148 insertions, 140 deletions
diff --git a/test/Makefile.in b/test/Makefile.in index 84548b83d..e77ce9a61 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -71,7 +71,11 @@ mod_test.slo: $(srcdir)/mod_test.c $(LIBTOOL) $(LTFLAGS) --mode=compile $(COMPILE) -prefer-pic -c $(srcdir)/mod_test.c && touch $@ mod_test.la: mod_test.slo $(LOCAL_LIBS) +<<<<<<< Makefile.in + $(LIBTOOL) --mode=link $(COMPILE) -rpath $(srcdir) -avoid-version -module mod_test.lo $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ +======= $(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) -rpath `pwd` -avoid-version -module mod_test.lo $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ +>>>>>>> 1.159 libmod_test.la: mod_test.slo $(LOCAL_LIBS) $(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) -rpath `pwd` -avoid-version mod_test.lo $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ diff --git a/test/testapp.c b/test/testapp.c index 9e5bec3c5..77607aa38 100644 --- a/test/testapp.c +++ b/test/testapp.c @@ -7,4 +7,4 @@ int main(int argc, const char * const * argv, const char * const *env) apr_terminate(); -}
\ No newline at end of file +} diff --git a/test/testatomic.c b/test/testatomic.c index eb8f2a24b..62fc4c60e 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -35,7 +35,7 @@ static void test_init(abts_case *tc, void *data) { - apr_assert_success(tc, "Could not initliaze atomics", apr_atomic_init(p)); + APR_ASSERT_SUCCESS(tc, "Could not initliaze atomics", apr_atomic_init(p)); } static void test_set32(abts_case *tc, void *data) @@ -242,7 +242,7 @@ static void test_atomics_threaded(abts_case *tc, void *data) #endif rv = apr_thread_mutex_create(&thread_lock, APR_THREAD_MUTEX_DEFAULT, p); - apr_assert_success(tc, "Could not create lock", rv); + APR_ASSERT_SUCCESS(tc, "Could not create lock", rv); for (i = 0; i < NUM_THREADS; i++) { apr_status_t r1, r2, r3; diff --git a/test/testdir.c b/test/testdir.c index 3eb9a2631..0bb5f3b5a 100644 --- a/test/testdir.c +++ b/test/testdir.c @@ -149,17 +149,17 @@ static void test_rewind(abts_case *tc, void *data) 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, "data", p)); - apr_assert_success(tc, "apr_dir_read failed", + APR_ASSERT_SUCCESS(tc, "apr_dir_read failed", apr_dir_read(&first, APR_FINFO_DIRENT, dir)); - apr_assert_success(tc, "apr_dir_rewind failed", apr_dir_rewind(dir)); + APR_ASSERT_SUCCESS(tc, "apr_dir_rewind failed", apr_dir_rewind(dir)); - apr_assert_success(tc, "second apr_dir_read failed", + APR_ASSERT_SUCCESS(tc, "second apr_dir_read failed", apr_dir_read(&second, APR_FINFO_DIRENT, dir)); - apr_assert_success(tc, "apr_dir_close failed", apr_dir_close(dir)); + APR_ASSERT_SUCCESS(tc, "apr_dir_close failed", apr_dir_close(dir)); ABTS_STR_EQUAL(tc, first.name, second.name); } diff --git a/test/testenv.c b/test/testenv.c index 0e341aa39..592f59ccd 100644 --- a/test/testenv.c +++ b/test/testenv.c @@ -32,7 +32,7 @@ static void test_setenv(abts_case *tc, void *data) if (!have_env_set) { ABTS_NOT_IMPL(tc, "apr_env_set"); } else { - apr_assert_success(tc, "set environment variable", rv); + APR_ASSERT_SUCCESS(tc, "set environment variable", rv); } } @@ -52,7 +52,7 @@ static void test_getenv(abts_case *tc, void *data) ABTS_NOT_IMPL(tc, "apr_env_get"); return; } - apr_assert_success(tc, "get environment variable", rv); + APR_ASSERT_SUCCESS(tc, "get environment variable", rv); ABTS_STR_EQUAL(tc, TEST_ENVVAR_VALUE, value); } @@ -71,7 +71,7 @@ static void test_delenv(abts_case *tc, void *data) ABTS_NOT_IMPL(tc, "apr_env_delete"); return; } - apr_assert_success(tc, "delete environment variable", rv); + APR_ASSERT_SUCCESS(tc, "delete environment variable", rv); if (!have_env_get) { ABTS_NOT_IMPL(tc, "apr_env_get (skip sanity check for apr_env_delete)"); diff --git a/test/testfile.c b/test/testfile.c index 98ef42fbc..13bc1028d 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -81,7 +81,7 @@ static void test_read(abts_case *tc, void *data) APR_READ, APR_UREAD | APR_UWRITE | APR_GREAD, p); - apr_assert_success(tc, "Opening test file " FILENAME, rv); + APR_ASSERT_SUCCESS(tc, "Opening test file " FILENAME, rv); rv = apr_file_read(filetest, str, &nbytes); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_INT_EQUAL(tc, strlen(TESTSTR), nbytes); @@ -98,7 +98,7 @@ static void test_readzero(abts_case *tc, void *data) apr_file_t *filetest; rv = apr_file_open(&filetest, FILENAME, APR_READ, APR_OS_DEFAULT, p); - apr_assert_success(tc, "Opening test file " FILENAME, rv); + APR_ASSERT_SUCCESS(tc, "Opening test file " FILENAME, rv); rv = apr_file_read(filetest, str, &nbytes); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); @@ -116,7 +116,7 @@ static void test_filename(abts_case *tc, void *data) rv = apr_file_open(&filetest, FILENAME, APR_READ, APR_UREAD | APR_UWRITE | APR_GREAD, p); - apr_assert_success(tc, "Opening test file " FILENAME, rv); + APR_ASSERT_SUCCESS(tc, "Opening test file " FILENAME, rv); rv = apr_file_name_get(&str, filetest); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); @@ -135,7 +135,7 @@ static void test_fileclose(abts_case *tc, void *data) rv = apr_file_open(&filetest, FILENAME, APR_READ, APR_UREAD | APR_UWRITE | APR_GREAD, p); - apr_assert_success(tc, "Opening test file " FILENAME, rv); + APR_ASSERT_SUCCESS(tc, "Opening test file " FILENAME, rv); rv = apr_file_close(filetest); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); @@ -227,7 +227,7 @@ static void test_seek(abts_case *tc, void *data) rv = apr_file_open(&filetest, FILENAME, APR_READ, APR_UREAD | APR_UWRITE | APR_GREAD, p); - apr_assert_success(tc, "Open test file " FILENAME, rv); + APR_ASSERT_SUCCESS(tc, "Open test file " FILENAME, rv); rv = apr_file_read(filetest, str, &nbytes); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); @@ -251,7 +251,7 @@ static void test_seek(abts_case *tc, void *data) rv = apr_file_open(&filetest, FILENAME, APR_READ | APR_BUFFERED, APR_UREAD | APR_UWRITE | APR_GREAD, p); - apr_assert_success(tc, "Open test file " FILENAME, rv); + APR_ASSERT_SUCCESS(tc, "Open test file " FILENAME, rv); offset = -5; rv = apr_file_seek(filetest, SEEK_END, &offset); diff --git a/test/testfilecopy.c b/test/testfilecopy.c index 7db0b2082..21db4bcac 100644 --- a/test/testfilecopy.c +++ b/test/testfilecopy.c @@ -36,13 +36,13 @@ static void copy_helper(abts_case *tc, const char *from, const char * to, else { rv = apr_file_append(from, to, perms, p); } - apr_assert_success(tc, "Error copying file", rv); + APR_ASSERT_SUCCESS(tc, "Error copying file", rv); rv = apr_stat(&orig, from, APR_FINFO_SIZE, p); - apr_assert_success(tc, "Couldn't stat original file", rv); + APR_ASSERT_SUCCESS(tc, "Couldn't stat original file", rv); rv = apr_stat(©, to, APR_FINFO_SIZE, p); - apr_assert_success(tc, "Couldn't stat copy file", rv); + APR_ASSERT_SUCCESS(tc, "Couldn't stat copy file", rv); if (!append) { ABTS_INT_EQUAL(tc, orig.size, copy.size); @@ -64,7 +64,7 @@ static void copy_short_file(abts_case *tc, void *data) 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); - apr_assert_success(tc, "Couldn't remove copy file", rv); + APR_ASSERT_SUCCESS(tc, "Couldn't remove copy file", rv); } static void copy_over_existing(abts_case *tc, void *data) @@ -85,7 +85,7 @@ static void copy_over_existing(abts_case *tc, void *data) APR_FILE_SOURCE_PERMS, 0, p); rv = apr_file_remove("data/file_copy.txt", p); - apr_assert_success(tc, "Couldn't remove copy file", rv); + APR_ASSERT_SUCCESS(tc, "Couldn't remove copy file", rv); } static void append_nonexist(abts_case *tc, void *data) @@ -98,7 +98,7 @@ static void append_nonexist(abts_case *tc, void *data) 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); - apr_assert_success(tc, "Couldn't remove copy file", rv); + APR_ASSERT_SUCCESS(tc, "Couldn't remove copy file", rv); } static void append_exist(abts_case *tc, void *data) @@ -119,7 +119,7 @@ static void append_exist(abts_case *tc, void *data) APR_FILE_SOURCE_PERMS, 1, p); rv = apr_file_remove("data/file_copy.txt", p); - apr_assert_success(tc, "Couldn't remove copy file", rv); + APR_ASSERT_SUCCESS(tc, "Couldn't remove copy file", rv); } abts_suite *testfilecopy(abts_suite *suite) diff --git a/test/testfileinfo.c b/test/testfileinfo.c index 2166d31fe..abb089201 100644 --- a/test/testfileinfo.c +++ b/test/testfileinfo.c @@ -182,7 +182,7 @@ static void test_buffered_write_size(abts_case *tc, void *data) APR_READ | APR_WRITE | APR_CREATE | APR_TRUNCATE | APR_BUFFERED | APR_DELONCLOSE, APR_OS_DEFAULT, p); - apr_assert_success(tc, "open file", rv); + APR_ASSERT_SUCCESS(tc, "open file", rv); /* A funny thing happened to me the other day: I wrote something * into a buffered file, then asked for its size using @@ -191,11 +191,11 @@ static void test_buffered_write_size(abts_case *tc, void *data) */ bytes = data_len; rv = apr_file_write(thefile, NEWFILEDATA, &bytes); - apr_assert_success(tc, "write file contents", rv); + APR_ASSERT_SUCCESS(tc, "write file contents", rv); ABTS_TRUE(tc, data_len == bytes); rv = apr_file_info_get(&finfo, APR_FINFO_SIZE, thefile); - apr_assert_success(tc, "get file size", rv); + APR_ASSERT_SUCCESS(tc, "get file size", rv); ABTS_TRUE(tc, bytes == (apr_size_t) finfo.size); apr_file_close(thefile); } @@ -215,7 +215,7 @@ static void test_mtime_set(abts_case *tc, void *data) APR_READ | APR_WRITE | APR_CREATE | APR_TRUNCATE | APR_BUFFERED | APR_DELONCLOSE, APR_OS_DEFAULT, p); - apr_assert_success(tc, "open file", rv); + APR_ASSERT_SUCCESS(tc, "open file", rv); /* Check that the current mtime is not the epoch */ rv = apr_stat(&finfo, NEWFILENAME, APR_FINFO_MTIME, p); @@ -230,7 +230,7 @@ static void test_mtime_set(abts_case *tc, void *data) } ABTS_FAIL(tc, str); } - apr_assert_success(tc, "get initial mtime", rv); + APR_ASSERT_SUCCESS(tc, "get initial mtime", rv); ABTS_TRUE(tc, finfo.mtime != epoch); /* Reset the mtime to the epoch and verify the result. @@ -238,10 +238,10 @@ static void test_mtime_set(abts_case *tc, void *data) * the second one will, too. */ rv = apr_file_mtime_set(NEWFILENAME, epoch, p); - apr_assert_success(tc, "set mtime", rv); + APR_ASSERT_SUCCESS(tc, "set mtime", rv); rv = apr_stat(&finfo, NEWFILENAME, APR_FINFO_MTIME, p); - apr_assert_success(tc, "get modified mtime", rv); + APR_ASSERT_SUCCESS(tc, "get modified mtime", rv); ABTS_TRUE(tc, finfo.mtime == epoch); apr_file_close(thefile); diff --git a/test/testflock.c b/test/testflock.c index 91e3ff51c..dc679e2e7 100644 --- a/test/testflock.c +++ b/test/testflock.c @@ -32,19 +32,19 @@ static int launch_reader(abts_case *tc) int exitcode; rv = apr_procattr_create(&procattr, p); - apr_assert_success(tc, "Couldn't create procattr", rv); + APR_ASSERT_SUCCESS(tc, "Couldn't create procattr", rv); rv = apr_procattr_io_set(procattr, APR_NO_PIPE, APR_NO_PIPE, APR_NO_PIPE); - apr_assert_success(tc, "Couldn't set io in procattr", rv); + APR_ASSERT_SUCCESS(tc, "Couldn't set io in procattr", rv); rv = apr_procattr_error_check_set(procattr, 1); - apr_assert_success(tc, "Couldn't set error check in procattr", rv); + APR_ASSERT_SUCCESS(tc, "Couldn't set error check in procattr", rv); args[0] = "tryread" EXTENSION; args[1] = NULL; rv = apr_proc_create(&proc, "./tryread" EXTENSION, args, NULL, procattr, p); - apr_assert_success(tc, "Couldn't launch program", rv); + APR_ASSERT_SUCCESS(tc, "Couldn't launch program", rv); ABTS_ASSERT(tc, "wait for child process", apr_proc_wait(&proc, &exitcode, &why, APR_WAIT) == APR_CHILD_DONE); @@ -61,11 +61,11 @@ static void test_withlock(abts_case *tc, void *data) rv = apr_file_open(&file, TESTFILE, APR_WRITE|APR_CREATE, APR_OS_DEFAULT, p); - apr_assert_success(tc, "Could not create file.", rv); + APR_ASSERT_SUCCESS(tc, "Could not create file.", rv); ABTS_PTR_NOTNULL(tc, file); rv = apr_file_lock(file, APR_FLOCK_EXCLUSIVE); - apr_assert_success(tc, "Could not lock the file.", rv); + APR_ASSERT_SUCCESS(tc, "Could not lock the file.", rv); ABTS_PTR_NOTNULL(tc, file); code = launch_reader(tc); @@ -84,7 +84,7 @@ static void test_withoutlock(abts_case *tc, void *data) static void remove_lockfile(abts_case *tc, void *data) { - apr_assert_success(tc, "Couldn't remove lock file.", + APR_ASSERT_SUCCESS(tc, "Couldn't remove lock file.", apr_file_remove(TESTFILE, p)); } diff --git a/test/testglobalmutex.c b/test/testglobalmutex.c index bebcb20ac..dc79848a7 100644 --- a/test/testglobalmutex.c +++ b/test/testglobalmutex.c @@ -28,21 +28,21 @@ static void launch_child(abts_case *tc, apr_lockmech_e mech, apr_status_t rv; rv = apr_procattr_create(&procattr, p); - apr_assert_success(tc, "Couldn't create procattr", rv); + APR_ASSERT_SUCCESS(tc, "Couldn't create procattr", rv); rv = apr_procattr_io_set(procattr, APR_NO_PIPE, APR_NO_PIPE, APR_NO_PIPE); - apr_assert_success(tc, "Couldn't set io in procattr", rv); + APR_ASSERT_SUCCESS(tc, "Couldn't set io in procattr", rv); rv = apr_procattr_error_check_set(procattr, 1); - apr_assert_success(tc, "Couldn't set error check in procattr", rv); + APR_ASSERT_SUCCESS(tc, "Couldn't set error check in procattr", rv); args[0] = "globalmutexchild" EXTENSION; args[1] = (const char*)apr_itoa(p, (int)mech); args[2] = NULL; rv = apr_proc_create(proc, "./globalmutexchild" EXTENSION, args, NULL, procattr, p); - apr_assert_success(tc, "Couldn't launch program", rv); + APR_ASSERT_SUCCESS(tc, "Couldn't launch program", rv); } static int wait_child(abts_case *tc, apr_proc_t *proc) @@ -79,7 +79,7 @@ static void test_exclusive(abts_case *tc, void *data, apr_lockmech_e mech) int x = 0; rv = apr_global_mutex_create(&global_lock, LOCKNAME, mech, p); - apr_assert_success(tc, "Error creating mutex", rv); + APR_ASSERT_SUCCESS(tc, "Error creating mutex", rv); launch_child(tc, mech, &p1, p); launch_child(tc, mech, &p2, p); diff --git a/test/testlfs.c b/test/testlfs.c index d512558be..5f83b453b 100644 --- a/test/testlfs.c +++ b/test/testlfs.c @@ -48,17 +48,17 @@ static void test_open(abts_case *tc, void *data) rv = apr_dir_make(TESTDIR, APR_OS_DEFAULT, p); if (rv && !APR_STATUS_IS_EEXIST(rv)) { - apr_assert_success(tc, "make test directory", rv); + APR_ASSERT_SUCCESS(tc, "make test directory", rv); } - apr_assert_success(tc, "open file", + APR_ASSERT_SUCCESS(tc, "open file", apr_file_open(&f, TESTFN, APR_CREATE | APR_WRITE | APR_TRUNCATE, APR_OS_DEFAULT, p)); rv = apr_file_trunc(f, eightGb); - apr_assert_success(tc, "close large file", apr_file_close(f)); + APR_ASSERT_SUCCESS(tc, "close large file", apr_file_close(f)); /* 8Gb may pass rlimits or filesystem limits */ @@ -70,7 +70,7 @@ static void test_open(abts_case *tc, void *data) ABTS_NOT_IMPL(tc, "Creation of large file (limited by rlimit or fs?)"); } else { - apr_assert_success(tc, "truncate file to 8gb", rv); + APR_ASSERT_SUCCESS(tc, "truncate file to 8gb", rv); } madefile = rv == APR_SUCCESS; @@ -83,16 +83,16 @@ static void test_reopen(abts_case *tc, void *data) PRECOND; - apr_assert_success(tc, "re-open 8Gb file", + APR_ASSERT_SUCCESS(tc, "re-open 8Gb file", apr_file_open(&fh, TESTFN, APR_READ, APR_OS_DEFAULT, p)); - apr_assert_success(tc, "file_info_get failed", + APR_ASSERT_SUCCESS(tc, "file_info_get failed", apr_file_info_get(&finfo, APR_FINFO_NORM, fh)); ABTS_ASSERT(tc, "file_info_get gave incorrect size", finfo.size == eightGb); - apr_assert_success(tc, "re-close large file", apr_file_close(fh)); + APR_ASSERT_SUCCESS(tc, "re-close large file", apr_file_close(fh)); } static void test_stat(abts_case *tc, void *data) @@ -101,7 +101,7 @@ static void test_stat(abts_case *tc, void *data) PRECOND; - apr_assert_success(tc, "stat large file", + APR_ASSERT_SUCCESS(tc, "stat large file", apr_stat(&finfo, TESTFN, APR_FINFO_NORM, p)); ABTS_ASSERT(tc, "stat gave incorrect size", finfo.size == eightGb); @@ -114,7 +114,7 @@ static void test_readdir(abts_case *tc, void *data) PRECOND; - apr_assert_success(tc, "open test directory", + APR_ASSERT_SUCCESS(tc, "open test directory", apr_dir_open(&dh, TESTDIR, p)); do { @@ -130,10 +130,10 @@ static void test_readdir(abts_case *tc, void *data) } while (rv == APR_SUCCESS); if (!APR_STATUS_IS_ENOENT(rv)) { - apr_assert_success(tc, "apr_dir_read failed", rv); + APR_ASSERT_SUCCESS(tc, "apr_dir_read failed", rv); } - apr_assert_success(tc, "close test directory", + APR_ASSERT_SUCCESS(tc, "close test directory", apr_dir_close(dh)); } @@ -146,20 +146,20 @@ static void test_append(abts_case *tc, void *data) PRECOND; - apr_assert_success(tc, "open 8Gb file for append", + APR_ASSERT_SUCCESS(tc, "open 8Gb file for append", apr_file_open(&fh, TESTFN, APR_WRITE | APR_APPEND, APR_OS_DEFAULT, p)); - apr_assert_success(tc, "append to 8Gb file", + APR_ASSERT_SUCCESS(tc, "append to 8Gb file", apr_file_write_full(fh, TESTSTR, strlen(TESTSTR), NULL)); - apr_assert_success(tc, "file_info_get failed", + APR_ASSERT_SUCCESS(tc, "file_info_get failed", apr_file_info_get(&finfo, APR_FINFO_NORM, fh)); ABTS_ASSERT(tc, "file_info_get gave incorrect size", finfo.size == eightGb + strlen(TESTSTR)); - apr_assert_success(tc, "close 8Gb file", apr_file_close(fh)); + APR_ASSERT_SUCCESS(tc, "close 8Gb file", apr_file_close(fh)); } static void test_seek(abts_case *tc, void *data) @@ -169,21 +169,21 @@ static void test_seek(abts_case *tc, void *data) PRECOND; - apr_assert_success(tc, "open 8Gb file for writing", + APR_ASSERT_SUCCESS(tc, "open 8Gb file for writing", apr_file_open(&fh, TESTFN, APR_WRITE, APR_OS_DEFAULT, p)); pos = 0; - apr_assert_success(tc, "relative seek to end", + APR_ASSERT_SUCCESS(tc, "relative seek to end", apr_file_seek(fh, APR_END, &pos)); ABTS_ASSERT(tc, "seek to END gave 8Gb", pos == eightGb); pos = eightGb; - apr_assert_success(tc, "seek to 8Gb", apr_file_seek(fh, APR_SET, &pos)); + APR_ASSERT_SUCCESS(tc, "seek to 8Gb", apr_file_seek(fh, APR_SET, &pos)); ABTS_ASSERT(tc, "seek gave 8Gb offset", pos == eightGb); pos = 0; - apr_assert_success(tc, "relative seek to 0", apr_file_seek(fh, APR_CUR, &pos)); + APR_ASSERT_SUCCESS(tc, "relative seek to 0", apr_file_seek(fh, APR_CUR, &pos)); ABTS_ASSERT(tc, "relative seek gave 8Gb offset", pos == eightGb); apr_file_close(fh); @@ -196,17 +196,17 @@ static void test_write(abts_case *tc, void *data) PRECOND; - apr_assert_success(tc, "re-open 8Gb file", + APR_ASSERT_SUCCESS(tc, "re-open 8Gb file", apr_file_open(&fh, TESTFN, APR_WRITE, APR_OS_DEFAULT, p)); - apr_assert_success(tc, "seek to 8Gb - 4", + APR_ASSERT_SUCCESS(tc, "seek to 8Gb - 4", apr_file_seek(fh, APR_SET, &pos)); ABTS_ASSERT(tc, "seek gave 8Gb-4 offset", pos == eightGb - 4); - apr_assert_success(tc, "write magic string to 8Gb-4", + APR_ASSERT_SUCCESS(tc, "write magic string to 8Gb-4", apr_file_write_full(fh, "FISH", 4, NULL)); - apr_assert_success(tc, "close 8Gb file", apr_file_close(fh)); + APR_ASSERT_SUCCESS(tc, "close 8Gb file", apr_file_close(fh)); } @@ -221,23 +221,23 @@ static void test_mmap(abts_case *tc, void *data) PRECOND; - apr_assert_success(tc, "open 8gb file for mmap", + APR_ASSERT_SUCCESS(tc, "open 8gb file for mmap", apr_file_open(&fh, TESTFN, APR_READ, APR_OS_DEFAULT, p)); - apr_assert_success(tc, "mmap 8Gb file", + APR_ASSERT_SUCCESS(tc, "mmap 8Gb file", apr_mmap_create(&map, fh, off, len, APR_MMAP_READ, p)); - apr_assert_success(tc, "close file", apr_file_close(fh)); + APR_ASSERT_SUCCESS(tc, "close file", apr_file_close(fh)); ABTS_ASSERT(tc, "mapped a 16K block", map->size == len); - apr_assert_success(tc, "get pointer into mmaped region", + APR_ASSERT_SUCCESS(tc, "get pointer into mmaped region", apr_mmap_offset(&ptr, map, len - 4)); ABTS_ASSERT(tc, "pointer was not NULL", ptr != NULL); ABTS_ASSERT(tc, "found the magic string", memcmp(ptr, "FISH", 4) == 0); - apr_assert_success(tc, "delete mmap handle", apr_mmap_delete(map)); + APR_ASSERT_SUCCESS(tc, "delete mmap handle", apr_mmap_delete(map)); } #endif /* APR_HAS_MMAP */ diff --git a/test/testlock.c b/test/testlock.c index 259c5beae..9c8a14dfc 100644 --- a/test/testlock.c +++ b/test/testlock.c @@ -187,20 +187,20 @@ static void test_thread_rwlock(abts_case *tc, void *data) ABTS_NOT_IMPL(tc, "rwlocks not implemented"); return; } - apr_assert_success(tc, "rwlock_create", s1); + APR_ASSERT_SUCCESS(tc, "rwlock_create", s1); ABTS_PTR_NOTNULL(tc, rwlock); i = 0; x = 0; s1 = apr_thread_create(&t1, NULL, thread_rwlock_func, NULL, p); - apr_assert_success(tc, "create thread 1", s1); + APR_ASSERT_SUCCESS(tc, "create thread 1", s1); s2 = apr_thread_create(&t2, NULL, thread_rwlock_func, NULL, p); - apr_assert_success(tc, "create thread 2", s2); + APR_ASSERT_SUCCESS(tc, "create thread 2", s2); s3 = apr_thread_create(&t3, NULL, thread_rwlock_func, NULL, p); - apr_assert_success(tc, "create thread 3", s3); + APR_ASSERT_SUCCESS(tc, "create thread 3", s3); s4 = apr_thread_create(&t4, NULL, thread_rwlock_func, NULL, p); - apr_assert_success(tc, "create thread 4", s4); + APR_ASSERT_SUCCESS(tc, "create thread 4", s4); apr_thread_join(&s1, t1); apr_thread_join(&s2, t2); @@ -217,17 +217,17 @@ static void test_cond(abts_case *tc, void *data) int count1, count2, count3, count4; int sum; - apr_assert_success(tc, "create put mutex", + APR_ASSERT_SUCCESS(tc, "create put mutex", apr_thread_mutex_create(&put.mutex, APR_THREAD_MUTEX_DEFAULT, p)); ABTS_PTR_NOTNULL(tc, put.mutex); - apr_assert_success(tc, "create nready mutex", + APR_ASSERT_SUCCESS(tc, "create nready mutex", apr_thread_mutex_create(&nready.mutex, APR_THREAD_MUTEX_DEFAULT, p)); ABTS_PTR_NOTNULL(tc, nready.mutex); - apr_assert_success(tc, "create condvar", + APR_ASSERT_SUCCESS(tc, "create condvar", apr_thread_cond_create(&nready.cond, p)); ABTS_PTR_NOTNULL(tc, nready.cond); @@ -254,7 +254,7 @@ static void test_cond(abts_case *tc, void *data) apr_thread_join(&s3, p4); apr_thread_join(&s4, c1); - apr_assert_success(tc, "destroy condvar", + APR_ASSERT_SUCCESS(tc, "destroy condvar", apr_thread_cond_destroy(nready.cond)); sum = count1 + count2 + count3 + count4; diff --git a/test/testprocmutex.c b/test/testprocmutex.c index f03544494..10e0e62e4 100644 --- a/test/testprocmutex.c +++ b/test/testprocmutex.c @@ -99,7 +99,7 @@ static void test_exclusive(abts_case *tc, const char *lockname) int n; rv = apr_proc_mutex_create(&proc_lock, lockname, APR_LOCK_DEFAULT, p); - apr_assert_success(tc, "create the mutex", rv); + APR_ASSERT_SUCCESS(tc, "create the mutex", rv); for (n = 0; n < CHILDREN; n++) make_child(tc, &child[n], p); @@ -125,7 +125,7 @@ static void proc_mutex(abts_case *tc, void *data) rv = apr_shm_create(&shm, sizeof(int), shmname, p); } - apr_assert_success(tc, "create shm segment", rv); + APR_ASSERT_SUCCESS(tc, "create shm segment", rv); x = apr_shm_baseaddr_get(shm); test_exclusive(tc, NULL); diff --git a/test/testrand.c b/test/testrand.c index 89f500685..ceb127f14 100644 --- a/test/testrand.c +++ b/test/testrand.c @@ -29,7 +29,7 @@ static void rand_exists(abts_case *tc, void *data) /* There must be a better way to test random-ness, but I don't know * what it is right now. */ - apr_assert_success(tc, "apr_generate_random_bytes failed", + APR_ASSERT_SUCCESS(tc, "apr_generate_random_bytes failed", apr_generate_random_bytes(c, sizeof c)); #endif } diff --git a/test/testshm.c b/test/testshm.c index d26bb289e..7f3fe6556 100644 --- a/test/testshm.c +++ b/test/testshm.c @@ -64,11 +64,11 @@ static void test_anon_create(abts_case *tc, void *data) apr_shm_t *shm = NULL; rv = apr_shm_create(&shm, SHARED_SIZE, NULL, p); - apr_assert_success(tc, "Error allocating shared memory block", rv); + APR_ASSERT_SUCCESS(tc, "Error allocating shared memory block", rv); ABTS_PTR_NOTNULL(tc, shm); rv = apr_shm_destroy(shm); - apr_assert_success(tc, "Error destroying shared memory block", rv); + APR_ASSERT_SUCCESS(tc, "Error destroying shared memory block", rv); } static void test_check_size(abts_case *tc, void *data) @@ -78,14 +78,14 @@ static void test_check_size(abts_case *tc, void *data) apr_size_t retsize; rv = apr_shm_create(&shm, SHARED_SIZE, NULL, p); - apr_assert_success(tc, "Error allocating shared memory block", rv); + APR_ASSERT_SUCCESS(tc, "Error allocating shared memory block", rv); ABTS_PTR_NOTNULL(tc, shm); retsize = apr_shm_size_get(shm); ABTS_INT_EQUAL(tc, SHARED_SIZE, retsize); rv = apr_shm_destroy(shm); - apr_assert_success(tc, "Error destroying shared memory block", rv); + APR_ASSERT_SUCCESS(tc, "Error destroying shared memory block", rv); } static void test_shm_allocate(abts_case *tc, void *data) @@ -94,14 +94,14 @@ static void test_shm_allocate(abts_case *tc, void *data) apr_shm_t *shm = NULL; rv = apr_shm_create(&shm, SHARED_SIZE, NULL, p); - apr_assert_success(tc, "Error allocating shared memory block", rv); + APR_ASSERT_SUCCESS(tc, "Error allocating shared memory block", rv); ABTS_PTR_NOTNULL(tc, shm); boxes = apr_shm_baseaddr_get(shm); ABTS_PTR_NOTNULL(tc, boxes); rv = apr_shm_destroy(shm); - apr_assert_success(tc, "Error destroying shared memory block", rv); + APR_ASSERT_SUCCESS(tc, "Error destroying shared memory block", rv); } #if APR_HAS_FORK @@ -115,7 +115,7 @@ static void test_anon(abts_case *tc, void *data) int recvd; rv = apr_shm_create(&shm, SHARED_SIZE, NULL, p); - apr_assert_success(tc, "Error allocating shared memory block", rv); + APR_ASSERT_SUCCESS(tc, "Error allocating shared memory block", rv); ABTS_PTR_NOTNULL(tc, shm); retsize = apr_shm_size_get(shm); @@ -151,7 +151,7 @@ static void test_anon(abts_case *tc, void *data) ABTS_INT_EQUAL(tc, N_MESSAGES, recvd); rv = apr_shm_destroy(shm); - apr_assert_success(tc, "Error destroying shared memory block", rv); + APR_ASSERT_SUCCESS(tc, "Error destroying shared memory block", rv); } #endif @@ -167,7 +167,7 @@ static void test_named(abts_case *tc, void *data) const char *args[4]; rv = apr_shm_create(&shm, SHARED_SIZE, SHARED_FILENAME, p); - apr_assert_success(tc, "Error allocating shared memory block", rv); + APR_ASSERT_SUCCESS(tc, "Error allocating shared memory block", rv); if (rv != APR_SUCCESS) { return; } @@ -181,20 +181,20 @@ static void test_named(abts_case *tc, void *data) rv = apr_procattr_create(&attr1, p); ABTS_PTR_NOTNULL(tc, attr1); - apr_assert_success(tc, "Couldn't create attr1", rv); + APR_ASSERT_SUCCESS(tc, "Couldn't create attr1", rv); args[0] = apr_pstrdup(p, "testshmproducer" EXTENSION); args[1] = NULL; rv = apr_proc_create(&pidproducer, "./testshmproducer" EXTENSION, args, NULL, attr1, p); - apr_assert_success(tc, "Couldn't launch producer", rv); + 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); + APR_ASSERT_SUCCESS(tc, "Couldn't create attr2", rv); args[0] = apr_pstrdup(p, "testshmconsumer" EXTENSION); rv = apr_proc_create(&pidconsumer, "./testshmconsumer" EXTENSION, args, NULL, attr2, p); - apr_assert_success(tc, "Couldn't launch consumer", rv); + APR_ASSERT_SUCCESS(tc, "Couldn't launch consumer", rv); rv = apr_proc_wait(&pidconsumer, &received, &why, APR_WAIT); ABTS_INT_EQUAL(tc, APR_CHILD_DONE, rv); @@ -208,7 +208,7 @@ static void test_named(abts_case *tc, void *data) * This way, if they didn't succeed, we can just run this test again * without having to cleanup manually. */ - apr_assert_success(tc, "Error destroying shared memory", + APR_ASSERT_SUCCESS(tc, "Error destroying shared memory", apr_shm_destroy(shm)); ABTS_INT_EQUAL(tc, sent, received); @@ -221,27 +221,27 @@ static void test_named_remove(abts_case *tc, void *data) apr_shm_t *shm; rv = apr_shm_create(&shm, SHARED_SIZE, SHARED_FILENAME, p); - apr_assert_success(tc, "Error allocating shared memory block", rv); + APR_ASSERT_SUCCESS(tc, "Error allocating shared memory block", rv); if (rv != APR_SUCCESS) { return; } ABTS_PTR_NOTNULL(tc, shm); rv = apr_shm_remove(SHARED_FILENAME, p); - apr_assert_success(tc, "Error removing shared memory block", rv); + APR_ASSERT_SUCCESS(tc, "Error removing shared memory block", rv); if (rv != APR_SUCCESS) { return ; } rv = apr_shm_create(&shm, SHARED_SIZE, SHARED_FILENAME, p); - apr_assert_success(tc, "Error allocating shared memory block", rv); + APR_ASSERT_SUCCESS(tc, "Error allocating shared memory block", rv); if (rv != APR_SUCCESS) { return; } ABTS_PTR_NOTNULL(tc, shm); rv = apr_shm_destroy(shm); - apr_assert_success(tc, "Error destroying shared memory block", rv); + APR_ASSERT_SUCCESS(tc, "Error destroying shared memory block", rv); } #endif diff --git a/test/testsock.c b/test/testsock.c index 9853a8cc6..e541da2ed 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -29,21 +29,21 @@ static void launch_child(abts_case *tc, apr_proc_t *proc, const char *arg1, apr_ apr_status_t rv; rv = apr_procattr_create(&procattr, p); - apr_assert_success(tc, "Couldn't create procattr", rv); + APR_ASSERT_SUCCESS(tc, "Couldn't create procattr", rv); rv = apr_procattr_io_set(procattr, APR_NO_PIPE, APR_NO_PIPE, APR_NO_PIPE); - apr_assert_success(tc, "Couldn't set io in procattr", rv); + APR_ASSERT_SUCCESS(tc, "Couldn't set io in procattr", rv); rv = apr_procattr_error_check_set(procattr, 1); - apr_assert_success(tc, "Couldn't set error check in procattr", rv); + APR_ASSERT_SUCCESS(tc, "Couldn't set error check in procattr", rv); args[0] = "sockchild" EXTENSION; args[1] = arg1; args[2] = NULL; rv = apr_proc_create(proc, "./sockchild" EXTENSION, args, NULL, procattr, p); - apr_assert_success(tc, "Couldn't launch program", rv); + APR_ASSERT_SUCCESS(tc, "Couldn't launch program", rv); } static int wait_child(abts_case *tc, apr_proc_t *proc) @@ -64,10 +64,10 @@ static void test_addr_info(abts_case *tc, void *data) apr_sockaddr_t *sa; rv = apr_sockaddr_info_get(&sa, NULL, APR_UNSPEC, 80, 0, p); - apr_assert_success(tc, "Problem generating sockaddr", rv); + APR_ASSERT_SUCCESS(tc, "Problem generating sockaddr", rv); rv = apr_sockaddr_info_get(&sa, "127.0.0.1", APR_UNSPEC, 80, 0, p); - apr_assert_success(tc, "Problem generating sockaddr", rv); + APR_ASSERT_SUCCESS(tc, "Problem generating sockaddr", rv); ABTS_STR_EQUAL(tc, "127.0.0.1", sa->hostname); } @@ -78,17 +78,17 @@ static apr_socket_t *setup_socket(abts_case *tc) apr_socket_t *sock; rv = apr_sockaddr_info_get(&sa, NULL, APR_INET, 8021, 0, p); - apr_assert_success(tc, "Problem generating sockaddr", rv); + APR_ASSERT_SUCCESS(tc, "Problem generating sockaddr", rv); rv = apr_socket_create(&sock, sa->family, SOCK_STREAM, APR_PROTO_TCP, p); - apr_assert_success(tc, "Problem creating socket", rv); + APR_ASSERT_SUCCESS(tc, "Problem creating socket", rv); rv = apr_socket_bind(sock, sa); - apr_assert_success(tc, "Problem binding to port", rv); + APR_ASSERT_SUCCESS(tc, "Problem binding to port", rv); if (rv) return NULL; rv = apr_socket_listen(sock, 5); - apr_assert_success(tc, "Problem listening on socket", rv); + APR_ASSERT_SUCCESS(tc, "Problem listening on socket", rv); return sock; } @@ -101,7 +101,7 @@ static void test_create_bind_listen(abts_case *tc, void *data) if (!sock) return; rv = apr_socket_close(sock); - apr_assert_success(tc, "Problem closing socket", rv); + APR_ASSERT_SUCCESS(tc, "Problem closing socket", rv); } static void test_send(abts_case *tc, void *data) @@ -119,7 +119,7 @@ static void test_send(abts_case *tc, void *data) launch_child(tc, &proc, "read", p); rv = apr_socket_accept(&sock2, sock, p); - apr_assert_success(tc, "Problem with receiving connection", rv); + APR_ASSERT_SUCCESS(tc, "Problem with receiving connection", rv); apr_socket_protocol_get(sock2, &protocol); ABTS_INT_EQUAL(tc, APR_PROTO_TCP, protocol); @@ -131,9 +131,9 @@ static void test_send(abts_case *tc, void *data) ABTS_INT_EQUAL(tc, strlen(DATASTR), wait_child(tc, &proc)); rv = apr_socket_close(sock2); - apr_assert_success(tc, "Problem closing connected socket", rv); + APR_ASSERT_SUCCESS(tc, "Problem closing connected socket", rv); rv = apr_socket_close(sock); - apr_assert_success(tc, "Problem closing socket", rv); + APR_ASSERT_SUCCESS(tc, "Problem closing socket", rv); } static void test_recv(abts_case *tc, void *data) @@ -152,7 +152,7 @@ static void test_recv(abts_case *tc, void *data) launch_child(tc, &proc, "write", p); rv = apr_socket_accept(&sock2, sock, p); - apr_assert_success(tc, "Problem with receiving connection", rv); + APR_ASSERT_SUCCESS(tc, "Problem with receiving connection", rv); apr_socket_protocol_get(sock2, &protocol); ABTS_INT_EQUAL(tc, APR_PROTO_TCP, protocol); @@ -165,9 +165,9 @@ static void test_recv(abts_case *tc, void *data) ABTS_INT_EQUAL(tc, strlen(datastr), wait_child(tc, &proc)); rv = apr_socket_close(sock2); - apr_assert_success(tc, "Problem closing connected socket", rv); + APR_ASSERT_SUCCESS(tc, "Problem closing connected socket", rv); rv = apr_socket_close(sock); - apr_assert_success(tc, "Problem closing socket", rv); + APR_ASSERT_SUCCESS(tc, "Problem closing socket", rv); } static void test_timeout(abts_case *tc, void *data) @@ -185,7 +185,7 @@ static void test_timeout(abts_case *tc, void *data) launch_child(tc, &proc, "read", p); rv = apr_socket_accept(&sock2, sock, p); - apr_assert_success(tc, "Problem with receiving connection", rv); + APR_ASSERT_SUCCESS(tc, "Problem with receiving connection", rv); apr_socket_protocol_get(sock2, &protocol); ABTS_INT_EQUAL(tc, APR_PROTO_TCP, protocol); @@ -197,9 +197,9 @@ static void test_timeout(abts_case *tc, void *data) * an error. */ rv = apr_socket_close(sock2); - apr_assert_success(tc, "Problem closing connected socket", rv); + APR_ASSERT_SUCCESS(tc, "Problem closing connected socket", rv); rv = apr_socket_close(sock); - apr_assert_success(tc, "Problem closing socket", rv); + APR_ASSERT_SUCCESS(tc, "Problem closing socket", rv); } abts_suite *testsock(abts_suite *suite) diff --git a/test/testsockopt.c b/test/testsockopt.c index b04399900..0d7a67e25 100644 --- a/test/testsockopt.c +++ b/test/testsockopt.c @@ -52,7 +52,7 @@ static void set_debug(abts_case *tc, void *data) * for get/set consistency of this option. */ rv1 = apr_socket_opt_set(sock, APR_SO_DEBUG, 1); rv2 = apr_socket_opt_get(sock, APR_SO_DEBUG, &ck); - apr_assert_success(tc, "get SO_DEBUG option", rv2); + APR_ASSERT_SUCCESS(tc, "get SO_DEBUG option", rv2); if (APR_STATUS_IS_SUCCESS(rv1)) { ABTS_INT_EQUAL(tc, 1, ck); } else { diff --git a/test/testtemp.c b/test/testtemp.c index 811e31bc7..03bcfb436 100644 --- a/test/testtemp.c +++ b/test/testtemp.c @@ -23,7 +23,7 @@ static void test_temp_dir(abts_case *tc, void *data) apr_status_t rv; rv = apr_temp_dir_get(&tempdir, p); - apr_assert_success(tc, "Error finding Temporary Directory", rv); + APR_ASSERT_SUCCESS(tc, "Error finding Temporary Directory", rv); ABTS_PTR_NOTNULL(tc, tempdir); } @@ -35,11 +35,11 @@ static void test_mktemp(abts_case *tc, void *data) apr_status_t rv; rv = apr_temp_dir_get(&tempdir, p); - apr_assert_success(tc, "Error finding Temporary Directory", rv); + APR_ASSERT_SUCCESS(tc, "Error finding Temporary Directory", rv); filetemplate = apr_pstrcat(p, tempdir, "/tempfileXXXXXX", NULL); rv = apr_file_mktemp(&f, filetemplate, 0, p); - apr_assert_success(tc, "Error opening Temporary file", rv); + APR_ASSERT_SUCCESS(tc, "Error opening Temporary file", rv); } abts_suite *testtemp(abts_suite *suite) diff --git a/test/testtime.c b/test/testtime.c index 78a5078b2..9803ebdfd 100644 --- a/test/testtime.c +++ b/test/testtime.c @@ -279,7 +279,7 @@ static void test_2038(abts_case *tc, void *data) xt.tm_min = 14; xt.tm_sec = 7; - apr_assert_success(tc, "explode January 19th, 2038", + APR_ASSERT_SUCCESS(tc, "explode January 19th, 2038", apr_time_exp_get(&t, &xt)); } diff --git a/test/testuser.c b/test/testuser.c index 2f6cd760b..b3ca3e16f 100644 --- a/test/testuser.c +++ b/test/testuser.c @@ -24,7 +24,7 @@ static void uid_current(abts_case *tc, void *data) apr_uid_t uid; apr_gid_t gid; - apr_assert_success(tc, "apr_uid_current failed", + APR_ASSERT_SUCCESS(tc, "apr_uid_current failed", apr_uid_current(&uid, &gid, p)); } @@ -36,17 +36,17 @@ static void username(abts_case *tc, void *data) apr_gid_t retreived_gid; char *uname = NULL; - apr_assert_success(tc, "apr_uid_current failed", + APR_ASSERT_SUCCESS(tc, "apr_uid_current failed", apr_uid_current(&uid, &gid, p)); - apr_assert_success(tc, "apr_uid_name_get failed", + APR_ASSERT_SUCCESS(tc, "apr_uid_name_get failed", apr_uid_name_get(&uname, uid, p)); ABTS_PTR_NOTNULL(tc, uname); - apr_assert_success(tc, "apr_uid_get failed", + APR_ASSERT_SUCCESS(tc, "apr_uid_get failed", apr_uid_get(&retreived_uid, &retreived_gid, uname, p)); - apr_assert_success(tc, "apr_uid_compare failed", + APR_ASSERT_SUCCESS(tc, "apr_uid_compare failed", apr_uid_compare(uid, retreived_uid)); #ifdef WIN32 /* ### this fudge was added for Win32 but makes the test return NotImpl @@ -65,7 +65,7 @@ static void username(abts_case *tc, void *data) } else { #endif - apr_assert_success(tc, "apr_gid_compare failed", + APR_ASSERT_SUCCESS(tc, "apr_gid_compare failed", apr_gid_compare(gid, retreived_gid)); #ifdef WIN32 } @@ -79,17 +79,17 @@ static void groupname(abts_case *tc, void *data) apr_gid_t retreived_gid; char *gname = NULL; - apr_assert_success(tc, "apr_uid_current failed", + APR_ASSERT_SUCCESS(tc, "apr_uid_current failed", apr_uid_current(&uid, &gid, p)); - apr_assert_success(tc, "apr_gid_name_get failed", + APR_ASSERT_SUCCESS(tc, "apr_gid_name_get failed", apr_gid_name_get(&gname, gid, p)); ABTS_PTR_NOTNULL(tc, gname); - apr_assert_success(tc, "apr_gid_get failed", + APR_ASSERT_SUCCESS(tc, "apr_gid_get failed", apr_gid_get(&retreived_gid, gname, p)); - apr_assert_success(tc, "apr_gid_compare failed", + APR_ASSERT_SUCCESS(tc, "apr_gid_compare failed", apr_gid_compare(gid, retreived_gid)); } #else diff --git a/test/testutil.c b/test/testutil.c index 43835c152..f15b7db74 100644 --- a/test/testutil.c +++ b/test/testutil.c @@ -22,17 +22,18 @@ apr_pool_t *p; -void apr_assert_success(abts_case* tc, const char* context, apr_status_t rv) +void apr_assert_success(abts_case* tc, const char* context, apr_status_t rv, + int lineno) { if (rv == APR_ENOTIMPL) { - ABTS_NOT_IMPL(tc, context); + abts_not_impl(tc, context, lineno); } if (rv != APR_SUCCESS) { char buf[STRING_MAX], ebuf[128]; sprintf(buf, "%s (%d): %s\n", context, rv, apr_strerror(rv, ebuf, sizeof ebuf)); - ABTS_FAIL(tc, buf); + abts_fail(tc, buf, lineno); } } diff --git a/test/testutil.h b/test/testutil.h index ea9c1aeca..3e6118db6 100644 --- a/test/testutil.h +++ b/test/testutil.h @@ -38,7 +38,10 @@ extern apr_pool_t *p; /* Assert that RV is an APR_SUCCESS value; else fail giving strerror * for RV and CONTEXT message. */ -void apr_assert_success(abts_case* tc, const char *context, apr_status_t rv); +void apr_assert_success(abts_case* tc, const char *context, + apr_status_t rv, int lineno); +#define APR_ASSERT_SUCCESS(tc, ctxt, rv) \ + apr_assert_success(tc, ctxt, rv, __LINE__) void initialize(void); |