diff options
author | Yves Starreveld <ystarrev@uwo.ca> | 2002-11-27 00:01:51 (GMT) |
---|---|---|
committer | Yves Starreveld <ystarrev@uwo.ca> | 2002-11-27 00:01:51 (GMT) |
commit | ad01416a1115ef58a30278d14c49b14bd5f69d95 (patch) | |
tree | a80b86c7bfc30896b9f832af65a585cb7821a6ad /Tests/ObjC++ | |
parent | cab011b7eca8a04deae25aaa4270ab5a027541ab (diff) | |
download | CMake-ad01416a1115ef58a30278d14c49b14bd5f69d95.zip CMake-ad01416a1115ef58a30278d14c49b14bd5f69d95.tar.gz CMake-ad01416a1115ef58a30278d14c49b14bd5f69d95.tar.bz2 |
Test for ObjC++ on OSX machines only
Diffstat (limited to 'Tests/ObjC++')
-rw-r--r-- | Tests/ObjC++/CMakeLists.txt | 5 | ||||
-rw-r--r-- | Tests/ObjC++/objc++.mm | 22 |
2 files changed, 27 insertions, 0 deletions
diff --git a/Tests/ObjC++/CMakeLists.txt b/Tests/ObjC++/CMakeLists.txt new file mode 100644 index 0000000..d79fc00 --- /dev/null +++ b/Tests/ObjC++/CMakeLists.txt @@ -0,0 +1,5 @@ +# a simple objc++ test case that uses Cocoa framework +PROJECT (objc++) + +ADD_EXECUTABLE (objc++ objc++.mm) + 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; +} |