Author: Tim Felgentreff <[email protected]>
Branch: bitblt
Changeset: r207:fceab4630b40
Date: 2013-03-18 13:51 +0100
http://bitbucket.org/pypy/lang-smalltalk/changeset/fceab4630b40/

Log:    test that BITBLT_COPY_BITS primitive calls simulateCopyBits on the
        receiver

diff --git a/spyvm/test/test_primitives.py b/spyvm/test/test_primitives.py
--- a/spyvm/test/test_primitives.py
+++ b/spyvm/test/test_primitives.py
@@ -666,6 +666,24 @@
     finally:
         monkeypatch.undo()
 
+def test_bitblt_copy_bits(monkeypatch):
+    class CallCopyBitsSimulation(Exception):
+        pass
+
+    def perform_mock(w_rcvr, string):
+        if string == "simulateCopyBits":
+            raise CallCopyBitsSimulation
+
+    mock_bitblt = model.W_PointersObject(space.w_Point, 15)
+    interp, w_frame, argument_count = mock([mock_bitblt], None)
+
+    try:
+        monkeypatch.setattr(interp, "perform", perform_mock)
+        with py.test.raises(CallCopyBitsSimulation):
+            prim_table[primitives.BITBLT_COPY_BITS](interp, 
w_frame.as_context_get_shadow(space), argument_count-1)
+    finally:
+        monkeypatch.undo()
+
 # Note:
 #   primitives.NEXT is unimplemented as it is a performance optimization
 #   primitives.NEXT_PUT is unimplemented as it is a performance optimization
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to