AryaWu/sqlite
0
1# 2011 March 92#3# The author disclaims copyright to this source code. In place of4# a legal notice, here is a blessing:5#6# May you do good and not evil.7# May you find forgiveness for yourself and forgive others.8# May you share freely, never taking more than you give.9#10#***********************************************************************11#12# This file contains tests of the mem5 allocation subsystem.13#14 15set testdir [file dirname $argv0]16source $testdir/tester.tcl17 18ifcapable !mem5 {19 finish_test20 return21}22 23# The tests in this file configure the lookaside allocator after a 24# connection is opened. This will not work if there is any "presql"25# configured (SQL run within the [sqlite3] wrapper in tester.tcl).26if {[info exists ::G(perm:presql)]} {27 finish_test28 return29}30 31do_test mem5-1.1 {32 catch {db close}33 sqlite3_shutdown34 sqlite3_config_heap 25000000 035 sqlite3_config_lookaside 0 036 sqlite3_initialize37} {SQLITE_OK}38 39# try with min request size = 2^3040do_test mem5-1.2 {41 catch {db close}42 sqlite3_shutdown43 sqlite3_config_heap 1 107374182444 sqlite3_config_lookaside 0 045 sqlite3_initialize46} {SQLITE_NOMEM}47 48# try with min request size = 2^30+149# previously this was causing the memsys5Log() func to infinitely loop.50do_test mem5-1.3 {51 catch {db close}52 sqlite3_shutdown53 sqlite3_config_heap 1 107374182554 sqlite3_config_lookaside 0 055 sqlite3_initialize56} {SQLITE_NOMEM}57 58do_test mem5-1.4 {59 catch {db close}60 sqlite3_shutdown61 sqlite3_config_heap 0 062 sqlite3_config_lookaside 0 063 sqlite3_initialize64} {SQLITE_OK}65 66finish_test67 