diff options
author | Vasilis Kalintiris <ehostunreach@gmail.com> | 2013-12-07 16:48:50 +0200 |
---|---|---|
committer | Vasilis Kalintiris <ehostunreach@gmail.com> | 2013-12-07 19:36:01 +0200 |
commit | 66db5a1d3ed9055ff58a2d249c18b55f7fd677df (patch) | |
tree | bd842905a6c7bd52390973761c4ddf6d23069a66 /tests/test_core.py | |
parent | 70884fb056b4d862fc0038cdcb4a742e5d13aa94 (diff) |
Use do_run_from_file() for test_atomic
Diffstat (limited to 'tests/test_core.py')
-rw-r--r-- | tests/test_core.py | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/tests/test_core.py b/tests/test_core.py index 01bacca7..cb319500 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -4226,28 +4226,10 @@ PORT: 3979 self.do_run_from_file(src, output) def test_atomic(self): - src = ''' - #include <stdio.h> - int main() { - int x = 10; - int y = __sync_add_and_fetch(&x, 5); - printf("*%d,%d*\\n", x, y); - x = 10; - y = __sync_fetch_and_add(&x, 5); - printf("*%d,%d*\\n", x, y); - x = 10; - y = __sync_lock_test_and_set(&x, 6); - printf("*%d,%d*\\n", x, y); - x = 10; - y = __sync_bool_compare_and_swap(&x, 9, 7); - printf("*%d,%d*\\n", x, y); - y = __sync_bool_compare_and_swap(&x, 10, 7); - printf("*%d,%d*\\n", x, y); - return 0; - } - ''' + test_path = path_from_root('tests', 'core', 'test_atomic') + src, output = (test_path + s for s in ('.in', '.out')) - self.do_run(src, '*15,15*\n*15,10*\n*6,10*\n*10,0*\n*7,1*') + self.do_run_from_file(src, output) def test_phiundef(self): src = r''' |