Search
lxdream.org :: lxdream/test/testdata.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename test/testdata.c
changeset 345:7a26147e5dce
prev266:2f811793bd0a
next561:533f6b478071
author nkeynes
date Tue Feb 13 08:34:27 2007 +0000 (17 years ago)
permissions -rw-r--r--
last change Add tests for FLOAT and FTRC
Comment out user-mode exception test (broken)
file annotate diff log raw
1.1 --- a/test/testdata.c Sat Jan 06 04:07:43 2007 +0000
1.2 +++ b/test/testdata.c Tue Feb 13 08:34:27 2007 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: testdata.c,v 1.4 2007-01-06 04:07:43 nkeynes Exp $
1.6 + * $Id: testdata.c,v 1.5 2007-01-31 11:01:58 nkeynes Exp $
1.7 *
1.8 * Test data loader.
1.9 *
1.10 @@ -100,6 +100,10 @@
1.11 *end = '\0';
1.12 current_size = DEFAULT_SIZE;
1.13 test_data_t test = malloc(current_size);
1.14 + if( test == NULL ) {
1.15 + fprintf( stderr, "Memory alloc failed: %d\n", current_size );
1.16 + return NULL;
1.17 + }
1.18 memset( test, 0, current_size );
1.19
1.20 dataptr = (char *)(test+1);
1.21 @@ -130,6 +134,10 @@
1.22 current_end += current_size;
1.23 current_size *= 2;
1.24 current = realloc(current, current_size );
1.25 + if( current == NULL ) {
1.26 + fprintf( stderr, "Memory alloc failed: %d\n", current_size );
1.27 + return NULL;
1.28 + }
1.29 if( last != NULL )
1.30 last->next = current;
1.31 }
1.32 @@ -155,6 +163,10 @@
1.33 current_end += current_size;
1.34 current_size *= 2;
1.35 current = realloc(current, current_size );
1.36 + if( current == NULL ) {
1.37 + fprintf( stderr, "Memory alloc failed: %d\n", current_size );
1.38 + return NULL;
1.39 + }
1.40 memset( current + old_size, 0, old_size );
1.41 if( last != NULL )
1.42 last->next = current;
.