/ Check-in [d1a87c3b]
Login

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

Overview
Comment:Fix a test case in mutex1.test that was failing when sqlite was compiled with SQLITE_THREADSAFE=0. (CVS 5235)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: d1a87c3bcc9a32918f1cf743f85cd1a71557220e
User & Date: danielk1977 2008-06-18 17:59:04
Context
2008-06-18
18:08
Add a call to sqlite3_initialize() to sqlite3_mutex_alloc() (CVS 5236) check-in: 8b23b719 user: danielk1977 tags: trunk
17:59
Fix a test case in mutex1.test that was failing when sqlite was compiled with SQLITE_THREADSAFE=0. (CVS 5235) check-in: d1a87c3b user: danielk1977 tags: trunk
17:09
Implement the 'CONFIG_SINGLETHREAD' and 'CONFIG_MULTITHREAD' configuration modes. (CVS 5234) check-in: 5059644c user: danielk1977 tags: trunk
Changes
Hide Diffs Unified Diffs Show Whitespace Changes Patch

Changes to test/mutex1.test.

5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
..
80
81
82
83
84
85
86

87
88
89
90
91
92
93
...
112
113
114
115
116
117
118
119

120
121
122
123
124

125
126
127
128
#
#    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.2 2008/06/18 17:09:10 danielk1977 Exp $

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

proc mutex_counters {varname} {
  upvar $varname var
  set var(total) 0
................................................................................
# can be selected using sqlite3_config:
#
#   * Serialized mode,
#   * Multi-threaded mode,
#   * Single-threaded mode.
#


foreach {mode mutexes} {
  singlethread {}
  multithread  {fast static_master static_mem static_prng}
  serialized   {fast recursive static_master static_mem static_prng}
} {
  do_test mutex1.2.$mode.1 {
    catch {db close}
................................................................................
      if {$key ne "total" && $value > 0} {
        lappend res $key
      }
    }
    lsort $res
  } $mutexes
}


do_test mutex1-X {
  db close
  sqlite3_shutdown
  clear_mutex_counters
  install_mutex_counters 0

} {SQLITE_OK}

finish_test








|







 







>







 







|
>

|



>




5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
..
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
...
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#
#    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.3 2008/06/18 17:59:04 danielk1977 Exp $

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

proc mutex_counters {varname} {
  upvar $varname var
  set var(total) 0
................................................................................
# can be selected using sqlite3_config:
#
#   * Serialized mode,
#   * Multi-threaded mode,
#   * Single-threaded mode.
#

ifcapable threadsafe {
  foreach {mode mutexes} {
    singlethread {}
    multithread  {fast static_master static_mem static_prng}
    serialized   {fast recursive static_master static_mem static_prng}
  } {
    do_test mutex1.2.$mode.1 {
      catch {db close}
................................................................................
        if {$key ne "total" && $value > 0} {
          lappend res $key
        }
      }
      lsort $res
    } $mutexes
  }
}

do_test mutex1-X {
  catch {db close}
  sqlite3_shutdown
  clear_mutex_counters
  install_mutex_counters 0
  sqlite3_initialize
} {SQLITE_OK}

finish_test