/ Check-in [03e3cfc4]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

Overview
Comment:Fix the test script --binarylog option. (CVS 5401)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 03e3cfc4ccab3c6441d41ade175dc041b8fa6c98
User & Date: danielk1977 2008-07-12 15:55:55
Context
2008-07-12
20:35
Documentation updates. No changes to code. (CVS 5402) check-in: 8be28aa0 user: drh tags: trunk
15:55
Fix the test script --binarylog option. (CVS 5401) check-in: 03e3cfc4 user: danielk1977 tags: trunk
14:52
Remove leftover debugging commands (breakpoint and btree_breakpoint) from test scripts. (CVS 5400) check-in: dcb16024 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/test_osinst.c.

10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
...
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
**
******************************************************************************
**
** This file contains the implementation of an SQLite vfs wrapper that
** adds instrumentation to all vfs and file methods. C and Tcl interfaces
** are provided to control the instrumentation.
**
** $Id: test_osinst.c,v 1.16 2008/06/12 12:40:14 drh Exp $
*/

/*
** C interface:
**
**   sqlite3_instvfs_create()
**   sqlite3_instvfs_destroy()
................................................................................
  InstVfsBinaryLog *pLog;
  InstVfs *pInstVfs = (InstVfs *)pVfs;

  if( pVfs->xOpen!=instOpen || pInstVfs->xCall!=binarylog_xcall ){
    return;
  }
  pLog = (InstVfsBinaryLog *)pInstVfs->pClient;
  if( !isBinary || pLog->log_data ){
    unsigned char *zRec;
    int nWrite;

    if( nBlob<0 ){
      nBlob = strlen(zBlob);
    }
    nWrite = nBlob + 28;







|







 







|







10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
...
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
**
******************************************************************************
**
** This file contains the implementation of an SQLite vfs wrapper that
** adds instrumentation to all vfs and file methods. C and Tcl interfaces
** are provided to control the instrumentation.
**
** $Id: test_osinst.c,v 1.17 2008/07/12 15:55:55 danielk1977 Exp $
*/

