OLD | NEW |
1 # 2009 January 30 | 1 # 2009 January 30 |
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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 # | 61 # |
62 set rc [B step 5000] | 62 set rc [B step 5000] |
63 if {$rc == "SQLITE_NOMEM" || $rc == "SQLITE_IOERR_NOMEM"} { | 63 if {$rc == "SQLITE_NOMEM" || $rc == "SQLITE_IOERR_NOMEM"} { |
64 error "out of memory" | 64 error "out of memory" |
65 } | 65 } |
66 | 66 |
67 # Finalize the backup. | 67 # Finalize the backup. |
68 B finish | 68 B finish |
69 } -cleanup { | 69 } -cleanup { |
70 catch { B finish } | 70 catch { B finish } |
| 71 catch { db2 close } |
71 } | 72 } |
72 | 73 |
73 do_malloc_test backup_malloc-1 -tclprep { | 74 do_malloc_test backup_malloc-2 -tclprep { |
74 sqlite3 db2 test2.db | 75 sqlite3 db2 test2.db |
75 } -tclbody { | 76 } -tclbody { |
76 set rc [catch {sqlite3_backup B db2 temp db main}] | 77 set rc [catch {sqlite3_backup B db2 temp db main}] |
77 set errcode [sqlite3_errcode db2] | 78 set errcode [sqlite3_errcode db2] |
78 if {$rc && ($errcode == "SQLITE_NOMEM" || $errcode == "SQLITE_IOERR_NOMEM")} { | 79 if {$rc && ($errcode == "SQLITE_NOMEM" || $errcode == "SQLITE_IOERR_NOMEM")} { |
79 error "out of memory" | 80 error "out of memory" |
80 } | 81 } |
81 } -cleanup { | 82 } -cleanup { |
82 catch { B finish } | 83 catch { B finish } |
83 db2 close | 84 db2 close |
84 } | 85 } |
85 | 86 |
86 finish_test | 87 finish_test |
OLD | NEW |