diff options
author | Vasilis Kalintiris <ehostunreach@gmail.com> | 2013-12-06 22:51:43 +0200 |
---|---|---|
committer | Vasilis Kalintiris <ehostunreach@gmail.com> | 2013-12-07 19:35:51 +0200 |
commit | dbb2682ebe10a8a2ed86d8ec20c24b4ef117d60d (patch) | |
tree | 176c0e4ecf6f3fc3f47d60a723f70ac8be83f379 /tests | |
parent | c9bf465d5a56efd7a14cd8ad01acccca77527aad (diff) |
Use do_run_from_file() for test_fcvt
Diffstat (limited to 'tests')
-rw-r--r-- | tests/core/test_fcvt.in | 14 | ||||
-rw-r--r-- | tests/core/test_fcvt.out | 1 | ||||
-rw-r--r-- | tests/test_core.py | 18 |
3 files changed, 18 insertions, 15 deletions
diff --git a/tests/core/test_fcvt.in b/tests/core/test_fcvt.in new file mode 100644 index 00000000..66b5adef --- /dev/null +++ b/tests/core/test_fcvt.in @@ -0,0 +1,14 @@ +/* This example borrowed from MSDN documentation */ + #include <stdlib.h> + #include <stdio.h> + + int main() { + int decimal, sign; + char *buffer; + double source = 3.1415926535; + + buffer = fcvt(source, 7, &decimal, &sign); + printf("source: %2.10f buffer: '%s' decimal: %d sign: %d\n", + source, buffer, decimal, sign); + } + diff --git a/tests/core/test_fcvt.out b/tests/core/test_fcvt.out new file mode 100644 index 00000000..835f34e7 --- /dev/null +++ b/tests/core/test_fcvt.out @@ -0,0 +1 @@ +source: 3.1415926535 buffer: '31415927' decimal: 1 sign: 0
\ No newline at end of file diff --git a/tests/test_core.py b/tests/test_core.py index 580c5c8f..b524ff70 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -830,25 +830,13 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co self.do_run_from_file(src, output) - # This example borrowed from MSDN documentation def test_fcvt(self): if self.emcc_args is None: return self.skip('requires emcc') - src = ''' - #include <stdlib.h> - #include <stdio.h> - - int main() { - int decimal, sign; - char *buffer; - double source = 3.1415926535; + test_path = path_from_root('tests', 'core', 'test_fcvt') + src, output = (test_path + s for s in ('.in', '.out')) - buffer = fcvt(source, 7, &decimal, &sign); - printf("source: %2.10f buffer: '%s' decimal: %d sign: %d\\n", - source, buffer, decimal, sign); - } - ''' - self.do_run(src, "source: 3.1415926535 buffer: '31415927' decimal: 1 sign: 0"); + self.do_run_from_file(src, output) def test_llrint(self): if Settings.USE_TYPED_ARRAYS != 2: return self.skip('requires ta2') |