- Timestamp:
- Sep 7, 2020, 7:52:02 PM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 113d785
- Parents:
- 943a079
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/alloc2.cfa
r943a079 r1b55756 13 13 void test_base( void * ip, size_t size, size_t align) { 14 14 tests_total += 1; 15 // printf("DEBUG: starting test %d\n", tests_total); 15 16 bool passed = (malloc_size(ip) == size) && (malloc_usable_size(ip) >= size) && (malloc_alignment(ip) == align) && ((uintptr_t)ip % align == 0); 16 17 if (!passed) { … … 18 19 tests_failed += 1; 19 20 } 21 // printf("DEBUG: done test %d\n", tests_total); 20 22 } 21 23 22 24 void test_fill( void * ip_, size_t start, size_t end, char fill) { 23 25 tests_total += 1; 26 // printf("DEBUG: starting test %d\n", tests_total); 24 27 bool passed = true; 25 28 char * ip = (char *) ip_; … … 29 32 tests_failed += 1; 30 33 } 34 // printf("DEBUG: done test %d\n", tests_total); 31 35 } 32 36 33 37 void test_fill( void * ip_, size_t start, size_t end, int fill) { 34 38 tests_total += 1; 39 // printf("DEBUG: starting test %d\n", tests_total); 35 40 bool passed = true; 36 41 int * ip = (int *) ip_; … … 40 45 tests_failed += 1; 41 46 } 47 // printf("DEBUG: done test %d\n", tests_total); 42 48 } 43 49 44 50 void test_fill( void * ip_, size_t start, size_t end, int * fill) { 45 51 tests_total += 1; 52 // printf("DEBUG: starting test %d\n", tests_total); 46 53 bool passed = (memcmp((void*)((uintptr_t)ip_ + start), (void*)fill, end) == 0); 47 54 if (!passed) { … … 49 56 tests_failed += 1; 50 57 } 58 // printf("DEBUG: done test %d\n", tests_total); 51 59 } 52 60 53 61 void test_fill( void * ip_, size_t start, size_t end, T1 fill) { 54 62 tests_total += 1; 63 // printf("DEBUG: starting test %d\n", tests_total); 55 64 bool passed = true; 56 65 T1 * ip = (T1 *) ip_; … … 60 69 tests_failed += 1; 61 70 } 71 // printf("DEBUG: done test %d\n", tests_total); 62 72 } 63 73 64 74 void test_fill( void * ip_, size_t start, size_t end, T1 * fill) { 65 75 tests_total += 1; 76 // printf("DEBUG: starting test %d\n", tests_total); 66 77 bool passed = (memcmp((void*)((uintptr_t)ip_ + start), (void*)fill, end) == 0); 67 78 if (!passed) { … … 69 80 tests_failed += 1; 70 81 } 82 // printf("DEBUG: done test %d\n", tests_total); 71 83 } 72 84 73 85 void test_use( int * ip, size_t dim) { 74 86 tests_total += 1; 87 // printf("DEBUG: starting test %d\n", tests_total); 75 88 bool passed = true; 76 89 for (i; 0 ~ dim) ip[i] = 0xdeadbeef; … … 80 93 tests_failed += 1; 81 94 } 95 // printf("DEBUG: done test %d\n", tests_total); 82 96 } 83 97 84 98 void test_use( T1 * ip, size_t dim) { 85 99 tests_total += 1; 100 // printf("DEBUG: starting test %d\n", tests_total); 86 101 bool passed = true; 87 102 for (i; 0 ~ dim) ip[i].data = 0xdeadbeef; … … 91 106 tests_failed += 1; 92 107 } 108 // printf("DEBUG: done test %d\n", tests_total); 93 109 } 94 110
Note: See TracChangeset
for help on using the changeset viewer.