ios - STAssertEquals: null pointer and NULL gives type mismatch error -


what wrong, here doing?

ptr == null true,

this ok,

stasserttrue(ptr == null, @"ptr null"); //succeeded

but,

stassertequals(ptr, null, @""); 

is giving error, "type mismatch --- ".

- (void) testnilencoding {     nsstring * nils = nil;     const char * ptr = [nils datausingencoding:nsutf8stringencoding].bytes;     const char * ptr2 = [nils cstringusingencoding:nsutf8stringencoding];      if (ptr == null) {         nslog(@"ptr null"); // ok     }     stasserttrue(ptr == null, @"ptr null"); //ok     stassertequals(ptr, null, @""); //fails     stassertequals(ptr2, null, @""); //fails } 


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -