Ronald Oussoren avatar Ronald Oussoren committed b19dd60

Fix most test failures on OSX 10.8 (still missing fix for a formal-protocol issue

Comments (0)

Files changed (7)


 (This is the MIT license, note that libffi-src is a separate product with its own license)
 Copyright 2002, 2003 - Bill Bumgarner, Ronald Oussoren, Steve Majewski, Lele Gaifax,
+Copyright 2003-2012 - Ronald Oussoren
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:


 		SEL theSel = PyObjCSelector_GetSelector(sel);
 		const char* theSignature = PyObjCSelector_Signature(sel);
-		protocol_addMethodDescription(theProtocol, theSel, theSignature, PyObjCSelector_Required(sel), !PyObjCSelector_IsClassMethod(sel));
+		protocol_addMethodDescription(theProtocol, theSel, theSignature, 
+				PyObjCSelector_Required(sel), !PyObjCSelector_IsClassMethod(sel));


+#if PyObjC_BUILD_RELEASE < 1008
 @implementation Object (NSOBjectCompat)
 - self


 /* Copyright (c) 1996,97,98 by Lele Gaifax.  All Rights Reserved
- * Copyright (c) 2002-2008 Ronald Oussoren
+ * Copyright (c) 2002-2012 Ronald Oussoren
  * This software may be used and distributed freely for any purpose
  * provided that this notice is included unchanged on any and all
 @end /* PyObjCSupport */
+#if PyObjC_BUILD_RELEASE < 1008
 @interface Object (PyObjCSupport)
 @end /* PyObjCSupport */
 @interface NSString (PyObjCSupport)


 	if (Object_class == nil) {
-		Object_class = [Object class];
+		Object_class = objc_getClass("Object");
 	if (name[0] == '_' && name[1] == '_') {
 				methsig = [cls instanceMethodSignatureForSelector:sel];
 				retval = PyObjCSelector_NewNative(cls, sel, 
 					PyObjC_NSMethodSignatureToTypeString(methsig, buf, sizeof(buf)), 0);
-			} else if ((cls != Object_class) && nil != (methsig = [(NSObject*)cls methodSignatureForSelector:sel])) {
+			} else if ((Object_class != nil) && (cls != Object_class) && nil != (methsig = [(NSObject*)cls methodSignatureForSelector:sel])) {
 				retval = PyObjCSelector_NewNative(cls, sel, 
 						methsig, buf, sizeof(buf)), 1);


 from .testbndl import FLT_MAX, FLT_MIN, FLT_EPSILON
 import objc
 import array, sys
+from warnings import filterwarnings
             self.assertEqual(ULLONG_MAX, pyObjCPy(objc._C_ULNG_LNG, long(ULLONG_MAX)))
         self.assertEqual(0, pyObjCPy(objc._C_ULNG_LNG, float(0)))
-        with filterWarnings('error', DeprecationWarning):
+        with filterwarnings('error', DeprecationWarning):
                 pyObjCPy(objc._C_ULNG_LNG, LLONG_MIN+100)
             except DeprecationWarning:
       "No deprecation warning")
-        with filterWarnings('ignore', DeprecationWarning):
+        with filterwarnings('ignore', DeprecationWarning):
             self.assertEqual(-LLONG_MIN+100, pyObjCPy(objc._C_ULNG_LNG, LLONG_MIN+100))
         #self.assertRaises(ValueError, pyObjCPy, objc._C_ULNG_LNG, LLONG_MIN)


     basetype = NSMutableSet
     def test_copy(self):
-        dup = self.s.copy()
+        #dup = self.s.copy()
+        dup = self.s.mutableCopy()
         self.assertEqual(self.s, dup)
         self.assertNotEqual(id(self.s), id(dup))
         #self.assertEqual(type(dup), self.basetype)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.