Changeset 1310

Show
Ignore:
Timestamp:
06/12/09 22:19:40 (9 months ago)
Author:
tsnorri
Message:

Fixed a bug which caused a warning to be printed when NSNull was passed as a query parameter
- Added a separate implementation for getting a NULL parameter for NSNull values.
- Wrote a test for it.
- References #204.

Location:
trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/Sources/PGTSFoundationObjects.m

    r1309 r1310  
    507507} 
    508508@end 
     509 
     510 
     511@implementation NSNull (PGTSFoundationObjects) 
     512- (const char *) PGTSParameterLength: (int *) length connection: (PGTSConnection *) connection 
     513{ 
     514        if (length) 
     515                *length = 0; 
     516        return NULL; 
     517} 
     518@end 
  • trunk/UnitTests/Sources/PGTSParameterTests.m

    r1258 r1310  
    176176} 
    177177 
     178- (void) test8Null 
     179{ 
     180        NSNull* value = [NSNull null]; 
     181         
     182        int length = 0; 
     183        id objectValue = [value PGTSParameter: mConnection]; 
     184        const char* paramValue = [objectValue PGTSParameterLength: &length connection: mConnection]; 
     185         
     186        CFRetain (objectValue); 
     187        MKCAssertTrue (NULL == paramValue); 
     188        CFRelease (objectValue); 
     189} 
     190 
    178191- (void) testTimestamp 
    179192{