diff options
Diffstat (limited to 'tests/test_core.py')
-rw-r--r-- | tests/test_core.py | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/tests/test_core.py b/tests/test_core.py index 6fcff1c4..abe79230 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -5121,29 +5121,10 @@ def process(filename): Settings.CORRUPTION_CHECK = 1 # realloc - src = r''' - #include <stdlib.h> - #include <stdio.h> - #include <assert.h> - - void bye() { - printf("all ok\n"); - } + test_path = path_from_root('tests', 'core', 'test_corruption_3') + src, output = (test_path + s for s in ('.in', '.out')) - int main(int argc, char **argv) { - atexit(bye); - - char *buffer = (char*)malloc(100); - for (int i = 0; i < 100; i++) buffer[i] = (i*i)%256; - buffer = (char*)realloc(buffer, argc + 50); - for (int i = 0; i < argc + 50; i++) { - //printf("%d : %d : %d : %d\n", i, (int)(buffer + i), buffer[i], (char)((i*i)%256)); - assert(buffer[i] == (char)((i*i)%256)); - } - return 1; - } - ''' - self.do_run(src, 'all ok\n') + self.do_run_from_file(src, output) ### Integration tests |