[PyObjC-svn] r2246 - in trunk/pyobjc/pyobjc-framework-Cocoa: Lib/AppKit Lib/CoreFoundation Lib/Foundation PyObjCTest

[email protected] Sun, 24 May 2009 09:40:37 -0500
Newsgroups gmane.comp.python.pyobjc.cvs
Message-ID <[email protected]>
Author: ronaldoussoren
Date: Sun May 24 09:40:37 2009
New Revision: 2246

Log:
* First step of porting the tests to Tiger

  - Disable some tests on Tiger to ensure the tests don't crash
    the interpreter
  - Ensure the nsthread tests don't test methods that aren't
    avaible on Tiger (at least not in methods that are run on Tiger)

* The svn:ignore changes are needed for my test environment


Modified:
   trunk/pyobjc/pyobjc-framework-Cocoa/Lib/AppKit/   (props changed)
   trunk/pyobjc/pyobjc-framework-Cocoa/Lib/CoreFoundation/   (props changed)
   trunk/pyobjc/pyobjc-framework-Cocoa/Lib/Foundation/   (props changed)
   trunk/pyobjc/pyobjc-framework-Cocoa/PyObjCTest/   (props changed)
   trunk/pyobjc/pyobjc-framework-Cocoa/PyObjCTest/test_cfmessageport.py
   trunk/pyobjc/pyobjc-framework-Cocoa/PyObjCTest/test_nsgraphics.py
   trunk/pyobjc/pyobjc-framework-Cocoa/PyObjCTest/test_nsthread.py

Modified: trunk/pyobjc/pyobjc-framework-Cocoa/PyObjCTest/test_cfmessageport.py
==============================================================================
--- trunk/pyobjc/pyobjc-framework-Cocoa/PyObjCTest/test_cfmessageport.py	(original)
+++ trunk/pyobjc/pyobjc-framework-Cocoa/PyObjCTest/test_cfmessageport.py	Sun May 24 09:40:37 2009
@@ -72,7 +72,9 @@
         self.failIf(CFMessagePortIsValid(port))
         self.failUnless(didInvalidate)
 
+    @min_os_level('10.5')
     def testSending(self):
+        # FIXME: Crash on Tiger
         context = []
         def callout(port, messageid, data, info):
             print "callout"

Modified: trunk/pyobjc/pyobjc-framework-Cocoa/PyObjCTest/test_nsgraphics.py
==============================================================================
--- trunk/pyobjc/pyobjc-framework-Cocoa/PyObjCTest/test_nsgraphics.py	(original)
+++ trunk/pyobjc/pyobjc-framework-Cocoa/PyObjCTest/test_nsgraphics.py	Sun May 24 09:40:37 2009
@@ -57,6 +57,8 @@
 
 
     def testFunctions(self):
+        app = NSApplication.sharedApplication()
+
         self.failUnlessArgHasType(NSBestDepth, 4, 'o^' + objc._C_NSBOOL)
         self.failUnlessArgIsBOOL(NSBestDepth, 3)
         d, e = NSBestDepth(NSDeviceRGBColorSpace, 8, 32, False, None)

Modified: trunk/pyobjc/pyobjc-framework-Cocoa/PyObjCTest/test_nsthread.py
==============================================================================
--- trunk/pyobjc/pyobjc-framework-Cocoa/PyObjCTest/test_nsthread.py	(original)
+++ trunk/pyobjc/pyobjc-framework-Cocoa/PyObjCTest/test_nsthread.py	Sun May 24 09:40:37 2009
@@ -7,12 +7,6 @@
         self.failUnlessResultIsBOOL(NSThread.isMultiThreaded)
         self.failUnlessArgIsSEL(NSThread.detachNewThreadSelector_toTarget_withObject_, 0, 'v@:@')
         self.failUnlessResultIsBOOL(NSThread.setThreadPriority_)
-        self.failUnlessResultIsBOOL(NSThread.isMainThread)
-        self.failUnlessResultIsBOOL(NSThread.mainThread().isMainThread)
-        self.failUnlessArgIsSEL(NSThread.initWithTarget_selector_object_, 1, 'v@:@')
-        self.failUnlessResultIsBOOL(NSThread.isExecuting)
-        self.failUnlessResultIsBOOL(NSThread.isFinished)
-        self.failUnlessResultIsBOOL(NSThread.isCancelled)
 
         self.failUnlessArgIsSEL(NSThread.performSelectorOnMainThread_withObject_waitUntilDone_modes_, 0, 'v@:@')
         self.failUnlessArgIsBOOL(NSThread.performSelectorOnMainThread_withObject_waitUntilDone_modes_, 2)
@@ -21,6 +15,12 @@
 
     @min_os_level('10.5')
     def testMethods10_5(self):
+        self.failUnlessArgIsSEL(NSThread.initWithTarget_selector_object_, 1, 'v@:@')
+        self.failUnlessResultIsBOOL(NSThread.isExecuting)
+        self.failUnlessResultIsBOOL(NSThread.isFinished)
+        self.failUnlessResultIsBOOL(NSThread.isCancelled)
+        self.failUnlessResultIsBOOL(NSThread.isMainThread)
+        self.failUnlessResultIsBOOL(NSThread.mainThread().isMainThread)
         self.failUnlessArgIsSEL(NSThread.performSelector_onThread_withObject_waitUntilDone_modes_, 0, 'v@:@')
         self.failUnlessArgIsBOOL(NSThread.performSelector_onThread_withObject_waitUntilDone_modes_, 3)
         self.failUnlessArgIsSEL(NSThread.performSelector_onThread_withObject_waitUntilDone_, 0, 'v@:@')

------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com