diff options
author | drh <drh@noemail.net> | 2008-07-07 19:52:09 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2008-07-07 19:52:09 +0000 |
commit | bd0b1b50f4bb78d79c25bb471ec2b8ed35a4debe (patch) | |
tree | fbe22f280a5dff4e40969ea98f73508844d80b99 /test/mallocG.test | |
parent | da8c8f2f8f9b44f18109f985a166e7ee3727f103 (diff) | |
download | sqlite-bd0b1b50f4bb78d79c25bb471ec2b8ed35a4debe.tar.gz sqlite-bd0b1b50f4bb78d79c25bb471ec2b8ed35a4debe.zip |
Make check-in (5356) compatible with builds that do not enable memory
management. Remove unnecessary code from main.c. Add out-of-memory
tests for sqlite3_complete16(). (CVS 5357)
FossilOrigin-Name: 28f8b6bfcc3e169f8a54a6681395f2c85bf99cab
Diffstat (limited to 'test/mallocG.test')
-rw-r--r-- | test/mallocG.test | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/test/mallocG.test b/test/mallocG.test index c2fa79ab6..aa93aced0 100644 --- a/test/mallocG.test +++ b/test/mallocG.test @@ -11,7 +11,7 @@ # # This test script checks malloc failures in various obscure operations. # -# $Id: mallocG.test,v 1.3 2008/02/18 22:24:58 drh Exp $ +# $Id: mallocG.test,v 1.4 2008/07/07 19:52:11 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -53,4 +53,16 @@ do_malloc_test mallocG-3 -sqlprep { AND x BETWEEN 'i' AND 'm' } +proc utf16 {utf8} { + set utf16 [encoding convertto unicode $utf8] + append utf16 "\x00\x00" + return $utf16 +} + +do_malloc_test mallocG-4 -tclbody { + set rc [sqlite3_complete16 [utf16 "SELECT * FROM t1;"]] + if {$rc==1} {set rc 0} {error "out of memory"} + set rc +} + finish_test |