SQLite

Check-in [c917961743]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix two problems in test instrumentation that show up on some fulltests. (CVS 6151)
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: c917961743e9ab60a096801c8910c6cd8367ee2f
User & Date: drh 2009-01-09 14:29:35.000
Context
2009-01-09
17:11
Increase pager.c coverage a bit. Fix an assert failure that can occur following a "PRAGMA omit_readlock" command on a read-only database. (CVS 6152) (check-in: 0f3f9011fa user: danielk1977 tags: trunk)
14:29
Fix two problems in test instrumentation that show up on some fulltests. (CVS 6151) (check-in: c917961743 user: drh tags: trunk)
14:11
Simplifications to btree.c to improve test coverage. (CVS 6150) (check-in: ac84f106d5 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to test/memdb.test.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# 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 implements regression tests for SQLite library.  The
# focus of this script is in-memory database backend.
#
# $Id: memdb.test,v 1.16 2009/01/07 15:18:21 danielk1977 Exp $


set testdir [file dirname $argv0]
source $testdir/tester.tcl

ifcapable memorydb {














|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# 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 implements regression tests for SQLite library.  The
# focus of this script is in-memory database backend.
#
# $Id: memdb.test,v 1.17 2009/01/09 14:29:35 drh Exp $


set testdir [file dirname $argv0]
source $testdir/tester.tcl

ifcapable memorydb {

421
422
423
424
425
426
427

428
429
430
431
432
433
434
435
436
    PRAGMA auto_vacuum = full;
    CREATE TABLE t1(a);
    INSERT INTO t1 VALUES(randstr(1000,1000));
    INSERT INTO t1 VALUES(randstr(1000,1000));
    INSERT INTO t1 VALUES(randstr(1000,1000));
  }
  set memused [lindex [sqlite3_status SQLITE_STATUS_MEMORY_USED 0] 1]

  execsql { DELETE FROM t1 }
  set memused2 [lindex [sqlite3_status SQLITE_STATUS_MEMORY_USED 0] 1]
  expr {$memused2 + 2048 < $memused}
} {1}


} ;# ifcapable memorydb

finish_test







>


|






421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
    PRAGMA auto_vacuum = full;
    CREATE TABLE t1(a);
    INSERT INTO t1 VALUES(randstr(1000,1000));
    INSERT INTO t1 VALUES(randstr(1000,1000));
    INSERT INTO t1 VALUES(randstr(1000,1000));
  }
  set memused [lindex [sqlite3_status SQLITE_STATUS_MEMORY_USED 0] 1]
  set pgovfl [lindex [sqlite3_status SQLITE_STATUS_PAGECACHE_OVERFLOW 0] 1]
  execsql { DELETE FROM t1 }
  set memused2 [lindex [sqlite3_status SQLITE_STATUS_MEMORY_USED 0] 1]
  expr {($memused2 + 2048 < $memused) || $pgovfl==0}
} {1}


} ;# ifcapable memorydb

finish_test
Changes to test/mutex1.test.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

27
28
29
30
31
32
33
# 2008 June 17
#
# 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.
#
#***********************************************************************
#
# $Id: mutex1.test,v 1.16 2008/11/04 14:55:47 danielk1977 Exp $

set testdir [file dirname $argv0]
source $testdir/tester.tcl

ifcapable !mutex {
  finish_test
  return
}
if {[info exists tester_do_binarylog]} {
  finish_test
  return
}

sqlite3_reset_auto_extension


proc mutex_counters {varname} {
  upvar $varname var
  set var(total) 0
  foreach {name value} [read_mutex_counters] {
    set var($name) $value
    incr var(total) $value











|














>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# 2008 June 17
#
# 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.
#
#***********************************************************************
#
# $Id: mutex1.test,v 1.17 2009/01/09 14:29:35 drh Exp $

set testdir [file dirname $argv0]
source $testdir/tester.tcl

ifcapable !mutex {
  finish_test
  return
}
if {[info exists tester_do_binarylog]} {
  finish_test
  return
}

sqlite3_reset_auto_extension
clear_mutex_counters

proc mutex_counters {varname} {
  upvar $varname var
  set var(total) 0
  foreach {name value} [read_mutex_counters] {
    set var($name) $value
    incr var(total) $value