diff --git a/ChangeLog b/ChangeLog index 47c0860a6..aba8baf4b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,20 @@ +2009-01-28 21:48-EST Gregory John Casamento + + * Testing/locktest/GNUmakefile + * Testing/locktest/GNUmakefile.preamble + * Testing/locktest/locktest.1 + * Testing/locktest/LockTestInfo.plist + * Testing/locktest/locktest.m + * Testing/locktest/locktest_Prefix.pch + * Testing/locktest/locktest.xcodeproj/project.pbxproj + * Testing/locktest/PC.project: Test which confirms the behavior + observed on Mac OS X/Cocoa. + 2009-01-28 Richard Frith-Macdonald * Source/NSEnumerator.m: Fix bug in fast enumeration code. - * Source/GSArray.m: Fix bug in array insertion introduced by last patch. + * Source/GSArray.m: Fix bug in array insertion introduced by last + patch. 2009-01-28 David Chisnall @@ -21,6 +34,7 @@ * Source/NSValue.m: ([valueWithNonretainedObject:]) zero the reference when the object is collected. +>>>>>>> .r27716 2009-01-25 Richard Frith-Macdonald * Source/NSURL.m: Compatibility tweaks for a few MacOS-X oddities... diff --git a/Testing/locktest/GNUmakefile b/Testing/locktest/GNUmakefile new file mode 100644 index 000000000..335c61a1c --- /dev/null +++ b/Testing/locktest/GNUmakefile @@ -0,0 +1,35 @@ +# +# GNUmakefile - Generated by ProjectCenter +# + +include $(GNUSTEP_MAKEFILES)/common.make + +# +# Tool +# +VERSION = 0.1 +PACKAGE_NAME = LockTest +TOOL_NAME = LockTest +LockTest_TOOL_ICON = + + +# +# Resource files +# +LockTest_RESOURCE_FILES = \ +Resources/Version \ + + +# +# Other sources +# +LockTest_OBJC_FILES += \ +locktest.m + +# +# Makefiles +# +-include GNUmakefile.preamble +include $(GNUSTEP_MAKEFILES)/aggregate.make +include $(GNUSTEP_MAKEFILES)/tool.make +-include GNUmakefile.postamble diff --git a/Testing/locktest/GNUmakefile.preamble b/Testing/locktest/GNUmakefile.preamble new file mode 100644 index 000000000..ada9791a5 --- /dev/null +++ b/Testing/locktest/GNUmakefile.preamble @@ -0,0 +1,25 @@ +# +# GNUmakefile.preamble - Generated by ProjectCenter +# + +# Additional flags to pass to the preprocessor +ADDITIONAL_CPPFLAGS += + +# Additional flags to pass to Objective C compiler +ADDITIONAL_OBJCFLAGS += + +# Additional flags to pass to C compiler +ADDITIONAL_CFLAGS += + +# Additional flags to pass to the linker +ADDITIONAL_LDFLAGS += + +# Additional include directories the compiler should search +ADDITIONAL_INCLUDE_DIRS += + +# Additional library directories the linker should search +ADDITIONAL_LIB_DIRS += + +# Additional TOOL libraries to link +ADDITIONAL_TOOL_LIBS += + diff --git a/Testing/locktest/LockTestInfo.plist b/Testing/locktest/LockTestInfo.plist new file mode 100644 index 000000000..fdd219221 --- /dev/null +++ b/Testing/locktest/LockTestInfo.plist @@ -0,0 +1,8 @@ +{ + Copyright = "Copyright (C) 200x"; + CopyrightDescription = "Released under ..."; + FullVersionID = 0.1; + ToolDescription = "No description available!"; + ToolName = LockTest; + ToolRelease = 0.1; +} \ No newline at end of file diff --git a/Testing/locktest/PC.project b/Testing/locktest/PC.project new file mode 100644 index 000000000..c9f660e8f --- /dev/null +++ b/Testing/locktest/PC.project @@ -0,0 +1,62 @@ +{ + CLASS_FILES = ( + ); + COMPILEROPTIONS = ""; + CPPOPTIONS = ""; + CREATION_DATE = "2009-01-28 18:16:19 -0500"; + DOCU_FILES = ( + ); + FRAMEWORKS = ( + ); + HEADER_FILES = ( + ); + IMAGES = ( + ); + INSTALLDIR = "$(HOME)/GNUstep/Tools"; + LANGUAGE = English; + LAST_EDITING = "2009-01-28 21:44:35 -0500"; + LIBRARIES = ( + "gnustep-base" + ); + LINKEROPTIONS = ""; + LOCALIZED_RESOURCES = ( + ); + MAKEFILEDIR = "$(GNUSTEP_MAKEFILES)"; + OBJC_COMPILEROPTIONS = ""; + OTHER_RESOURCES = ( + Version + ); + OTHER_SOURCES = ( + locktest.m + ); + PROJECT_AUTHORS = ( + ); + PROJECT_COPYRIGHT = "Copyright (C) 200x"; + PROJECT_COPYRIGHT_DESC = "Released under ..."; + PROJECT_CREATOR = "Gregory John Casamento,,,"; + PROJECT_DESCRIPTION = "No description available!"; + PROJECT_GROUP = "No group available!"; + PROJECT_MAINTAINER = "Gregory John Casamento,,,"; + PROJECT_NAME = LockTest; + PROJECT_RELEASE = 0.1; + PROJECT_SUMMARY = "No summary available!"; + PROJECT_TYPE = Tool; + PROJECT_URL = ""; + SEARCH_HEADER_DIRS = ( + ); + SEARCH_LIB_DIRS = ( + ); + SUBPROJECTS = ( + ); + SUPPORTING_FILES = ( + GNUmakefile.preamble, + GNUmakefile, + GNUmakefile.postamble, + LockTestInfo.plist + ); + TOOLICON = ""; + USER_LANGUAGES = ( + AmericanEnglish, + English + ); +} \ No newline at end of file diff --git a/Testing/locktest/locktest.1 b/Testing/locktest/locktest.1 new file mode 100644 index 000000000..d4706921b --- /dev/null +++ b/Testing/locktest/locktest.1 @@ -0,0 +1,79 @@ +.\"Modified from man(1) of FreeBSD, the NetBSD mdoc.template, and mdoc.samples. +.\"See Also: +.\"man mdoc.samples for a complete listing of options +.\"man mdoc for the short list of editing options +.\"/usr/share/misc/mdoc.template +.Dd 1/28/09 \" DATE +.Dt locktest 1 \" Program name and manual section number +.Os Darwin +.Sh NAME \" Section Header - required - don't modify +.Nm locktest, +.\" The following lines are read in generating the apropos(man -k) database. Use only key +.\" words here as the database is built based on the words here and in the .ND line. +.Nm Other_name_for_same_program(), +.Nm Yet another name for the same program. +.\" Use .Nm macro to designate other names for the documented program. +.Nd This line parsed for whatis database. +.Sh SYNOPSIS \" Section Header - required - don't modify +.Nm +.Op Fl abcd \" [-abcd] +.Op Fl a Ar path \" [-a path] +.Op Ar file \" [file] +.Op Ar \" [file ...] +.Ar arg0 \" Underlined argument - use .Ar anywhere to underline +arg2 ... \" Arguments +.Sh DESCRIPTION \" Section Header - required - don't modify +Use the .Nm macro to refer to your program throughout the man page like such: +.Nm +Underlining is accomplished with the .Ar macro like this: +.Ar underlined text . +.Pp \" Inserts a space +A list of items with descriptions: +.Bl -tag -width -indent \" Begins a tagged list +.It item a \" Each item preceded by .It macro +Description of item a +.It item b +Description of item b +.El \" Ends the list +.Pp +A list of flags and their descriptions: +.Bl -tag -width -indent \" Differs from above in tag removed +.It Fl a \"-a flag as a list item +Description of -a flag +.It Fl b +Description of -b flag +.El \" Ends the list +.Pp +.\" .Sh ENVIRONMENT \" May not be needed +.\" .Bl -tag -width "ENV_VAR_1" -indent \" ENV_VAR_1 is width of the string ENV_VAR_1 +.\" .It Ev ENV_VAR_1 +.\" Description of ENV_VAR_1 +.\" .It Ev ENV_VAR_2 +.\" Description of ENV_VAR_2 +.\" .El +.Sh FILES \" File used or created by the topic of the man page +.Bl -tag -width "/Users/joeuser/Library/really_long_file_name" -compact +.It Pa /usr/share/file_name +FILE_1 description +.It Pa /Users/joeuser/Library/really_long_file_name +FILE_2 description +.El \" Ends the list +.\" .Sh DIAGNOSTICS \" May not be needed +.\" .Bl -diag +.\" .It Diagnostic Tag +.\" Diagnostic informtion here. +.\" .It Diagnostic Tag +.\" Diagnostic informtion here. +.\" .El +.Sh SEE ALSO +.\" List links in ascending order by section, alphabetically within a section. +.\" Please do not reference files that do not exist without filing a bug report +.Xr a 1 , +.Xr b 1 , +.Xr c 1 , +.Xr a 2 , +.Xr b 2 , +.Xr a 3 , +.Xr b 3 +.\" .Sh BUGS \" Document known, unremedied bugs +.\" .Sh HISTORY \" Document history if command behaves in a unique manner \ No newline at end of file diff --git a/Testing/locktest/locktest.m b/Testing/locktest/locktest.m new file mode 100644 index 000000000..5183d3e12 --- /dev/null +++ b/Testing/locktest/locktest.m @@ -0,0 +1,68 @@ +#import + +BOOL pass; + +void testNSLockTryLock() +{ + // insert code here... + NSLock *lock = [[NSLock alloc] init]; + [lock tryLock]; + [lock tryLock]; + [lock unlock]; + [lock release]; +} + +void testNSConditionLockTryLock() +{ + // insert code here... + NSConditionLock *lock = [[NSConditionLock alloc] init]; + [lock tryLock]; + [lock tryLock]; + [lock unlock]; + [lock release]; +} + +void testNSRecursiveLockTryLock() +{ + // insert code here... + NSRecursiveLock *lock = [[NSRecursiveLock alloc] init]; + [lock tryLock]; + [lock tryLock]; + [lock unlock]; + [lock unlock]; + [lock release]; +} + +void singleThreadedTests() +{ + NS_DURING + { + // single threaded tests... + testNSLockTryLock(); + testNSConditionLockTryLock(); + testNSRecursiveLockTryLock(); + } + NS_HANDLER + { + NSLog(@"Test failed"); + pass = NO; + } + NS_ENDHANDLER +} + +void multiThreadedTests() +{ +} + +int main (int argc, const char * argv[]) { + NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; + + pass = YES; + // single threaded tests... + singleThreadedTests(); + // multi threaded tests... + multiThreadedTests(); + assert(pass == YES); + [pool drain]; + return 0; +} diff --git a/Testing/locktest/locktest.xcodeproj/project.pbxproj b/Testing/locktest/locktest.xcodeproj/project.pbxproj new file mode 100644 index 000000000..bbf63028e --- /dev/null +++ b/Testing/locktest/locktest.xcodeproj/project.pbxproj @@ -0,0 +1,218 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 44; + objects = { + +/* Begin PBXBuildFile section */ + 8DD76F9A0486AA7600D96B5E /* locktest.m in Sources */ = {isa = PBXBuildFile; fileRef = 08FB7796FE84155DC02AAC07 /* locktest.m */; settings = {ATTRIBUTES = (); }; }; + 8DD76F9C0486AA7600D96B5E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 08FB779EFE84155DC02AAC07 /* Foundation.framework */; }; + 8DD76F9F0486AA7600D96B5E /* locktest.1 in CopyFiles */ = {isa = PBXBuildFile; fileRef = C6859EA3029092ED04C91782 /* locktest.1 */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 8DD76F9E0486AA7600D96B5E /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 8; + dstPath = /usr/share/man/man1/; + dstSubfolderSpec = 0; + files = ( + 8DD76F9F0486AA7600D96B5E /* locktest.1 in CopyFiles */, + ); + runOnlyForDeploymentPostprocessing = 1; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 08FB7796FE84155DC02AAC07 /* locktest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = locktest.m; sourceTree = ""; }; + 08FB779EFE84155DC02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; + 32A70AAB03705E1F00C91783 /* locktest_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = locktest_Prefix.pch; sourceTree = ""; }; + 8DD76FA10486AA7600D96B5E /* locktest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = locktest; sourceTree = BUILT_PRODUCTS_DIR; }; + C6859EA3029092ED04C91782 /* locktest.1 */ = {isa = PBXFileReference; lastKnownFileType = text.man; path = locktest.1; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8DD76F9B0486AA7600D96B5E /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8DD76F9C0486AA7600D96B5E /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 08FB7794FE84155DC02AAC07 /* locktest */ = { + isa = PBXGroup; + children = ( + 08FB7795FE84155DC02AAC07 /* Source */, + C6859EA2029092E104C91782 /* Documentation */, + 08FB779DFE84155DC02AAC07 /* External Frameworks and Libraries */, + 1AB674ADFE9D54B511CA2CBB /* Products */, + ); + name = locktest; + sourceTree = ""; + }; + 08FB7795FE84155DC02AAC07 /* Source */ = { + isa = PBXGroup; + children = ( + 32A70AAB03705E1F00C91783 /* locktest_Prefix.pch */, + 08FB7796FE84155DC02AAC07 /* locktest.m */, + ); + name = Source; + sourceTree = ""; + }; + 08FB779DFE84155DC02AAC07 /* External Frameworks and Libraries */ = { + isa = PBXGroup; + children = ( + 08FB779EFE84155DC02AAC07 /* Foundation.framework */, + ); + name = "External Frameworks and Libraries"; + sourceTree = ""; + }; + 1AB674ADFE9D54B511CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + 8DD76FA10486AA7600D96B5E /* locktest */, + ); + name = Products; + sourceTree = ""; + }; + C6859EA2029092E104C91782 /* Documentation */ = { + isa = PBXGroup; + children = ( + C6859EA3029092ED04C91782 /* locktest.1 */, + ); + name = Documentation; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 8DD76F960486AA7600D96B5E /* locktest */ = { + isa = PBXNativeTarget; + buildConfigurationList = 1DEB927408733DD40010E9CD /* Build configuration list for PBXNativeTarget "locktest" */; + buildPhases = ( + 8DD76F990486AA7600D96B5E /* Sources */, + 8DD76F9B0486AA7600D96B5E /* Frameworks */, + 8DD76F9E0486AA7600D96B5E /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = locktest; + productInstallPath = "$(HOME)/bin"; + productName = locktest; + productReference = 8DD76FA10486AA7600D96B5E /* locktest */; + productType = "com.apple.product-type.tool"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 08FB7793FE84155DC02AAC07 /* Project object */ = { + isa = PBXProject; + buildConfigurationList = 1DEB927808733DD40010E9CD /* Build configuration list for PBXProject "locktest" */; + compatibilityVersion = "Xcode 3.0"; + hasScannedForEncodings = 1; + mainGroup = 08FB7794FE84155DC02AAC07 /* locktest */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 8DD76F960486AA7600D96B5E /* locktest */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXSourcesBuildPhase section */ + 8DD76F990486AA7600D96B5E /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8DD76F9A0486AA7600D96B5E /* locktest.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 1DEB927508733DD40010E9CD /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = NO; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_FIX_AND_CONTINUE = YES; + GCC_MODEL_TUNING = G5; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = locktest_Prefix.pch; + INSTALL_PATH = /usr/local/bin; + PRODUCT_NAME = locktest; + ZERO_LINK = YES; + }; + name = Debug; + }; + 1DEB927608733DD40010E9CD /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_MODEL_TUNING = G5; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = locktest_Prefix.pch; + INSTALL_PATH = /usr/local/bin; + PRODUCT_NAME = locktest; + }; + name = Release; + }; + 1DEB927908733DD40010E9CD /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + PREBINDING = NO; + SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk"; + }; + name = Debug; + }; + 1DEB927A08733DD40010E9CD /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = ( + ppc, + i386, + ); + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + PREBINDING = NO; + SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 1DEB927408733DD40010E9CD /* Build configuration list for PBXNativeTarget "locktest" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1DEB927508733DD40010E9CD /* Debug */, + 1DEB927608733DD40010E9CD /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 1DEB927808733DD40010E9CD /* Build configuration list for PBXProject "locktest" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1DEB927908733DD40010E9CD /* Debug */, + 1DEB927A08733DD40010E9CD /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 08FB7793FE84155DC02AAC07 /* Project object */; +} diff --git a/Testing/locktest/locktest_Prefix.pch b/Testing/locktest/locktest_Prefix.pch new file mode 100644 index 000000000..acf2c88ab --- /dev/null +++ b/Testing/locktest/locktest_Prefix.pch @@ -0,0 +1,7 @@ +// +// Prefix header for all source files of the 'locktest' target in the 'locktest' project. +// + +#ifdef __OBJC__ + #import +#endif