Author: rfm
Date: Wed Jun 17 16:26:25 2015
New Revision: 38653
URL: http://svn.gna.org/viewcvs/gnustep?rev=38653&view=rev
Log:
add another test
Modified:
libs/sqlclient/trunk/testPostgres.m
Modified: libs/sqlclient/trunk/testPostgres.m
URL:
http://svn.gna.org/viewcvs/gnustep/libs/sqlclient/trunk/testPostgres.m?rev=38653&r1=38652&r2=38653&view=diff
==============================================================================
--- libs/sqlclient/trunk/testPostgres.m (original)
+++ libs/sqlclient/trunk/testPostgres.m Wed Jun 17 16:26:25 2015
@@ -254,8 +254,10 @@
NSString *oddChars;
NSString *nonLatin;
id e1, e2, e3, e4, e5;
+ id d;
id d0;
id d1;
+ id d2;
id r0;
id r1;
@@ -450,14 +452,18 @@
NSLog(@"Records - %@", [GSCache class]);
+ d = [NSCalendarDate date];
+ [d setTimeZone: [NSTimeZone timeZoneForSecondsFromGMT: 240]];
[db begin];
[db execute: @"create table xxx ( "
@"id int, "
+ @"when0 timestamp with time zone, "
@"when1 timestamp with time zone, "
@"when2 timestamp)",
nil];
- [db execute: @"insert into xxx (id, when1, when2) "
+ [db execute: @"insert into xxx (id, when0, when1, when2) "
@"values (99,",
+ d, @", ",
[NSDate distantPast], @", ",
[NSDate distantFuture], @")",
nil];
@@ -465,13 +471,17 @@
[db execute: @"drop table xxx", nil];
[db commit];
- d0 = [r0 objectForKey:@"when1"];
- d1 = [r0 objectForKey:@"when2"];
- NSCAssert([d0 timeIntervalSinceReferenceDate]
- == [[NSDate distantPast]timeIntervalSinceReferenceDate],
+ d0 = [r0 objectForKey:@"when0"];
+ NSCAssert(floor([d0 timeIntervalSinceReferenceDate])
+ == floor([d timeIntervalSinceReferenceDate]),
NSInternalInconsistencyException);
+ d1 = [r0 objectForKey:@"when1"];
NSCAssert([d1 timeIntervalSinceReferenceDate]
- == [[NSDate distantFuture]timeIntervalSinceReferenceDate],
+ == [[NSDate distantPast] timeIntervalSinceReferenceDate],
+ NSInternalInconsistencyException);
+ d2 = [r0 objectForKey:@"when2"];
+ NSCAssert([d2 timeIntervalSinceReferenceDate]
+ == [[NSDate distantFuture] timeIntervalSinceReferenceDate],
NSInternalInconsistencyException);
}
_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs