blob: 3d2b59995857c9a7f61b6860c381c51b23cdf036 [file] [log] [blame]
danc17d6962011-06-21 12:47:30 +00001# 2011 June 21
2#
3# May you do good and not evil.
4# May you find forgiveness for yourself and forgive others.
5# May you share freely, never taking more than you give.
6#
7#***********************************************************************
8#
9# This file contains tests for SQLite. Specifically, it tests that SQLite
10# does not crash and an error is returned if localhost() fails. This
11# is the problem reported by ticket bd484a090c.
12#
13
14set testdir [file dirname $argv0]
15source $testdir/tester.tcl
16
17set testprefix tkt-bd484a090c
18
19
20do_test 1.1 {
21 lindex [catchsql { SELECT datetime('now', 'localtime') }] 0
22} {0}
23do_test 1.2 {
24 lindex [catchsql { SELECT datetime('now', 'utc') }] 0
25} {0}
26
27sqlite3_test_control SQLITE_TESTCTRL_LOCALTIME_FAULT 1
28
29do_test 2.1 {
dan7c8b3552011-06-21 13:46:11 +000030 catchsql { SELECT datetime('now', 'localtime') }
31} {1 {local time unavailable}}
danc17d6962011-06-21 12:47:30 +000032do_test 2.2 {
dan7c8b3552011-06-21 13:46:11 +000033 catchsql { SELECT datetime('now', 'utc') }
34} {1 {local time unavailable}}
danc17d6962011-06-21 12:47:30 +000035
36sqlite3_test_control SQLITE_TESTCTRL_LOCALTIME_FAULT 0
37
38finish_test