/ Check-in [72389c29]
Login

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

Overview
Comment:Enable some more tests on Windows.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 72389c295bb240ec76746e289403b82e04189903
User & Date: mistachkin 2013-10-31 06:13:57
Context
2013-10-31
06:39
Update comments in the MSVC batch build tool. check-in: 0414bb73 user: mistachkin tags: trunk
06:13
Enable some more tests on Windows. check-in: 72389c29 user: mistachkin tags: trunk
06:11
Fix harmless compiler warnings. check-in: 1a0a8865 user: mistachkin tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/test_config.c.

248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
#ifdef SQLITE_OMIT_COMPOUND_SELECT
  Tcl_SetVar2(interp, "sqlite_options", "compound", "0", TCL_GLOBAL_ONLY);
#else
  Tcl_SetVar2(interp, "sqlite_options", "compound", "1", TCL_GLOBAL_ONLY);
#endif

  Tcl_SetVar2(interp, "sqlite_options", "conflict", "1", TCL_GLOBAL_ONLY);

#if SQLITE_OS_UNIX
  Tcl_SetVar2(interp, "sqlite_options", "crashtest", "1", TCL_GLOBAL_ONLY);
#else
  Tcl_SetVar2(interp, "sqlite_options", "crashtest", "0", TCL_GLOBAL_ONLY);
#endif

#ifdef SQLITE_OMIT_DATETIME_FUNCS
  Tcl_SetVar2(interp, "sqlite_options", "datetime", "0", TCL_GLOBAL_ONLY);
#else
  Tcl_SetVar2(interp, "sqlite_options", "datetime", "1", TCL_GLOBAL_ONLY);
#endif








<
<

<
<
<







248
249
250
251
252
253
254


255



256
257
258
259
260
261
262
#ifdef SQLITE_OMIT_COMPOUND_SELECT
  Tcl_SetVar2(interp, "sqlite_options", "compound", "0", TCL_GLOBAL_ONLY);
#else
  Tcl_SetVar2(interp, "sqlite_options", "compound", "1", TCL_GLOBAL_ONLY);
#endif

  Tcl_SetVar2(interp, "sqlite_options", "conflict", "1", TCL_GLOBAL_ONLY);


  Tcl_SetVar2(interp, "sqlite_options", "crashtest", "1", TCL_GLOBAL_ONLY);




#ifdef SQLITE_OMIT_DATETIME_FUNCS
  Tcl_SetVar2(interp, "sqlite_options", "datetime", "0", TCL_GLOBAL_ONLY);
#else
  Tcl_SetVar2(interp, "sqlite_options", "datetime", "1", TCL_GLOBAL_ONLY);
#endif

Changes to test/crash8.test.

337
338
339
340
341
342
343





344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401

402

  do_test crash8-4.10 {
    delete_file $zMasterJournal
    execsql { SELECT b FROM main.ab WHERE a = 0 }
  } {jkl}
}






for {set i 1} {$i < 10} {incr i} {
  catch { db close }
  forcedelete test.db test.db-journal
  sqlite3 db test.db
  do_test crash8-5.$i.1 {
    execsql {
      CREATE TABLE t1(x PRIMARY KEY);
      INSERT INTO t1 VALUES(randomblob(900));
      INSERT INTO t1 SELECT randomblob(900) FROM t1;
      INSERT INTO t1 SELECT randomblob(900) FROM t1;
      INSERT INTO t1 SELECT randomblob(900) FROM t1;
      INSERT INTO t1 SELECT randomblob(900) FROM t1;
      INSERT INTO t1 SELECT randomblob(900) FROM t1;
      INSERT INTO t1 SELECT randomblob(900) FROM t1;          /* 64 rows */
    }
    crashsql -file test.db -delay [expr ($::i%2) + 1] {
      PRAGMA cache_size = 10;
      BEGIN;
        UPDATE t1 SET x = randomblob(900);
      ROLLBACK;
      INSERT INTO t1 VALUES(randomblob(900));
    }
    execsql { PRAGMA integrity_check }
  } {ok}
  
  catch { db close }
  forcedelete test.db test.db-journal
  sqlite3 db test.db
  do_test crash8-5.$i.2 {
    execsql {
      PRAGMA cache_size = 10;
      CREATE TABLE t1(x PRIMARY KEY);
      INSERT INTO t1 VALUES(randomblob(900));
      INSERT INTO t1 SELECT randomblob(900) FROM t1;
      INSERT INTO t1 SELECT randomblob(900) FROM t1;
      INSERT INTO t1 SELECT randomblob(900) FROM t1;
      INSERT INTO t1 SELECT randomblob(900) FROM t1;
      INSERT INTO t1 SELECT randomblob(900) FROM t1;
      INSERT INTO t1 SELECT randomblob(900) FROM t1;          /* 64 rows */
      BEGIN;
        UPDATE t1 SET x = randomblob(900);
    }
    forcedelete testX.db testX.db-journal testX.db-wal
    forcecopy test.db testX.db
    forcecopy test.db-journal testX.db-journal
    db close

    crashsql -file test.db -delay [expr ($::i%2) + 1] {
      SELECT * FROM sqlite_master;
      INSERT INTO t1 VALUES(randomblob(900));
    }

    sqlite3 db2 testX.db
    execsql { PRAGMA integrity_check } db2
  } {ok}
}
catch {db2 close}


