Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(142)

Unified Diff: third_party/sqlite/src/test/date.test

Issue 6990047: Import SQLite 3.7.6.3. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/sqlite/src/test/ctime.test ('k') | third_party/sqlite/src/test/dbstatus.test » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/sqlite/src/test/date.test
diff --git a/third_party/sqlite/src/test/date.test b/third_party/sqlite/src/test/date.test
index df522c24633eb372c6808b850129a473a79f3651..9bfec12626b955bcc241dd03d76071e4eae4984a 100644
--- a/third_party/sqlite/src/test/date.test
+++ b/third_party/sqlite/src/test/date.test
@@ -16,6 +16,11 @@
set testdir [file dirname $argv0]
source $testdir/tester.tcl
+# Do not use a codec for tests in this file, as the database file is
+# manipulated directly using tcl scripts (using the [hexio_write] command).
+#
+do_not_use_codec
+
# Skip this whole file if date and time functions are omitted
# at compile-time
#
@@ -79,7 +84,7 @@ for {set i 0} {$i<1000} {incr i} {
datetest 2.3 {date('2003-10-22','weekday 0')} 2003-10-26
datetest 2.4 {date('2003-10-22','weekday 1')} 2003-10-27
datetest 2.4a {date('2003-10-22','weekday 1')} 2003-10-27
-datetest 2.4b {date('2003-10-22','weekday 1x')} 2003-10-27
+datetest 2.4b {date('2003-10-22','weekday 1x')} NULL
datetest 2.4c {date('2003-10-22','weekday -1')} NULL
datetest 2.4d {date('2003-10-22','weakday 1x')} NULL
datetest 2.4e {date('2003-10-22','weekday ')} NULL
@@ -495,30 +500,32 @@ datetest 13.34 {date('2001-01-01','-1.5 years')} {1999-07-02}
# Put a floating point number in the database so that we can manipulate
# raw bits using the hexio interface.
#
-do_test date-14.1 {
- execsql {
- PRAGMA auto_vacuum=OFF;
- PRAGMA page_size = 1024;
- CREATE TABLE t1(x);
- INSERT INTO t1 VALUES(1.1);
+if {0==[sqlite3 -has-codec]} {
+ do_test date-14.1 {
+ execsql {
+ PRAGMA auto_vacuum=OFF;
+ PRAGMA page_size = 1024;
+ CREATE TABLE t1(x);
+ INSERT INTO t1 VALUES(1.1);
+ }
+ db close
+ hexio_write test.db 2040 4142ba32bffffff9
+ sqlite3 db test.db
+ db eval {SELECT * FROM t1}
+ } {2454629.5}
+
+ # Changing the least significant byte of the floating point value between
+ # 00 and FF should always generate a time of either 23:59:59 or 00:00:00,
+ # never 24:00:00
+ #
+ for {set i 0} {$i<=255} {incr i} {
+ db close
+ hexio_write test.db 2047 [format %02x $i]
+ sqlite3 db test.db
+ do_test date-14.2.$i {
+ set date [db one {SELECT datetime(x) FROM t1}]
+ expr {$date eq "2008-06-12 00:00:00" || $date eq "2008-06-11 23:59:59"}
+ } {1}
}
- db close
- hexio_write test.db 2040 4142ba32bffffff9
- sqlite3 db test.db
- db eval {SELECT * FROM t1}
-} {2454629.5}
-
-# Changing the least significant byte of the floating point value between
-# 00 and FF should always generate a time of either 23:59:59 or 00:00:00,
-# never 24:00:00
-#
-for {set i 0} {$i<=255} {incr i} {
- db close
- hexio_write test.db 2047 [format %02x $i]
- sqlite3 db test.db
- do_test date-14.2.$i {
- set date [db one {SELECT datetime(x) FROM t1}]
- expr {$date eq "2008-06-12 00:00:00" || $date eq "2008-06-11 23:59:59"}
- } {1}
}
finish_test
« no previous file with comments | « third_party/sqlite/src/test/ctime.test ('k') | third_party/sqlite/src/test/dbstatus.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698