mirror of
https://github.com/darlinghq/darling.git
synced 2024-11-28 06:40:43 +00:00
Created a test: cfbridge_strequals.m
This commit is contained in:
parent
52fb37ced7
commit
c985a73c6e
25
tests/src/cfbridge_strequals.m
Normal file
25
tests/src/cfbridge_strequals.m
Normal file
@ -0,0 +1,25 @@
|
||||
// CFLAGS: -framework foundation -framework corefoundation
|
||||
|
||||
#import <Foundation/NSString.h>
|
||||
#import <CoreFoundation/CFString.h>
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
|
||||
#define pass(cond) { int ok = (cond); printf("Pass %s: %s\n", #cond, (cond) ? "OK" : "FAIL"); if(!cond) exitcode = 1; }
|
||||
|
||||
int main()
|
||||
{
|
||||
NSString* cfstr = (NSString*) CFSTR("TestString");
|
||||
NSString* nsstr = [NSString stringWithUTF8String:"TestString"];
|
||||
int exitcode = 0;
|
||||
|
||||
pass([nsstr isEqual:cfstr]);
|
||||
pass([nsstr isEqualToString:cfstr]);
|
||||
pass([cfstr isEqual:nsstr]);
|
||||
pass([cfstr isEqualToString:nsstr]);
|
||||
pass([nsstr hash] == [cfstr hash]);
|
||||
|
||||
return exitcode;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user