Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/alloc2.cfa

    r1b55756 rf76ff0b  
    1313void test_base( void * ip, size_t size, size_t align) {
    1414        tests_total += 1;
    15 //      printf("DEBUG: starting test %d\n", tests_total);
    1615        bool passed = (malloc_size(ip) == size) && (malloc_usable_size(ip) >= size) && (malloc_alignment(ip) == align) && ((uintptr_t)ip % align  == 0);
    1716        if (!passed) {
     
    1918                tests_failed += 1;
    2019        }
    21 //      printf("DEBUG: done test %d\n", tests_total);
    2220}
    2321
    2422void test_fill( void * ip_, size_t start, size_t end, char fill) {
    2523        tests_total += 1;
    26 //      printf("DEBUG: starting test %d\n", tests_total);
    2724        bool passed = true;
    2825        char * ip = (char *) ip_;
     
    3229                tests_failed += 1;
    3330        }
    34 //      printf("DEBUG: done test %d\n", tests_total);
    3531}
    3632
    3733void test_fill( void * ip_, size_t start, size_t end, int fill) {
    3834        tests_total += 1;
    39 //      printf("DEBUG: starting test %d\n", tests_total);
    4035        bool passed = true;
    4136        int * ip = (int *) ip_;
     
    4540                tests_failed += 1;
    4641        }
    47 //      printf("DEBUG: done test %d\n", tests_total);
    4842}
    4943
    5044void test_fill( void * ip_, size_t start, size_t end, int * fill) {
    5145        tests_total += 1;
    52 //      printf("DEBUG: starting test %d\n", tests_total);
    5346        bool passed = (memcmp((void*)((uintptr_t)ip_ + start), (void*)fill, end) == 0);
    5447        if (!passed) {
     
    5649                tests_failed += 1;
    5750        }
    58 //      printf("DEBUG: done test %d\n", tests_total);
    5951}
    6052
    6153void test_fill( void * ip_, size_t start, size_t end, T1 fill) {
    6254        tests_total += 1;
    63 //      printf("DEBUG: starting test %d\n", tests_total);
    6455        bool passed = true;
    6556        T1 * ip = (T1 *) ip_;
     
    6960                tests_failed += 1;
    7061        }
    71 //      printf("DEBUG: done test %d\n", tests_total);
    7262}
    7363
    7464void test_fill( void * ip_, size_t start, size_t end, T1 * fill) {
    7565        tests_total += 1;
    76 //      printf("DEBUG: starting test %d\n", tests_total);
    7766        bool passed = (memcmp((void*)((uintptr_t)ip_ + start), (void*)fill, end) == 0);
    7867        if (!passed) {
     
    8069                tests_failed += 1;
    8170        }
    82 //      printf("DEBUG: done test %d\n", tests_total);
    8371}
    8472
    8573void test_use( int * ip, size_t dim) {
    8674        tests_total += 1;
    87 //      printf("DEBUG: starting test %d\n", tests_total);
    8875        bool passed = true;
    8976        for (i; 0 ~ dim) ip[i] = 0xdeadbeef;
     
    9380                tests_failed += 1;
    9481        }
    95 //      printf("DEBUG: done test %d\n", tests_total);
    9682}
    9783
    9884void test_use( T1 * ip, size_t dim) {
    9985        tests_total += 1;
    100 //      printf("DEBUG: starting test %d\n", tests_total);
    10186        bool passed = true;
    10287        for (i; 0 ~ dim) ip[i].data = 0xdeadbeef;
     
    10691                tests_failed += 1;
    10792        }
    108 //      printf("DEBUG: done test %d\n", tests_total);
    10993}
    11094
Note: See TracChangeset for help on using the changeset viewer.