From fefc2fd81e726b250f47a0792cdb744dd7cc2de1 Mon Sep 17 00:00:00 2001 From: Pekka Pirinen Date: Tue, 1 Aug 2000 18:30:15 +0100 Subject: [PATCH] No assert Copied from Perforce Change: 21409 ServerID: perforce.ravenbrook.com --- mps/src/awlut.c | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/mps/src/awlut.c b/mps/src/awlut.c index 37d3003f2e1..9f58725fe6a 100644 --- a/mps/src/awlut.c +++ b/mps/src/awlut.c @@ -1,18 +1,13 @@ /* impl.c.awlut: POOL CLASS AWL UNIT TEST * - * $HopeName: MMsrc!awlut.c(trunk.13) $ - * Copyright (C) 1997, 1998 The Harlequin Group Limited. All rights reserved. - * - * READERSHIP - * - * Any MPS developer, any interested QA. + * $HopeName: MMsrc!awlut.c(trunk.14) $ + * Copyright (C) 1998 Harlequin Limited. All rights reserved. * * DESIGN * * .design: see design.mps.poolawl.test.* */ - #include "mpscawl.h" #include "mpsclo.h" #include "mpsavm.h" @@ -24,11 +19,6 @@ #include "mpsw3.h" #endif #include -#include -#include -#ifdef MPS_OS_SU -#include "ossu.h" -#endif #define testArenaSIZE ((size_t)64<<20) @@ -143,6 +133,7 @@ static mps_word_t *alloc_table(unsigned long n, mps_ap_t ap) return object; } + /* gets the nth slot from a table * .assume.dylan-obj */ @@ -157,7 +148,7 @@ static mps_word_t *table_slot(mps_word_t *table, unsigned long n) static void set_table_slot(mps_word_t *table, unsigned long n, mps_word_t *p) { - assert(table[0] == (mps_word_t)table_wrapper); + cdie(table[0] == (mps_word_t)table_wrapper, "set_table_slot"); table[3+n] = (mps_word_t)p; } @@ -166,8 +157,8 @@ static void set_table_slot(mps_word_t *table, */ static void table_link(mps_word_t *t1, mps_word_t *t2) { - assert(t1[0] == (mps_word_t)table_wrapper); - assert(t2[0] == (mps_word_t)table_wrapper); + cdie(t1[0] == (mps_word_t)table_wrapper, "table_link 1"); + cdie(t2[0] == (mps_word_t)table_wrapper, "table_link 2"); t1[1] = (mps_word_t)t2; t2[1] = (mps_word_t)t1; } @@ -241,9 +232,10 @@ struct guff_s { }; /* v serves two purposes: - * A pseudo stack base for the stack root. - * Pointer to a guff structure, which packages some values needed - * (arena and thr mostly) */ + * - a pseudo stack base for the stack root. + * - pointer to a guff structure, which packages some values needed + * (arena and thr mostly) + */ static void *setup(void *v, size_t s) { struct guff_s *guff; @@ -297,13 +289,15 @@ static void *setup(void *v, size_t s) } -int main(void) +int main(int argc, char **argv) { struct guff_s guff; mps_arena_t arena; mps_thr_t thread; void *r; + randomize(argc, argv); + initialise_wrapper(wrapper_wrapper); initialise_wrapper(string_wrapper); initialise_wrapper(table_wrapper); @@ -317,6 +311,7 @@ int main(void) mps_thread_dereg(thread); mps_arena_destroy(arena); + fflush(stdout); /* synchronize */ fprintf(stderr, "\nConclusion: Failed to find any defects.\n"); return 0; }