Commit f77fcf83 authored by James Clarke's avatar James Clarke Committed by GitHub

Fix test_itimer on x32

On x32, tv_sec and tv_usec are in fact long long rather than the standard long,
and so in Python 2.x are automatically converted to Python longs, causing the
test to fail with:

    Failed example:
        test_itimer(10, 2)
    Expected:
        (10, 2)
    Got:
        (10L, 2L)

To fix this, we should explicitly call the int constructor.
parent 5e7d4765
......@@ -22,7 +22,7 @@ def test_itimer(sec, usec):
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
return int(gtime.it_interval.tv_sec), int(gtime.it_interval.tv_usec)
def test_gettimeofday():
"""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment