home *** CD-ROM | disk | FTP | other *** search
- /*********************************MAIN.C*****************************************/
- /*
- * Author: Mark Nelson
- *
- * Date: October 28, 1989
- *
- * Description: This is the main() module used to test the heap
- * debugger routines. It does a few different
- * things that should be detected by the debugger
- * routines.
- */
-
- #include <stdlib.h>
- #include <string.h>
- #include "heap.h"
-
- void main( void )
- {
- char *test_guy_1;
- char *test_guy_2;
- char *test_guy_3;
- char *maverick_pointer;
-
- test_guy_1 = malloc( 1000 );
- test_guy_2 = malloc( 2000 );
- /*
- * This call to strdup creates a maverick pointer that I should detect
- * next time I get into my debugger routines.
- */
- maverick_pointer = strdup( "This is a test" );
- test_guy_3 = malloc( 3000 );
- /*
- * Here I write one byte past my allocated area. This should create a
- * picket error.
- */
- test_guy_2[ 2000 ] = 'X';
- free( test_guy_1 );
- free( maverick_pointer );
- free( test_guy_2 );
- free( test_guy_3 );
- }
-