[pypy-svn] r58911 - pypy/branch/cbuild-refactor/pypy/translator/c/test

fijal at codespeak.net fijal at codespeak.net
Fri Oct 10 16:21:26 CEST 2008


Author: fijal
Date: Fri Oct 10 16:21:26 2008
New Revision: 58911

Modified:
   pypy/branch/cbuild-refactor/pypy/translator/c/test/test_extfunc.py
Log:
Remove outdated tests, unskip working one


Modified: pypy/branch/cbuild-refactor/pypy/translator/c/test/test_extfunc.py
==============================================================================
--- pypy/branch/cbuild-refactor/pypy/translator/c/test/test_extfunc.py	(original)
+++ pypy/branch/cbuild-refactor/pypy/translator/c/test/test_extfunc.py	Fri Oct 10 16:21:26 2008
@@ -382,97 +382,6 @@
     res = f(1.5)
     assert eval(res) == 1.5
 
-def test_lock():
-    py.test.skip("XXX out-of-date, and should not be here")
-    import thread
-    import pypy.module.thread.rpython.exttable   # for declare()/declaretype()
-    def fn():
-        l = thread.allocate_lock()
-        ok1 = l.acquire(True)
-        ok2 = l.acquire(False)
-        l.release()
-        ok2_and_a_half = False
-        try:
-            l.release()
-        except thread.error:
-            ok2_and_a_half = True
-        ok3 = l.acquire(False)
-        return ok1 and not ok2 and ok2_and_a_half and ok3
-    f = compile(fn, [])
-    res = f()
-    assert res is True
-
-def test_simple_start_new_thread():
-    py.test.skip("XXX out-of-date, and should not be here")
-    import thread
-    import pypy.module.thread.rpython.exttable   # for declare()/declaretype()
-    class Arg:
-        pass
-    def mythreadedfunction(arg):
-        assert arg.value == 42
-    def myotherthreadedfunction(arg):
-        assert arg.value == 43
-    a42 = Arg()
-    a42.value = 42
-    a43 = Arg()
-    a43.value = 43
-    def fn(i):
-        thread.start_new_thread(mythreadedfunction, (a42,))
-        thread.start_new_thread(myotherthreadedfunction, (a43,))
-        if i == 1:
-            x = mythreadedfunction
-            a = a42
-        else:
-            x = myotherthreadedfunction
-            a = a43
-        thread.start_new_thread(x, (a,))
-        return 42
-    f = compile(fn, [int])
-    res = f(1)
-    assert res == 42
-
-def test_start_new_thread():
-    py.test.skip("XXX out-of-date, and should not be here")
-    import thread
-    import pypy.module.thread.rpython.exttable   # for declare()/declaretype()
-    class Arg:
-        pass
-    a = Arg()
-    a.x = 5
-    a.lock = thread.allocate_lock()
-    def mythreadedfunction(arg):
-        arg.x += 37
-        arg.myident = thread.get_ident()
-        arg.lock.release()
-    def fn():
-        a.lock.acquire(True)
-        ident = thread.start_new_thread(mythreadedfunction, (a,))
-        assert ident != thread.get_ident()
-        a.lock.acquire(True)  # wait for the thread to finish
-        assert a.myident == ident
-        return a.x
-    f = compile(fn, [])
-    res = f()
-    assert res == 42
-
-def test_prebuilt_lock():
-    py.test.skip("XXX out-of-date, and should not be here")
-    import thread
-    import pypy.module.thread.rpython.exttable   # for declare()/declaretype()
-    lock0 = thread.allocate_lock()
-    lock1 = thread.allocate_lock()
-    lock1.acquire()
-    def fn(i):
-        lock = [lock0, lock1][i]
-        ok = lock.acquire(False)
-        if ok: lock.release()
-        return ok
-    f = compile(fn, [int])
-    res = f(0)
-    assert res is True
-    res = f(1)
-    assert res is False
-
 def test_os_unlink():
     tmpfile = str(udir.join('test_os_path_exists.TMP'))
     def fn():
@@ -845,10 +754,9 @@
         py.test.raises(OSError, "func()")
 
     def test_execve():
-        import py; py.test.skip("in-progress")
         filename = str(udir.join('test_execve.txt'))
+        progname = sys.executable
         def does_stuff():
-            progname = str(sys.executable)
             l = []
             l.append(progname)
             l.append("-c")



More information about the Pypy-commit mailing list