summaryrefslogtreecommitdiff
path: root/tests/test_core.py
diff options
context:
space:
mode:
authorVasilis Kalintiris <ehostunreach@gmail.com>2013-12-06 20:14:38 +0200
committerVasilis Kalintiris <ehostunreach@gmail.com>2013-12-07 19:35:49 +0200
commitfe2422bc853882769f893af77ff97422c6716952 (patch)
tree4339d06680fdce41122851758f1ceaad1421727f /tests/test_core.py
parent15a4d1ee3a9db4fe1d0eea61613a446f68783126 (diff)
Use do_run_from_file() for test_i64_cmp2
Diffstat (limited to 'tests/test_core.py')
-rw-r--r--tests/test_core.py43
1 files changed, 3 insertions, 40 deletions
diff --git a/tests/test_core.py b/tests/test_core.py
index 319ecda6..bd57b541 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -280,48 +280,11 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co
def test_i64_cmp2(self):
if Settings.USE_TYPED_ARRAYS != 2: return self.skip('full i64 stuff only in ta2')
- src = r'''
- #include <inttypes.h>
- #include <stdio.h>
-
- typedef int32_t INT32;
- typedef int64_t INT64;
- typedef uint8_t UINT8;
-
- void interface_clock_changed()
- {
- UINT8 m_divshift;
- INT32 m_divisor;
-
- //INT64 attos = m_attoseconds_per_cycle;
- INT64 attos = 279365114840;
- m_divshift = 0;
- while (attos >= (1UL << 31))
- {
- m_divshift++;
- printf("m_divshift is %i, on %Ld >?= %lu\n", m_divshift, attos, 1UL << 31);
- attos >>= 1;
- }
- m_divisor = attos;
+ test_path = path_from_root('tests', 'core', 'test_i64_cmp2')
+ src, output = (test_path + s for s in ('.in', '.out'))
- printf("m_divisor is %i\n",m_divisor);
- }
+ self.do_run_from_file(src, output)
- int main() {
- interface_clock_changed();
- return 0;
- }
- '''
- self.do_run(src, '''m_divshift is 1, on 279365114840 >?= 2147483648
-m_divshift is 2, on 139682557420 >?= 2147483648
-m_divshift is 3, on 69841278710 >?= 2147483648
-m_divshift is 4, on 34920639355 >?= 2147483648
-m_divshift is 5, on 17460319677 >?= 2147483648
-m_divshift is 6, on 8730159838 >?= 2147483648
-m_divshift is 7, on 4365079919 >?= 2147483648
-m_divshift is 8, on 2182539959 >?= 2147483648
-m_divisor is 1091269979
-''')
def test_i64_double(self):
if Settings.USE_TYPED_ARRAYS != 2: return self.skip('full i64 stuff only in ta2')