aboutsummaryrefslogtreecommitdiffstats
path: root/Frameworks/PostgresKit/Tests
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2013-01-31 21:46:09 +0000
committerstuconnolly <stuart02@gmail.com>2013-01-31 21:46:09 +0000
commita7e4480129a50db452eab212a9f82ee1ac93191c (patch)
tree981ad09ed83d9bf909c705806f853c243d0eba9b /Frameworks/PostgresKit/Tests
parentba5a0d6b416971b386896088e227e2ec4110b2a3 (diff)
downloadsequelpro-a7e4480129a50db452eab212a9f82ee1ac93191c.tar.gz
sequelpro-a7e4480129a50db452eab212a9f82ee1ac93191c.tar.bz2
sequelpro-a7e4480129a50db452eab212a9f82ee1ac93191c.zip
PostgresKit: Enable additional data type integration tests.
Diffstat (limited to 'Frameworks/PostgresKit/Tests')
-rw-r--r--Frameworks/PostgresKit/Tests/PGDataTypeTests.m21
1 files changed, 15 insertions, 6 deletions
diff --git a/Frameworks/PostgresKit/Tests/PGDataTypeTests.m b/Frameworks/PostgresKit/Tests/PGDataTypeTests.m
index 4c96a97c..765404a3 100644
--- a/Frameworks/PostgresKit/Tests/PGDataTypeTests.m
+++ b/Frameworks/PostgresKit/Tests/PGDataTypeTests.m
@@ -30,6 +30,8 @@
#import "PGDataTypeTests.h"
+#import <PostgresKit/PostgresKit.h>
+
static NSString *PGTestDatabaseHost = @"localhost";
static NSString *PGTestDatabaseUser = @"pgkit_test";
static NSString *PGTestDatabaseName = @"pgkit_test";
@@ -72,11 +74,18 @@ static NSUInteger PGTestDatabasePort = 5432;
[self _addTestForField:@"numeric" withExpectedResult:[NSNumber numberWithDouble:12345.678] connection:connection toTestSuite:testSuite];
[self _addTestForField:@"char" withExpectedResult:@"CHAR" connection:connection toTestSuite:testSuite];
[self _addTestForField:@"varchar" withExpectedResult:@"VARCHAR" connection:connection toTestSuite:testSuite];
- //[self _addTestForField:@"date" withExpectedResult: connection:connection toTestSuite:testSuite];
- //[self _addTestForField:@"time" withExpectedResult: connection:connection toTestSuite:testSuite];
- //[self _addTestForField:@"timetz" withExpectedResult: connection:connection toTestSuite:testSuite];
- //[self _addTestForField:@"timestamp" withExpectedResult: connection:connection toTestSuite:testSuite];
- //[self _addTestForField:@"timestamptz" withExpectedResult: connection:connection toTestSuite:testSuite];
+ [self _addTestForField:@"date" withExpectedResult:[NSDate dateWithTimeIntervalSince1970:544834800] connection:connection toTestSuite:testSuite];
+ [self _addTestForField:@"time" withExpectedResult:[NSDate dateWithTimeIntervalSince1970:946692122] connection:connection toTestSuite:testSuite];
+ [self _addTestForField:@"timestamp" withExpectedResult:[NSDate dateWithTimeIntervalSince1970:544845722] connection:connection toTestSuite:testSuite];
+
+ PGPostgresTimeTZ *timeTz = [PGPostgresTimeTZ timeWithDate:[NSDate dateWithTimeIntervalSince1970:946692122] timeZoneGMTOffset:36000];
+ PGPostgresTimeTZ *timestampTz = [PGPostgresTimeTZ timeWithDate:[NSDate dateWithTimeIntervalSince1970:544845722] timeZoneGMTOffset:3600];
+
+ [timeTz setHasDate:YES];
+ [timestampTz setHasDate:YES];
+
+ [self _addTestForField:@"timetz" withExpectedResult:timeTz connection:connection toTestSuite:testSuite];
+ [self _addTestForField:@"timestamptz" withExpectedResult:timestampTz connection:connection toTestSuite:testSuite];
[connection release];
@@ -112,7 +121,7 @@ static NSUInteger PGTestDatabasePort = 5432;
#pragma mark -
#pragma mark Tests
-- (void)testResultValueIsNotNull
+- (void)testResultValueIsNotNil
{
STAssertNotNil(_result, nil);
}