1
0

tkt-bd484a090c.test 1011 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. # 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. set testdir [file dirname $argv0]
  14. source $testdir/tester.tcl
  15. set testprefix tkt-bd484a090c
  16. do_test 1.1 {
  17. lindex [catchsql { SELECT datetime('now', 'localtime') }] 0
  18. } {0}
  19. do_test 1.2 {
  20. lindex [catchsql { SELECT datetime('now', 'utc') }] 0
  21. } {0}
  22. sqlite3_test_control SQLITE_TESTCTRL_LOCALTIME_FAULT 1
  23. do_test 2.1 {
  24. catchsql { SELECT datetime('now', 'localtime') }
  25. } {1 {local time unavailable}}
  26. do_test 2.2 {
  27. catchsql { SELECT datetime('now', 'utc') }
  28. } {1 {local time unavailable}}
  29. sqlite3_test_control SQLITE_TESTCTRL_LOCALTIME_FAULT 0
  30. finish_test