mirror of
https://github.com/reactos/CMake.git
synced 2024-11-24 20:19:53 +00:00
Test for ObjC++ on OSX machines only
This commit is contained in:
parent
cab011b7ec
commit
ad01416a11
5
Tests/ObjC++/CMakeLists.txt
Normal file
5
Tests/ObjC++/CMakeLists.txt
Normal file
@ -0,0 +1,5 @@
|
||||
# a simple objc++ test case that uses Cocoa framework
|
||||
PROJECT (objc++)
|
||||
|
||||
ADD_EXECUTABLE (objc++ objc++.mm)
|
||||
|
22
Tests/ObjC++/objc++.mm
Normal file
22
Tests/ObjC++/objc++.mm
Normal file
@ -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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user