aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/core/test_timeb.in15
-rw-r--r--tests/core/test_timeb.out1
-rw-r--r--tests/test_core.py18
3 files changed, 19 insertions, 15 deletions
diff --git a/tests/core/test_timeb.in b/tests/core/test_timeb.in
new file mode 100644
index 00000000..baaefb8c
--- /dev/null
+++ b/tests/core/test_timeb.in
@@ -0,0 +1,15 @@
+
+ #include <stdio.h>
+ #include <assert.h>
+ #include <sys/timeb.h>
+
+ int main() {
+ timeb tb;
+ tb.timezone = 1;
+ printf("*%d\n", ftime(&tb));
+ assert(tb.time > 10000);
+ assert(tb.timezone == 0);
+ assert(tb.dstflag == 0);
+ return 0;
+ }
+ \ No newline at end of file
diff --git a/tests/core/test_timeb.out b/tests/core/test_timeb.out
new file mode 100644
index 00000000..488c9af7
--- /dev/null
+++ b/tests/core/test_timeb.out
@@ -0,0 +1 @@
+*0
diff --git a/tests/test_core.py b/tests/test_core.py
index 49a4d094..35be9651 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -2444,22 +2444,10 @@ The current type of b is: 9
def test_timeb(self):
# Confirms they are called in reverse order
- src = r'''
- #include <stdio.h>
- #include <assert.h>
- #include <sys/timeb.h>
+ test_path = path_from_root('tests', 'core', 'test_timeb')
+ src, output = (test_path + s for s in ('.in', '.out'))
- int main() {
- timeb tb;
- tb.timezone = 1;
- printf("*%d\n", ftime(&tb));
- assert(tb.time > 10000);
- assert(tb.timezone == 0);
- assert(tb.dstflag == 0);
- return 0;
- }
- '''
- self.do_run(src, '*0\n')
+ self.do_run_from_file(src, output)
def test_time_c(self):
src = r'''