⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 memleak.test

📁 sqlite数据库源码
💻 TEST
字号:
# 2001 September 15## The author disclaims copyright to this source code.  In place of# a legal notice, here is a blessing:##    May you do good and not evil.#    May you find forgiveness for yourself and forgive others.#    May you share freely, never taking more than you give.##***********************************************************************# This file runs all tests.## $Id: memleak.test,v 1.3 2004/02/12 18:46:39 drh Exp $set testdir [file dirname $argv0]source $testdir/tester.tclrename finish_test really_finish_testproc finish_test {} {  catch {db close}  memleak_check}if {[file exists ./sqlite_test_count]} {  set COUNT [exec cat ./sqlite_test_count]} else {  set COUNT 3}# LeakList will hold a list of the number of unfreed mallocs after# each round of the test.  This number should be constant.  If it# grows, it may mean there is a memory leak in the library.#set LeakList {}set EXCLUDE {  all.test  quick.test  malloc.test  misuse.test  memleak.test  btree2.test  trans.test}if {[sqlite -has-codec]} {  lappend EXCLUDE \    attach.test \    attach2.test \    auth.test \    format3.test \    version.test}if {[llength $argv]>0} {  set FILELIST $argv  set argv {}} else {  set FILELIST [lsort -dictionary [glob $testdir/*.test]]}foreach testfile $FILELIST {  set tail [file tail $testfile]  if {[lsearch -exact $EXCLUDE $tail]>=0} continue  set LeakList {}  for {set COUNTER 0} {$COUNTER<$COUNT} {incr COUNTER} {    source $testfile    if {[info exists Leak]} {      lappend LeakList $Leak    }  }  if {$LeakList!=""} {    puts -nonewline memory-leak-test-$tail...    incr ::nTest    foreach x $LeakList {      if {$x!=[lindex $LeakList 0]} {         puts " failed! ($LeakList)"         incr ::nErr         lappend ::failList memory-leak-test-$tail         break       }    }    puts " Ok"  }}really_finish_test# Run the malloc tests and the misuse test after memory leak detection.# Both tests leak memory.##catch {source $testdir/misuse.test}#catch {source $testdir/malloc.test}really_finish_test

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -