Commits

Ronald Oussoren committed 7ea52ce

- Fix bug in _AppKitMapping_NSBezierPath (+unittest)
- Don't run some NSFont tests on Jaguar (due to bug in Cocoa)

  • Participants
  • Parent commits 5495cba

Comments (0)

Files changed (3)

File pyobjc/Lib/AppKit/test/test_nsbezierpath.py

         self.assert_(p is not None)
         self.assertEquals(p.elementCount(), 5)
 
+    def test_appendPoints(self):
+        p = NSBezierPath.bezierPath()
+        self.assert_(p is not None)
+        self.assertEquals(p.elementCount(), 0)
+
+        points = [ (0, 0), (100, 0), (100, 100), (0, 0) ]
+        p.appendBezierPathWithPoints_count_(points, 3)
+        self.assertEquals(p.elementCount(), 3)
+
     def test_setLineDash(self):
         # We can barely test this, as we don't support the reverse call.
         p = NSBezierPath.bezierPath()

File pyobjc/Lib/AppKit/test/test_nsfont.py

 
 import AppKit
 
+import os
+ON_JAGUAR=((os.uname()[0] == 'Darwin') and (os.uname()[2][0] == '6'))
+
 class TestNSFont(unittest.TestCase):
     def matrixEquals(self, value1, value2):
         self.assertEquals(len(value1), len(value2))
 
         nm = o.fontName()
 
-        o = AppKit.NSFont.fontWithName_matrix_(nm, AppKit.NSFontIdentityMatrix)
-        self.assert_(o is not None)
+        if not ON_JAGUAR:
+            # Don't test this on Jaguar, see Radar #3421569.
+            o = AppKit.NSFont.fontWithName_matrix_(
+                    nm, AppKit.NSFontIdentityMatrix)
+            self.assert_(o is not None)
 
-        m = o.matrix()
-        self.assert_(isinstance(m, tuple))
-        self.assertEquals(len(m), 6)
+            m = o.matrix()
+            self.assert_(isinstance(m, tuple))
+            self.assertEquals(len(m), 6)
 
-        self.matrixEquals(m, (1.0, 0.0, 0.0, 1.0, 0.0, 0.0))
+            self.matrixEquals(m, (1.0, 0.0, 0.0, 1.0, 0.0, 0.0))
 
         o = AppKit.NSFont.fontWithName_matrix_(nm, (1.0, 2.0, 3.0, 4.0, 5.0, 6.0))
         self.assert_(o is not None)

File pyobjc/Modules/AppKit/_AppKitMapping_NSBezierPath.m

 	int count;
 	int i;
 	
-	if  (!PyArg_ParseTuple(arguments, "OiO&", &pointList, &count)) {
+	if  (!PyArg_ParseTuple(arguments, "Oi", &pointList, &count)) {
 		return NULL;
 	}