diff options
author | Brad King <brad.king@kitware.com> | 2019-11-14 15:31:18 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-11-14 15:57:42 (GMT) |
commit | d2e5e6ff1abec8b3b1579f122b7dcc89a35dbba4 (patch) | |
tree | 53e92d69536044321ac31d5543a6c426546b5aba /Tests/ObjCXX/ObjC++ | |
parent | 786954c4893565d8da27329201fd235e347e051d (diff) | |
download | CMake-d2e5e6ff1abec8b3b1579f122b7dcc89a35dbba4.zip CMake-d2e5e6ff1abec8b3b1579f122b7dcc89a35dbba4.tar.gz CMake-d2e5e6ff1abec8b3b1579f122b7dcc89a35dbba4.tar.bz2 |
Tests: Organize Objective C/C++ test directories
Move them all under `Tests/ObjC` and `Tests/ObjCXX`.
Diffstat (limited to 'Tests/ObjCXX/ObjC++')
-rw-r--r-- | Tests/ObjCXX/ObjC++/CMakeLists.txt | 5 | ||||
-rw-r--r-- | Tests/ObjCXX/ObjC++/objc++.mm | 23 |
2 files changed, 28 insertions, 0 deletions
diff --git a/Tests/ObjCXX/ObjC++/CMakeLists.txt b/Tests/ObjCXX/ObjC++/CMakeLists.txt new file mode 100644 index 0000000..5ba5db2 --- /dev/null +++ b/Tests/ObjCXX/ObjC++/CMakeLists.txt @@ -0,0 +1,5 @@ +# a simple objc++ test case that uses Cocoa framework +project (ObjC++) + +add_executable (ObjC++ objc++.mm) +target_link_libraries(ObjC++ "-framework Cocoa") diff --git a/Tests/ObjCXX/ObjC++/objc++.mm b/Tests/ObjCXX/ObjC++/objc++.mm new file mode 100644 index 0000000..258ebaa --- /dev/null +++ b/Tests/ObjCXX/ObjC++/objc++.mm @@ -0,0 +1,23 @@ +#import <Cocoa/Cocoa.h> +#import <iostream> +using namespace std; + +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; +} |