summaryrefslogtreecommitdiffstats
path: root/Tests/ObjC++/objc++.mm
diff options
context:
space:
mode:
authorYves Starreveld <ystarrev@uwo.ca>2002-11-27 00:01:51 (GMT)
committerYves Starreveld <ystarrev@uwo.ca>2002-11-27 00:01:51 (GMT)
commitad01416a1115ef58a30278d14c49b14bd5f69d95 (patch)
treea80b86c7bfc30896b9f832af65a585cb7821a6ad /Tests/ObjC++/objc++.mm
parentcab011b7eca8a04deae25aaa4270ab5a027541ab (diff)
downloadCMake-ad01416a1115ef58a30278d14c49b14bd5f69d95.zip
CMake-ad01416a1115ef58a30278d14c49b14bd5f69d95.tar.gz
CMake-ad01416a1115ef58a30278d14c49b14bd5f69d95.tar.bz2
Test for ObjC++ on OSX machines only
Diffstat (limited to 'Tests/ObjC++/objc++.mm')
-rw-r--r--Tests/ObjC++/objc++.mm22
1 files changed, 22 insertions, 0 deletions
diff --git a/Tests/ObjC++/objc++.mm b/Tests/ObjC++/objc++.mm
new file mode 100644
index 0000000..b7ec4b5
--- /dev/null
+++ b/Tests/ObjC++/objc++.mm
@@ -0,0 +1,22 @@
+#import <iostream.h>
+#import <Cocoa/Cocoa.h>
+
+int main()
+{
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+
+ NSMutableSet *mySet = [NSMutableSet set];
+ cout<<"Adding values to the set."<<endl;
+ [mySet addObject:[NSNumber numberWithInt:356]];
+ [mySet addObject:[NSNumber numberWithInt:550]];
+ [mySet addObject:[NSNumber numberWithInt:914]];
+
+ cout<<"The set contains "<<[mySet count]<<" objects."<<endl;
+ if ([mySet containsObject:[NSNumber numberWithInt:911]])
+ cout<<"It's there!"<<endl;
+ else
+ cout<<"It's not there."<<endl;
+
+ [pool release];
+ return 0;
+}