mirror of
https://github.com/glebarez/go-sqlite.git
synced 2025-10-07 08:40:55 +08:00
all_test.go - remove the temp db between scripts to prevent not quite closed/deleted/race.
malloc5.test - skip tests requiring memstats collection pager1.test - skip 2 tests in non-functional sets. snapshot_fault.test - skip test w/failing forcedelete testdata/tcl/tester.tcl - fix get_pwd to return output of 'cd'
This commit is contained in:
18
testdata/tcl/malloc5.test
vendored
18
testdata/tcl/malloc5.test
vendored
@@ -219,6 +219,12 @@ puts "Highwater mark: [sqlite3_memory_highwater]"
|
||||
#
|
||||
set ::soft_limit [sqlite3_soft_heap_limit -1]
|
||||
execsql {PRAGMA cache_size=2000}
|
||||
|
||||
# Test requires sqliteconfig.FbMemstat = 1 to measure highwater mark.
|
||||
# We are not built with that enabled, currently
|
||||
# -DSQLITE_DEFAULT_MEMSTATUS=0
|
||||
if {$::tcl_platform(platform)!="windows"} {
|
||||
|
||||
do_test malloc5-4.1 {
|
||||
execsql {BEGIN;}
|
||||
execsql {DELETE FROM abc;}
|
||||
@@ -234,6 +240,7 @@ do_test malloc5-4.1 {
|
||||
puts -nonewline " (Highwater mark: $nMaxBytes) "
|
||||
expr $nMaxBytes > 1000000
|
||||
} {1}
|
||||
|
||||
do_test malloc5-4.2 {
|
||||
db eval {PRAGMA cache_size=1}
|
||||
db cache flush
|
||||
@@ -245,6 +252,7 @@ do_test malloc5-4.2 {
|
||||
puts -nonewline " (Highwater mark: $nMaxBytes) "
|
||||
expr $nMaxBytes <= 210000
|
||||
} {1}
|
||||
|
||||
do_test malloc5-4.3 {
|
||||
# Check that the content of table abc is at least roughly as expected.
|
||||
execsql {
|
||||
@@ -252,6 +260,8 @@ do_test malloc5-4.3 {
|
||||
}
|
||||
} [list 10000 [expr int(10000.0 * 4999.5)] [expr int(10000.0 * 4999.5)]]
|
||||
|
||||
}
|
||||
|
||||
# Restore the soft heap limit.
|
||||
sqlite3_soft_heap_limit $::soft_limit
|
||||
|
||||
@@ -344,6 +354,12 @@ do_test malloc5-6.2.1 {
|
||||
expr [nPage db] + [nPage db2]
|
||||
} {4}
|
||||
|
||||
|
||||
# Our min-useable malloc block-size appears to be 2k (actual)
|
||||
# Because this test attempts to measure actual memory freed
|
||||
# causing 2 blocks to be freed will free 4K, failing the tests
|
||||
if {$::tcl_platform(platform)!="windows"} {
|
||||
|
||||
do_test malloc5-6.2.2 {
|
||||
# If we now try to reclaim some memory, it should come from the db2 cache.
|
||||
sqlite3_release_memory 3000
|
||||
@@ -358,6 +374,8 @@ do_test malloc5-6.2.3 {
|
||||
expr [nPage db] + [nPage db2]
|
||||
} {0}
|
||||
|
||||
}
|
||||
|
||||
do_test malloc5-6.3.1 {
|
||||
# Now open a transaction and update 2 pages in the db2 cache. Then
|
||||
# do a SELECT on the db cache so that all the db pages are more recently
|
||||
|
Reference in New Issue
Block a user