Initial source commit
This commit is contained in:
commit
f1384c11ee
335 changed files with 52715 additions and 0 deletions
27
minorGems/util/development/leakTracer/test.cc
Normal file
27
minorGems/util/development/leakTracer/test.cc
Normal file
|
@ -0,0 +1,27 @@
|
|||
/*
|
||||
* Modification History
|
||||
*
|
||||
* 2002-March-31 Jason Rohrer
|
||||
* Added test of strdup support.
|
||||
*/
|
||||
|
||||
|
||||
#include <string.h>
|
||||
|
||||
// Small leaky test program
|
||||
|
||||
void foo() {
|
||||
int *x = new int;
|
||||
}
|
||||
|
||||
int main() {
|
||||
char *str = strdup( "Test String" );
|
||||
|
||||
int *z = new int[10];
|
||||
foo();
|
||||
foo();
|
||||
delete z;
|
||||
delete z; // delete value twice
|
||||
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue