/ Check-in [1166f9c7]
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 malloc-10 test in malloc.test so that it will run on windows when invoked from exclusive3.test. (CVS 4389)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 1166f9c7d1b3cb39a2ab96ed08a0552ba5fe1851
User & Date: drh 2007-09-04 01:25:49
Context
2007-09-04
01:58
More documentation changes prior to the 3.5.0 alpha release. (CVS 4390) check-in: b15b03df user: drh tags: trunk
01:25
Fix the malloc-10 test in malloc.test so that it will run on windows when invoked from exclusive3.test. (CVS 4389) check-in: 1166f9c7 user: drh tags: trunk
2007-09-03
22:15
Fix Makefile.in so that it rebuilds all source files that use SQLITE_TEST when constructing the testfixture. (CVS 4388) check-in: dced71a0 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to test/malloc.test.

12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
...
242
243
244
245
246
247
248
249




250
251
252
253
254
255
256
257
# This file attempts to check the behavior of the SQLite library in 
# an out-of-memory situation. When compiled with -DSQLITE_DEBUG=1, 
# the SQLite library accepts a special command (sqlite3_memdebug_fail N C)
# which causes the N-th malloc to fail.  This special feature is used
# to see what happens in the library if a malloc were to really fail
# due to an out-of-memory situation.
#
# $Id: malloc.test,v 1.46 2007/09/03 11:04:22 danielk1977 Exp $

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

# Only run these tests if memory debugging is turned on.
#
ifcapable !memdebug {
................................................................................
  INSERT INTO abc1 VALUES(1, 2, 3);
  INSERT INTO abc2 VALUES(1, 2, 3);
  COMMIT;
}

# This block tests malloc() failures that occur while opening a 
# connection to a database.
do_malloc_test 10 -sqlprep {




  CREATE TABLE abc(a, b, c);
} -tclbody {
  db close
  sqlite3 db2 test.db
  db2 eval {SELECT * FROM sqlite_master}
  db2 close
} 








|







 







|
>
>
>
>
|







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
...
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
# This file attempts to check the behavior of the SQLite library in 
# an out-of-memory situation. When compiled with -DSQLITE_DEBUG=1, 
# the SQLite library accepts a special command (sqlite3_memdebug_fail N C)
# which causes the N-th malloc to fail.  This special feature is used
# to see what happens in the library if a malloc were to really fail
# due to an out-of-memory situation.
#
# $Id: malloc.test,v 1.47 2007/09/04 01:25:49 drh Exp $

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

# Only run these tests if memory debugging is turned on.
#
ifcapable !memdebug {
................................................................................
  INSERT INTO abc1 VALUES(1, 2, 3);
  INSERT INTO abc2 VALUES(1, 2, 3);
  COMMIT;
}

# This block tests malloc() failures that occur while opening a 
# connection to a database.
do_malloc_test 10 -tclprep {
  catch {db2 close}
  db close
  file delete -force test.db test.db-journal
  sqlite3 db test.db
  db eval {CREATE TABLE abc(a, b, c)}
} -tclbody {
  db close
  sqlite3 db2 test.db
  db2 eval {SELECT * FROM sqlite_master}
  db2 close
}