summaryrefslogtreecommitdiff
path: root/test/testatomic.c
diff options
context:
space:
mode:
authorrbb <rbb@13f79535-47bb-0310-9956-ffa450edef68>2004-05-14 14:43:22 +0000
committerrbb <rbb@13f79535-47bb-0310-9956-ffa450edef68>2004-05-14 14:43:22 +0000
commitb5bea8a701405b7b1ac952bb7a279855f467fccb (patch)
tree37a7667ab997537e737213188d1a584be9b15c97 /test/testatomic.c
parent70a121e584b140cea18b4eef627b52d944b45bbc (diff)
downloadlibapr-b5bea8a701405b7b1ac952bb7a279855f467fccb.tar.gz
Add the line number to the verbose output from abts. This also removes
a test that is segfaulting in testshm. That will need to be fixed. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@65095 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/testatomic.c')
-rw-r--r--test/testatomic.c56
1 files changed, 28 insertions, 28 deletions
diff --git a/test/testatomic.c b/test/testatomic.c
index 86f58f3b7..eb8f2a24b 100644
--- a/test/testatomic.c
+++ b/test/testatomic.c
@@ -42,14 +42,14 @@ static void test_set32(abts_case *tc, void *data)
{
apr_uint32_t y32;
apr_atomic_set32(&y32, 2);
- abts_int_equal(tc, 2, y32);
+ ABTS_INT_EQUAL(tc, 2, y32);
}
static void test_read32(abts_case *tc, void *data)
{
apr_uint32_t y32;
apr_atomic_set32(&y32, 2);
- abts_int_equal(tc, 2, apr_atomic_read32(&y32));
+ ABTS_INT_EQUAL(tc, 2, apr_atomic_read32(&y32));
}
static void test_dec32(abts_case *tc, void *data)
@@ -60,12 +60,12 @@ static void test_dec32(abts_case *tc, void *data)
apr_atomic_set32(&y32, 2);
rv = apr_atomic_dec32(&y32);
- abts_int_equal(tc, 1, y32);
- abts_assert(tc, "atomic_dec returned zero when it shouldn't", rv != 0);
+ ABTS_INT_EQUAL(tc, 1, y32);
+ ABTS_ASSERT(tc, "atomic_dec returned zero when it shouldn't", rv != 0);
rv = apr_atomic_dec32(&y32);
- abts_int_equal(tc, 0, y32);
- abts_assert(tc, "atomic_dec didn't returned zero when it should", rv == 0);
+ ABTS_INT_EQUAL(tc, 0, y32);
+ ABTS_ASSERT(tc, "atomic_dec didn't returned zero when it should", rv == 0);
}
static void test_xchg32(abts_case *tc, void *data)
@@ -76,8 +76,8 @@ static void test_xchg32(abts_case *tc, void *data)
apr_atomic_set32(&y32, 100);
oldval = apr_atomic_xchg32(&y32, 50);
- abts_int_equal(tc, 100, oldval);
- abts_int_equal(tc, 50, y32);
+ ABTS_INT_EQUAL(tc, 100, oldval);
+ ABTS_INT_EQUAL(tc, 50, y32);
}
static void test_cas_equal(abts_case *tc, void *data)
@@ -86,8 +86,8 @@ static void test_cas_equal(abts_case *tc, void *data)
apr_uint32_t oldval;
oldval = apr_atomic_cas32(&casval, 12, 0);
- abts_int_equal(tc, 0, oldval);
- abts_int_equal(tc, 12, casval);
+ ABTS_INT_EQUAL(tc, 0, oldval);
+ ABTS_INT_EQUAL(tc, 12, casval);
}
static void test_cas_equal_nonnull(abts_case *tc, void *data)
@@ -96,8 +96,8 @@ static void test_cas_equal_nonnull(abts_case *tc, void *data)
apr_uint32_t oldval;
oldval = apr_atomic_cas32(&casval, 23, 12);
- abts_int_equal(tc, 12, oldval);
- abts_int_equal(tc, 23, casval);
+ ABTS_INT_EQUAL(tc, 12, oldval);
+ ABTS_INT_EQUAL(tc, 23, casval);
}
static void test_cas_notequal(abts_case *tc, void *data)
@@ -106,8 +106,8 @@ static void test_cas_notequal(abts_case *tc, void *data)
apr_uint32_t oldval;
oldval = apr_atomic_cas32(&casval, 23, 2);
- abts_int_equal(tc, 12, oldval);
- abts_int_equal(tc, 12, casval);
+ ABTS_INT_EQUAL(tc, 12, oldval);
+ ABTS_INT_EQUAL(tc, 12, casval);
}
static void test_add32(abts_case *tc, void *data)
@@ -117,8 +117,8 @@ static void test_add32(abts_case *tc, void *data)
apr_atomic_set32(&y32, 23);
oldval = apr_atomic_add32(&y32, 4);
- abts_int_equal(tc, 23, oldval);
- abts_int_equal(tc, 27, y32);
+ ABTS_INT_EQUAL(tc, 23, oldval);
+ ABTS_INT_EQUAL(tc, 27, y32);
}
static void test_inc32(abts_case *tc, void *data)
@@ -128,8 +128,8 @@ static void test_inc32(abts_case *tc, void *data)
apr_atomic_set32(&y32, 23);
oldval = apr_atomic_inc32(&y32);
- abts_int_equal(tc, 23, oldval);
- abts_int_equal(tc, 24, y32);
+ ABTS_INT_EQUAL(tc, 23, oldval);
+ ABTS_INT_EQUAL(tc, 24, y32);
}
static void test_set_add_inc_sub(abts_case *tc, void *data)
@@ -141,7 +141,7 @@ static void test_set_add_inc_sub(abts_case *tc, void *data)
apr_atomic_inc32(&y32);
apr_atomic_sub32(&y32, 10);
- abts_int_equal(tc, 11, y32);
+ ABTS_INT_EQUAL(tc, 11, y32);
}
static void test_wrap_zero(abts_case *tc, void *data)
@@ -154,9 +154,9 @@ static void test_wrap_zero(abts_case *tc, void *data)
apr_atomic_set32(&y32, 0);
rv = apr_atomic_dec32(&y32);
- abts_assert(tc, "apr_atomic_dec32 on zero returned zero.", rv != 0);
+ ABTS_ASSERT(tc, "apr_atomic_dec32 on zero returned zero.", rv != 0);
str = apr_psprintf(p, "zero wrap failed: 0 - 1 = %d", y32);
- abts_assert(tc, str, y32 == minus1);
+ ABTS_ASSERT(tc, str, y32 == minus1);
}
static void test_inc_neg1(abts_case *tc, void *data)
@@ -168,9 +168,9 @@ static void test_inc_neg1(abts_case *tc, void *data)
rv = apr_atomic_inc32(&y32);
- abts_assert(tc, "apr_atomic_dec32 on zero returned zero.", rv == minus1);
+ ABTS_ASSERT(tc, "apr_atomic_dec32 on zero returned zero.", rv == minus1);
str = apr_psprintf(p, "zero wrap failed: -1 + 1 = %d", y32);
- abts_assert(tc, str, y32 == 0);
+ ABTS_ASSERT(tc, str, y32 == 0);
}
@@ -249,7 +249,7 @@ static void test_atomics_threaded(abts_case *tc, void *data)
r1 = apr_thread_create(&t1[i], NULL, thread_func_mutex, NULL, p);
r2 = apr_thread_create(&t2[i], NULL, thread_func_atomic, NULL, p);
r3 = apr_thread_create(&t3[i], NULL, thread_func_none, NULL, p);
- abts_assert(tc, "Failed creating threads",
+ ABTS_ASSERT(tc, "Failed creating threads",
r1 == APR_SUCCESS && r2 == APR_SUCCESS &&
r3 == APR_SUCCESS);
}
@@ -259,17 +259,17 @@ static void test_atomics_threaded(abts_case *tc, void *data)
apr_thread_join(&s2[i], t2[i]);
apr_thread_join(&s3[i], t3[i]);
- abts_assert(tc, "Invalid return value from thread_join",
+ ABTS_ASSERT(tc, "Invalid return value from thread_join",
s1[i] == exit_ret_val && s2[i] == exit_ret_val &&
s3[i] == exit_ret_val);
}
- abts_int_equal(tc, x, NUM_THREADS * NUM_ITERATIONS);
- abts_int_equal(tc, apr_atomic_read32(&y), NUM_THREADS * NUM_ITERATIONS);
+ ABTS_INT_EQUAL(tc, x, NUM_THREADS * NUM_ITERATIONS);
+ ABTS_INT_EQUAL(tc, apr_atomic_read32(&y), NUM_THREADS * NUM_ITERATIONS);
/* Comment out this test, because I have no clue what this test is
* actually telling us. We are checking something that may or may not
* be true, and it isn't really testing APR at all.
- abts_assert(tc, "We expect this to fail, because we tried to update "
+ ABTS_ASSERT(tc, "We expect this to fail, because we tried to update "
"an integer in a non-thread-safe manner.",
z != NUM_THREADS * NUM_ITERATIONS);
*/