/*
** C interface:
**
**   sqlite3_instvfs_create()
**   sqlite3_instvfs_destroy()
................................................................................
  InstVfsBinaryLog *pLog;
  InstVfs *pInstVfs = (InstVfs *)pVfs;

  if( pVfs->xOpen!=instOpen || pInstVfs->xCall!=binarylog_xcall ){
    return;
  }
  pLog = (InstVfsBinaryLog *)pInstVfs->pClient;
  if( zBlob && (!isBinary || pLog->log_data) ){
    unsigned char *zRec;
    int nWrite;

    if( nBlob<0 ){
      nBlob = strlen(zBlob);
    }
    nWrite = nBlob + 28;

Changes to test/capi3.test.

7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
....
1182
1183
1184
1185
1186
1187
1188

1189
1190
1191
1192
1193
1194
1195

1196
#    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 testing the callback-free C/C++ API.
#
# $Id: capi3.test,v 1.66 2008/07/07 13:32:00 drh Exp $
#

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

# Return the UTF-16 representation of the supplied UTF-8 string $str.
# If $nt is true, append two 0x00 bytes as a nul terminator.
................................................................................
#
do_test capi3-19.1 {
  sqlite3_prepare_tkt3134 db
} {}

# Tests of the interface when no VFS is registered.
#

db close
vfs_unregister_all
do_test capi3-20.1 {
  sqlite3_sleep 100
} {0}
vfs_reregister_all


finish_test







|







 







>
|
|
|
|
|
|
|
>

7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
....
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
#    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 testing the callback-free C/C++ API.
#
# $Id: capi3.test,v 1.67 2008/07/12 15:55:55 danielk1977 Exp $
#

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

# Return the UTF-16 representation of the supplied UTF-8 string $str.
# If $nt is true, append two 0x00 bytes as a nul terminator.
................................................................................
#
do_test capi3-19.1 {
  sqlite3_prepare_tkt3134 db
} {}

# Tests of the interface when no VFS is registered.
#
if {![info exists tester_do_binarylog]} {
  db close
  vfs_unregister_all
  do_test capi3-20.1 {
    sqlite3_sleep 100
  } {0}
  vfs_reregister_all
}

finish_test

Changes to test/mutex1.test.

5
6
7
8
9
10
11
12
13
14
15






16
17
18
19
20
21
22
#
#    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.8 2008/07/10 17:52:49 danielk1977 Exp $

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






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







|



>
>
>
>
>
>







5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#
#    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.9 2008/07/12 15:55:55 danielk1977 Exp $

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

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

Changes to test/tester.tcl.

7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
..
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
...
133
134
135
136
137
138
139




140
141
142
143
144
145
146
#    May you find forgiveness for yourself and forgive others.
#    May you share freely, never taking more than you give.
#
#***********************************************************************
# This file implements some common TCL routines used for regression
# testing the SQLite library
#
# $Id: tester.tcl,v 1.131 2008/07/11 16:15:18 drh Exp $

#
# What for user input before continuing.  This gives an opportunity
# to connect profiling tools to the process.
#
for {set i 0} {$i<[llength $argv]} {incr i} {
  if {[regexp {^-+pause$} [lindex $argv $i] all value]} {
................................................................................
      sqlite3_instvfs configure ostrace ostrace_call
      sqlite3_instvfs configure ostrace ostrace_call
    }
    set argv [lreplace $argv $i $i]
  }
  if {[lindex $argv $i] eq "--binarylog"} {
    set tester_do_binarylog 1

    # sqlite3_simulate_device -char safe_append
    # sqlite3_instvfs binarylog -default -parent devsym binarylog ostrace.bin
    sqlite3_instvfs binarylog -default binarylog ostrace.bin
    set argv [lreplace $argv $i $i]
    sqlite3_instvfs marker binarylog "$argv0 $argv"
  }
}

# 
# Check the command-line arguments to set the maximum number of
# errors tolerated before halting.
#
................................................................................

# Create a test database
#
if {![info exists nTest]} {
  sqlite3_shutdown 
  install_malloc_faultsim 1 
  sqlite3_initialize




}
catch {db close}
file delete -force test.db
file delete -force test.db-journal
sqlite3 db ./test.db
set ::DB [sqlite3_connection_pointer db]
if {[info exists ::SETUP_SQL]} {







|







 







<
<
<
<

<







 







>
>
>
>







7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
..
90
91
92
93
94
95
96




97

98
99
100
101
102
103
104
...
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
#    May you find forgiveness for yourself and forgive others.
#    May you share freely, never taking more than you give.
#
#***********************************************************************
# This file implements some common TCL routines used for regression
# testing the SQLite library
#
# $Id: tester.tcl,v 1.132 2008/07/12 15:55:55 danielk1977 Exp $

#
# What for user input before continuing.  This gives an opportunity
# to connect profiling tools to the process.
#
for {set i 0} {$i<[llength $argv]} {incr i} {
  if {[regexp {^-+pause$} [lindex $argv $i] all value]} {
................................................................................
      sqlite3_instvfs configure ostrace ostrace_call
      sqlite3_instvfs configure ostrace ostrace_call
    }
    set argv [lreplace $argv $i $i]
  }
  if {[lindex $argv $i] eq "--binarylog"} {
    set tester_do_binarylog 1




    set argv [lreplace $argv $i $i]

  }
}

# 
# Check the command-line arguments to set the maximum number of
# errors tolerated before halting.
#
................................................................................

# Create a test database
#
if {![info exists nTest]} {
  sqlite3_shutdown 
  install_malloc_faultsim 1 
  sqlite3_initialize
  if {[info exists tester_do_binarylog]} {
    sqlite3_instvfs binarylog -default binarylog ostrace.bin
    sqlite3_instvfs marker binarylog "$argv0 $argv"
  }
}
catch {db close}
file delete -force test.db
file delete -force test.db-journal
sqlite3 db ./test.db
set ::DB [sqlite3_connection_pointer db]
if {[info exists ::SETUP_SQL]} {