OLD | NEW |
1 # 2007 May 1 | 1 # 2007 May 1 |
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 #*********************************************************************** |
11 # | 11 # |
12 # $Id: incrblob_err.test,v 1.14 2008/07/18 17:16:27 drh Exp $ | 12 # $Id: incrblob_err.test,v 1.14 2008/07/18 17:16:27 drh Exp $ |
13 # | 13 # |
14 | 14 |
15 set testdir [file dirname $argv0] | 15 set testdir [file dirname $argv0] |
16 source $testdir/tester.tcl | 16 source $testdir/tester.tcl |
17 set ::testprefix incrblob_err | 17 set ::testprefix incrblob_err |
18 | 18 |
19 ifcapable {!incrblob || !memdebug || !tclvar} { | 19 ifcapable {!incrblob || !memdebug || !tclvar} { |
20 finish_test | 20 finish_test |
21 return | 21 return |
22 } | 22 } |
23 | 23 |
24 source $testdir/malloc_common.tcl | 24 source $testdir/malloc_common.tcl |
25 | 25 |
26 unset -nocomplain ::fd ::data | 26 unset -nocomplain ::fd ::data |
27 set ::fd [open [info script]] | 27 set ::fd [open $::cmdlinearg(INFO_SCRIPT)] |
28 set ::data [read $::fd] | 28 set ::data [read $::fd] |
29 close $::fd | 29 close $::fd |
30 | 30 |
31 do_malloc_test 1 -tclprep { | 31 do_malloc_test 1 -tclprep { |
32 set bytes [file size [info script]] | 32 set bytes [file size $::cmdlinearg(INFO_SCRIPT)] |
33 execsql { | 33 execsql { |
34 CREATE TABLE blobs(k, v BLOB); | 34 CREATE TABLE blobs(k, v BLOB); |
35 INSERT INTO blobs VALUES(1, zeroblob($::bytes)); | 35 INSERT INTO blobs VALUES(1, zeroblob($::bytes)); |
36 } | 36 } |
37 } -tclbody { | 37 } -tclbody { |
38 set ::blob [db incrblob blobs v 1] | 38 set ::blob [db incrblob blobs v 1] |
39 fconfigure $::blob -translation binary | 39 fconfigure $::blob -translation binary |
40 set rc [catch {puts -nonewline $::blob $::data}] | 40 set rc [catch {puts -nonewline $::blob $::data}] |
41 if {$rc} { error "out of memory" } | 41 if {$rc} { error "out of memory" } |
42 } | 42 } |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 # | 131 # |
132 sqlite3 db2 test.db | 132 sqlite3 db2 test.db |
133 set ::blob [db2 incrblob blobs v 1] | 133 set ::blob [db2 incrblob blobs v 1] |
134 sqlite3_blob_write $::blob [expr 500*1020-20] 12345678900987654321 | 134 sqlite3_blob_write $::blob [expr 500*1020-20] 12345678900987654321 |
135 close $::blob | 135 close $::blob |
136 } | 136 } |
137 | 137 |
138 catch {db2 close} | 138 catch {db2 close} |
139 | 139 |
140 finish_test | 140 finish_test |
OLD | NEW |