5 /* The original test driver machinery. */
6 #define N_TEST_TRANSACTIONS 500
7 #define N_TEST_ARR 2000
9 #define M_TEST_MALLOC 1000
11 void* test_arr
[N_TEST_ARR
];
13 unsigned myrandom(void)
15 /* Simple multiply-with-carry random generator. */
16 static unsigned m_w
= 11;
17 static unsigned m_z
= 13;
19 m_z
= 36969 * (m_z
& 65535) + (m_z
>> 16);
20 m_w
= 18000 * (m_w
& 65535) + (m_w
>> 16);
21 return (m_z
<< 16) + m_w
;
24 int main ( int argc
, char** argv
)
29 for (i
= 0; i
< N_TEST_ARR
; i
++)
32 for (i
= 0; i
< N_TEST_TRANSACTIONS
; i
++) {
33 j
= myrandom() % N_TEST_ARR
;
38 nbytes
= 1 + myrandom() % M_TEST_MALLOC
;
39 if (myrandom()%64 == 32)
41 test_arr
[j
] = malloc( nbytes
);
43 for (k
= 1; k
< nbytes
; k
++)
44 chp
[k
] = (unsigned char)(k
+ 99);
48 for (i
= 0; test_arr
[i
] == NULL
; i
++) ;
50 ((char*)test_arr
[i
])[0] = 0;
52 for (i
= 0; i
< N_TEST_ARR
; i
++) {