| OLD | NEW |
| 1 # 2011 February 19 | 1 # 2011 February 19 |
| 2 # | 2 # |
| 3 # The author disclaims copyright to this source code. In place of | 3 # The author disclaims copyright to this source code. In place of |
| 4 # a legal notice, here is a blessing: | 4 # a legal notice, here is a blessing: |
| 5 # | 5 # |
| 6 # May you do good and not evil. | 6 # May you do good and not evil. |
| 7 # May you find forgiveness for yourself and forgive others. | 7 # May you find forgiveness for yourself and forgive others. |
| 8 # May you share freely, never taking more than you give. | 8 # May you share freely, never taking more than you give. |
| 9 # | 9 # |
| 10 #*********************************************************************** | 10 #*********************************************************************** |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 # Tests oserror-1.* test failures in the open() system call. | 44 # Tests oserror-1.* test failures in the open() system call. |
| 45 # | 45 # |
| 46 | 46 |
| 47 # Test a failure in open() due to too many files. | 47 # Test a failure in open() due to too many files. |
| 48 # | 48 # |
| 49 # The xOpen() method of the unix VFS calls getcwd() as well as open(). | 49 # The xOpen() method of the unix VFS calls getcwd() as well as open(). |
| 50 # Although this does not appear to be documented in the man page, on OSX | 50 # Although this does not appear to be documented in the man page, on OSX |
| 51 # a call to getcwd() may fail if there are no free file descriptors. So | 51 # a call to getcwd() may fail if there are no free file descriptors. So |
| 52 # an error may be reported for either open() or getcwd() here. | 52 # an error may be reported for either open() or getcwd() here. |
| 53 # | 53 # |
| 54 puts "Possible valgrind error about invalid file descriptor follows:" |
| 54 do_test 1.1.1 { | 55 do_test 1.1.1 { |
| 55 set ::log [list] | 56 set ::log [list] |
| 56 list [catch { | 57 list [catch { |
| 57 for {set i 0} {$i < 2000} {incr i} { sqlite3 dbh_$i test.db -readonly 1 } | 58 for {set i 0} {$i < 2000} {incr i} { sqlite3 dbh_$i test.db -readonly 1 } |
| 58 } msg] $msg | 59 } msg] $msg |
| 59 } {1 {unable to open database file}} | 60 } {1 {unable to open database file}} |
| 60 do_test 1.1.2 { | 61 do_test 1.1.2 { |
| 61 catch { for {set i 0} {$i < 2000} {incr i} { dbh_$i close } } | 62 catch { for {set i 0} {$i < 2000} {incr i} { dbh_$i close } } |
| 62 } {1} | 63 } {1} |
| 63 do_re_test 1.1.3 { | 64 do_re_test 1.1.3 { |
| (...skipping 25 matching lines...) Expand all Loading... |
| 89 do_test 1.4.1 { | 90 do_test 1.4.1 { |
| 90 set ::log [list] | 91 set ::log [list] |
| 91 list [catch { sqlite3 dbh /root/test.db } msg] $msg | 92 list [catch { sqlite3 dbh /root/test.db } msg] $msg |
| 92 } {1 {unable to open database file}} | 93 } {1 {unable to open database file}} |
| 93 | 94 |
| 94 do_re_test 1.4.2 { lindex $::log 0 } {^os_unix.c:\d*: \(\d+\) open\(.*test.db\)
- } | 95 do_re_test 1.4.2 { lindex $::log 0 } {^os_unix.c:\d*: \(\d+\) open\(.*test.db\)
- } |
| 95 | 96 |
| 96 #-------------------------------------------------------------------------- | 97 #-------------------------------------------------------------------------- |
| 97 # Tests oserror-1.* test failures in the unlink() system call. | 98 # Tests oserror-1.* test failures in the unlink() system call. |
| 98 # | 99 # |
| 99 do_test 2.1.1 { | 100 ifcapable wal { |
| 100 set ::log [list] | 101 do_test 2.1.1 { |
| 101 file mkdir test.db-wal | 102 set ::log [list] |
| 102 forcedelete test.db | 103 file mkdir test.db-wal |
| 103 list [catch { | 104 forcedelete test.db |
| 104 sqlite3 dbh test.db | 105 list [catch { |
| 105 execsql { SELECT * FROM sqlite_master } dbh | 106 sqlite3 dbh test.db |
| 106 } msg] $msg | 107 execsql { SELECT * FROM sqlite_master } dbh |
| 107 } {1 {disk I/O error}} | 108 } msg] $msg |
| 108 | 109 } {1 {disk I/O error}} |
| 109 do_re_test 2.1.2 { | 110 |
| 110 lindex $::log 0 | 111 do_re_test 2.1.2 { |
| 111 } {^os_unix.c:\d+: \(\d+\) unlink\(.*test.db-wal\) - } | 112 lindex $::log 0 |
| 112 do_test 2.1.3 { | 113 } {^os_unix.c:\d+: \(\d+\) unlink\(.*test.db-wal\) - } |
| 113 catch { dbh close } | 114 do_test 2.1.3 { |
| 114 forcedelete test.db-wal | 115 catch { dbh close } |
| 115 } {} | 116 forcedelete test.db-wal |
| 117 } {} |
| 118 } |
| 116 | 119 |
| 117 | 120 |
| 118 test_syscall reset | 121 test_syscall reset |
| 119 sqlite3_shutdown | 122 sqlite3_shutdown |
| 120 test_sqlite3_log | 123 test_sqlite3_log |
| 121 sqlite3_initialize | 124 sqlite3_initialize |
| 122 finish_test | 125 finish_test |
| OLD | NEW |