finish_test







>
>
>
>
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|

|
|
|
|

|
|
|
|
|
|
>

337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408

  do_test crash8-4.10 {
    delete_file $zMasterJournal
    execsql { SELECT b FROM main.ab WHERE a = 0 }
  } {jkl}
}

#
# Since the following tests (crash8-5.*) rely upon being able
# to copy a file while open, they will not work on Windows.
#
if {$::tcl_platform(platform)=="unix"} {
  for {set i 1} {$i < 10} {incr i} {
    catch { db close }
    forcedelete test.db test.db-journal
    sqlite3 db test.db
    do_test crash8-5.$i.1 {
      execsql {
        CREATE TABLE t1(x PRIMARY KEY);
        INSERT INTO t1 VALUES(randomblob(900));
        INSERT INTO t1 SELECT randomblob(900) FROM t1;
        INSERT INTO t1 SELECT randomblob(900) FROM t1;
        INSERT INTO t1 SELECT randomblob(900) FROM t1;
        INSERT INTO t1 SELECT randomblob(900) FROM t1;
        INSERT INTO t1 SELECT randomblob(900) FROM t1;
        INSERT INTO t1 SELECT randomblob(900) FROM t1;          /* 64 rows */
      }
      crashsql -file test.db -delay [expr ($::i%2) + 1] {
        PRAGMA cache_size = 10;
        BEGIN;
          UPDATE t1 SET x = randomblob(900);
        ROLLBACK;
        INSERT INTO t1 VALUES(randomblob(900));
      }
      execsql { PRAGMA integrity_check }
    } {ok}
  
    catch { db close }
    forcedelete test.db test.db-journal
    sqlite3 db test.db
    do_test crash8-5.$i.2 {
      execsql {
        PRAGMA cache_size = 10;
        CREATE TABLE t1(x PRIMARY KEY);
        INSERT INTO t1 VALUES(randomblob(900));
        INSERT INTO t1 SELECT randomblob(900) FROM t1;
        INSERT INTO t1 SELECT randomblob(900) FROM t1;
        INSERT INTO t1 SELECT randomblob(900) FROM t1;
        INSERT INTO t1 SELECT randomblob(900) FROM t1;
        INSERT INTO t1 SELECT randomblob(900) FROM t1;
        INSERT INTO t1 SELECT randomblob(900) FROM t1;          /* 64 rows */
        BEGIN;
          UPDATE t1 SET x = randomblob(900);
      }
      forcedelete testX.db testX.db-journal testX.db-wal
      forcecopy test.db testX.db
      forcecopy test.db-journal testX.db-journal
      db close

      crashsql -file test.db -delay [expr ($::i%2) + 1] {
        SELECT * FROM sqlite_master;
        INSERT INTO t1 VALUES(randomblob(900));
      }

      sqlite3 db2 testX.db
      execsql { PRAGMA integrity_check } db2
    } {ok}
  }
  catch {db2 close}
}

finish_test