summaryrefslogtreecommitdiff
path: root/test/abts.c
diff options
context:
space:
mode:
authorJoe Orton <jorton@apache.org>2004-07-08 10:53:44 +0000
committerJoe Orton <jorton@apache.org>2004-07-08 10:53:44 +0000
commit25aace7fee70fa87bfa5ba3b0eea931ccd76f192 (patch)
tree7a1c5629cefd055c7123ebf4842fda97dd707d6b /test/abts.c
parentd19df6f75165ec349129dbd97754291abf3e156b (diff)
downloadapr-25aace7fee70fa87bfa5ba3b0eea931ccd76f192.tar.gz
* test/abts.c (abts_run_test): Avoid the malloc/free.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65272 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/abts.c')
-rw-r--r--test/abts.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/test/abts.c b/test/abts.c
index 290435d67..2905a2592 100644
--- a/test/abts.c
+++ b/test/abts.c
@@ -153,7 +153,7 @@ abts_suite *abts_add_suite(abts_suite *suite, const char *suite_name_full)
void abts_run_test(abts_suite *ts, test_func f, void *value)
{
- abts_case *tc;
+ abts_case tc;
sub_suite *ss;
if (!should_test_run(ts->tail->name)) {
@@ -161,19 +161,17 @@ void abts_run_test(abts_suite *ts, test_func f, void *value)
}
ss = ts->tail;
- tc = malloc(sizeof(tc));
- tc->failed = 0;
- tc->suite = ss;
+ tc.failed = 0;
+ tc.suite = ss;
ss->num_test++;
update_status();
- f(tc, value);
+ f(&tc, value);
- if (tc->failed) {
+ if (tc.failed) {
ss->failed++;
}
- free(tc);
}
static int report(abts_suite *suite)