Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gwenaël Samain
cython
Commits
019f8a66
Commit
019f8a66
authored
Sep 24, 2014
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
split posix time tests in the same way as posix/time.pxd file before
parent
4562c6b5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
30 deletions
+35
-30
Cython/Includes/posix/resource.pxd
Cython/Includes/posix/resource.pxd
+1
-1
tests/run/posix_sys_time.pyx
tests/run/posix_sys_time.pyx
+33
-0
tests/run/posix_time.pyx
tests/run/posix_time.pyx
+1
-29
No files found.
Cython/Includes/posix/resource.pxd
View file @
019f8a66
# http://pubs.opengroup.org/onlinepubs/009695399/basedefs/sys/resource.h.html
from
posix.time
cimport
timeval
from
posix.
sys_
time
cimport
timeval
from
posix.types
cimport
id_t
cdef
extern
from
"sys/resource.h"
nogil
:
...
...
tests/run/posix_sys_time.pyx
0 → 100644
View file @
019f8a66
# tag: posix
from
posix.sys_time
cimport
*
def
test_itimer
(
sec
,
usec
):
"""
>>> test_itimer(10, 2)
(10, 2)
"""
cdef
itimerval
t
,
gtime
t
.
it_interval
.
tv_sec
=
sec
t
.
it_interval
.
tv_usec
=
usec
t
.
it_value
.
tv_sec
=
sec
t
.
it_value
.
tv_usec
=
usec
ret
=
setitimer
(
ITIMER_REAL
,
&
t
,
NULL
)
assert
ret
==
0
ret
=
getitimer
(
ITIMER_REAL
,
&
gtime
)
assert
ret
==
0
t
.
it_interval
.
tv_sec
=
0
t
.
it_interval
.
tv_usec
=
0
t
.
it_value
.
tv_sec
=
0
t
.
it_value
.
tv_usec
=
0
ret
=
setitimer
(
ITIMER_REAL
,
&
t
,
NULL
)
return
gtime
.
it_interval
.
tv_sec
,
gtime
.
it_interval
.
tv_usec
def
test_gettimeofday
():
"""
>>> test_gettimeofday()
"""
cdef
timeval
t
ret
=
gettimeofday
(
&
t
,
NULL
)
assert
ret
==
0
tests/run/posix_time.pyx
View file @
019f8a66
...
...
@@ -3,35 +3,6 @@ from libc.stdlib cimport getenv
from
posix.stdlib
cimport
setenv
,
unsetenv
from
posix.time
cimport
*
def
test_itimer
(
sec
,
usec
):
"""
>>> test_itimer(10, 2)
(10, 2)
"""
cdef
itimerval
t
,
gtime
t
.
it_interval
.
tv_sec
=
sec
t
.
it_interval
.
tv_usec
=
usec
t
.
it_value
.
tv_sec
=
sec
t
.
it_value
.
tv_usec
=
usec
ret
=
setitimer
(
ITIMER_REAL
,
&
t
,
NULL
)
assert
ret
==
0
ret
=
getitimer
(
ITIMER_REAL
,
&
gtime
)
assert
ret
==
0
t
.
it_interval
.
tv_sec
=
0
t
.
it_interval
.
tv_usec
=
0
t
.
it_value
.
tv_sec
=
0
t
.
it_value
.
tv_usec
=
0
ret
=
setitimer
(
ITIMER_REAL
,
&
t
,
NULL
)
return
gtime
.
it_interval
.
tv_sec
,
gtime
.
it_interval
.
tv_usec
def
test_gettimeofday
():
"""
>>> test_gettimeofday()
"""
cdef
timeval
t
ret
=
gettimeofday
(
&
t
,
NULL
)
assert
ret
==
0
def
test_time
():
"""
...
...
@@ -43,6 +14,7 @@ def test_time():
t1
=
time
(
&
t2
)
assert
t1
==
t2
def
test_mktime
():
"""
tests/run/posix_time.pyx
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment