/ Check-in [23ffa4f9]
Login

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

Overview
Comment:Further fixes for test scripts.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | two-mappings
Files: files | file ages | folders
SHA1:23ffa4f9fbad2e39cbe4776c7fdb61f757b6fc78
User & Date: dan 2013-03-29 19:38:52
Context
2013-04-01
14:20
Minor changes to unixMapfile() function. Leaf check-in: 80c63443 user: dan tags: two-mappings
2013-03-29
19:38
Further fixes for test scripts. check-in: 23ffa4f9 user: dan tags: two-mappings
18:52
Fix a problem in btree.c that could cause a crash following an OOM. Also various test script problems. check-in: e8bcdf93 user: dan tags: two-mappings
Changes
Hide Diffs Side-by-Side Diffs Show Whitespace Changes Patch

Changes to test/corruptC.test.

   266    266     forcecopy test.bu test.db
   267    267   
   268    268     sqlite3 db test.db
   269    269     set blob [string repeat abcdefghij 10000]
   270    270     execsql { INSERT INTO t1 VALUES (1, $blob) }
   271    271   
   272    272     sqlite3 db test.db
   273         -  set filesize [file size test.db]
          273  +  set filesize [expr [file_page_count test.db] * [file_page_size test.db]]
   274    274     hexio_write test.db [expr $filesize-2048] 00000001
   275    275     catchsql {DELETE FROM t1 WHERE rowid = (SELECT max(rowid) FROM t1)}
   276    276   } {1 {database disk image is malformed}}
   277    277   
   278    278   # At one point this particular corrupt database was causing a buffer
   279    279   # overread. Which caused a crash in a run of all.test once.
   280    280   #

Changes to test/crash.test.

   326    326       INSERT INTO abc VALUES(randstr(1500,1500), 0, 0);   -- Overflow page 4
   327    327       INSERT INTO abc SELECT * FROM abc;
   328    328       INSERT INTO abc SELECT * FROM abc;
   329    329       INSERT INTO abc SELECT * FROM abc;
   330    330     }
   331    331   } {}
   332    332   do_test crash-5.2 {
   333         -  expr [file size test.db] / 1024
          333  +  file_page_count test.db
   334    334   } [expr [string match [execsql {pragma auto_vacuum}] 1] ? 11 : 10]
   335    335   set sig [signature]
   336    336   do_test crash-5.3 {
   337    337   # The SQL below is used to expose a bug that existed in
   338    338   # sqlite3pager_movepage() during development of the auto-vacuum feature. It
   339    339   # functions as follows:
   340    340   # 

Changes to test/permutations.test.

   164    164   ]
   165    165   
   166    166   test_suite "full" -prefix "" -description {
   167    167     Full test suite. Takes a long time.
   168    168   } -files [ 
   169    169     test_set $alltests 
   170    170   ] -initialize {
   171         -  unset -nocomplain ::G(isquick)
          171  +  # unset -nocomplain ::G(isquick)
   172    172   }
   173    173   
   174    174   test_suite "threads" -prefix "" -description {
   175    175     All multi-threaded tests.
   176    176   } -files {
   177    177     notify2.test   thread001.test thread002.test thread003.test 
   178    178     thread004.test thread005.test walthread.test

Changes to test/sqllimits1.test.

   530    530       INSERT INTO abc SELECT a||b||c, b||c||a, c||a||b FROM abc;
   531    531       INSERT INTO abc SELECT a||b||c, b||c||a, c||a||b FROM abc;
   532    532       INSERT INTO abc SELECT a||b||c, b||c||a, c||a||b FROM abc;
   533    533       INSERT INTO abc SELECT a, b, c FROM abc;
   534    534       INSERT INTO abc SELECT b, a, c FROM abc;
   535    535       INSERT INTO abc SELECT c, b, a FROM abc;
   536    536     }
   537         -  expr [file size test.db] / 1024
          537  +  file_page_count test.db
   538    538   } $fsize
   539    539   do_test sqllimits1-7.7.2 {
   540    540     db close
   541    541     sqlite3 db test.db
   542    542     execsql {
   543    543       PRAGMA max_page_count = 1000;
   544    544     }
................................................................................
   546    546       SELECT count(*) FROM sqlite_master;
   547    547     }
   548    548   } {6}
   549    549   do_test sqllimits1-7.7.3 {
   550    550     execsql {
   551    551       PRAGMA max_page_count;
   552    552     }
   553         -} $fsize
          553  +} [expr [file size test.db] / 1024]
   554    554   do_test sqllimits1-7.7.4 {
   555    555     execsql {
   556    556       DROP TABLE abc;
   557    557     }
   558    558   } {}
   559    559   
   560    560   #--------------------------------------------------------------------

Changes to test/vacuum3.test.

    38     38       INSERT INTO t1 VALUES(1, 2, 3);
    39     39     }
    40     40   } {}
    41     41   do_test vacuum3-1.2 {
    42     42     execsql { PRAGMA page_size }
    43     43   } {1024}
    44     44   do_test vacuum3-1.3 {
    45         -  file size test.db
    46         -} {2048}
           45  +  file_page_count test.db
           46  +} {2}
    47     47   
    48     48   set I 4
    49     49   foreach {request actual database} [list \
    50     50     2048 2048 4096                        \
    51     51     1024 1024 2048                        \
    52     52     1170 1024 2048                        \
    53     53     256  1024 2048                        \
................................................................................
    59     59       execsql " 
    60     60         PRAGMA page_size = $request;
    61     61         VACUUM;
    62     62       "
    63     63       execsql { PRAGMA page_size }
    64     64     } $actual
    65     65     do_test vacuum3-1.$I.2 {
    66         -    file size test.db
           66  +    set nPg [file_page_count test.db]
           67  +    expr {$nPg * $actual}
    67     68     } $database
    68     69     do_test vacuum3-1.$I.3 {
    69     70       execsql { SELECT * FROM t1 }
    70     71     } {1 2 3}
    71     72     integrity_check vacuum3-1.$I.4
    72     73   
    73     74     incr I
................................................................................
    80     81   do_test vacuum3-2.1 {
    81     82     execsql {
    82     83       PRAGMA page_size = 1024;
    83     84       VACUUM;
    84     85       ALTER TABLE t1 ADD COLUMN d;
    85     86       UPDATE t1 SET d = randomblob(1000);
    86     87     }
    87         -  file size test.db
    88         -} {3072}
           88  +  file_page_count test.db
           89  +} {3}
    89     90   do_test vacuum3-2.2 {
    90     91     execsql { PRAGMA page_size }
    91     92   } {1024}
    92     93   do_test vacuum3-2.3 {
    93     94     set blob [db one {select d from t1}]
    94     95     string length $blob
    95     96   } {1000}