Changeset 35596 for lang/objective-cplusplus/i3/trunk/src/mil
- Timestamp:
- 10/13/09 18:35:01 (4 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/objective-cplusplus/i3/trunk/src/mil/src/Test13.cpp
r35595 r35596 6 6 7 7 #include "Test.h" 8 #define MIL_TMALLOC_TBB 8 9 //#define MIL_PROFILE 10 11 //#define MIL_TMALLOC_TBB 9 12 //#define MIL_TMALLOC_MALLOC 10 #define MIL_PROFILE11 13 12 14 #ifdef MIL_TMALLOC_TBB … … 55 57 } 56 58 57 const char foo[] = " data";59 const char foo[] = "odasdfadfaigjsfogi"; 58 60 TestEvent e; 59 61 e.data = test_malloc(sizeof(foo)); … … 64 66 void execute(TestEvent& e) { 65 67 data += (intptr_t)e.data; 66 const char exp[] = " data";68 const char exp[] = "odasdfadfaigjsfogi"; 67 69 QT_CHECK(!is_bad_read_pointer(e.data, sizeof(exp))); 68 70 QT_CHECK(!is_bad_write_pointer(e.data, sizeof(exp))); … … 83 85 for (int i = 0; i < 5; i++) { 84 86 TestEvent e; 85 const char foo[] = " data";87 const char foo[] = "odasdfadfaigjsfogi"; 86 88 e.data = test_malloc(sizeof(foo)); 87 89 memcpy(e.data, foo, sizeof(foo)); … … 100 102 #elif defined(MIL_TMALLOC_MALLOC) 101 103 char* test_malloc(size_t size) { 102 return (char*)malloc( 5);104 return (char*)malloc(size); 103 105 } 104 106 void test_free(void* data) { … … 107 109 #else 108 110 char* test_malloc(size_t size) { 109 return (char*)tmalloc( 5);111 return (char*)tmalloc(size); 110 112 } 111 113 void test_free(void* data) { … … 161 163 #endif 162 164 #endif 163 for (int i = 0; i < 5; i++) {165 for (int i = 0; i < 3; i++) { 164 166 n_times(); 165 167 #ifdef MIL_PROFILE
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)