aboutsummaryrefslogtreecommitdiff
path: root/tests/test_core.py
diff options
context:
space:
mode:
authorVasilis Kalintiris <ehostunreach@gmail.com>2013-12-07 17:33:37 +0200
committerVasilis Kalintiris <ehostunreach@gmail.com>2013-12-07 19:36:02 +0200
commite01c9f0a85798f35684fa1b7e4473ecd68238535 (patch)
tree1706a8755196a6235a43ace97129aa84c9500ebc /tests/test_core.py
parent85303af22543f32728cc2cfa55bee4c558c26631 (diff)
Use do_run_from_file() for test_corruption_3
Diffstat (limited to 'tests/test_core.py')
-rw-r--r--tests/test_core.py25
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