Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Add tests to pager1.test and pagerfault.test. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
c6e75950928954fbb1590f952e3cdbcb |
User & Date: | dan 2010-07-01 19:01:56.000 |
Context
2010-07-01
| ||
19:45 | If you delete a database file but not its *-wal file, then open the database (thus creating a new empty database file) the *-wal file is automatically deleted. (check-in: 95c69dfbdd user: drh tags: trunk) | |
19:01 | Add tests to pager1.test and pagerfault.test. (check-in: c6e7595092 user: dan tags: trunk) | |
15:09 | Add pager test cases. Change a condition in pager.c to NEVER(). (check-in: a8f6341d3b user: dan tags: trunk) | |
Changes
Changes to test/pager1.test.
︙ | |||
1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 | 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 | + + + + + + + + + - + + + - + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | } {SQLITE_DONE SQLITE_OK} do_test pager1-9.2.3 { db one {SELECT md5sum(a, b) FROM ab} } [db2 one {SELECT md5sum(a, b) FROM ab}] do_test pager1-9.2.4 { execsql { SELECT count(*) FROM ab } } {128} db close db2 close proc recursive_select {id table {script {}}} { set cnt 0 db eval "SELECT rowid, * FROM $table WHERE rowid = ($id-1)" { recursive_select $rowid $table $script incr cnt } if {$cnt==0} { eval $script } } #------------------------------------------------------------------------- # Test that regardless of the value returned by xSectorSize(), the # minimum effective sector-size is 512 and the maximum 65536 bytes. # testvfs tv -default 1 foreach sectorsize { 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536 131072 262144 } { tv sectorsize $sectorsize set eff $sectorsize if {$sectorsize < 512} { set eff 512 } if {$sectorsize > 65536} { set eff 65536 } |
︙ | |||
1796 1797 1798 1799 1800 1801 1802 | 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 | - | testvfs tv -noshm 1 sqlite3 db2 test.db -vfs tv catchsql { SELECT * FROM ko } db2 } {1 {unable to open database file}} db2 close tv delete do_test pager1-21.2 { |
︙ | |||
1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 | 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 | + + + + | # pager1-23.3.*: Same test as above, but while a reserved lock is held # on the database file. # # pager1-23.4.*: And, for fun, while holding an exclusive lock. # # pager1-23.5.*: Try to set various different journal modes with an # in-memory database (only MEMORY and OFF should work). # # pager1-23.6.*: Try to set locking_mode=normal on an in-memory database # (doesn't work - in-memory databases always use # locking_mode=exclusive). # do_test pager1-23.1.1 { faultsim_delete_and_reopen execsql { PRAGMA journal_mode = PERSIST; CREATE TABLE t1(a, b); } |
︙ | |||
1933 1934 1935 1936 1937 1938 1939 | 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 | - + - + - + - + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | execsql "PRAGMA journal_mode = $mode" } [if $possible {list $mode} {list off}] do_test pager1-23.5.$tn.2 { execsql "PRAGMA journal_mode = memory" execsql "PRAGMA journal_mode = $mode" } [if $possible {list $mode} {list memory}] } |
Changes to test/pagerfault.test.
︙ | |||
610 611 612 613 614 615 616 | 610 611 612 613 614 615 616 617 618 619 620 621 622 623 | - | faultsim_restore_and_reopen } -body { execsql { CREATE TABLE xx(a, b) } } -test { faultsim_test_result {0 {}} } |
︙ | |||
641 642 643 644 645 646 647 648 649 650 651 652 653 654 | 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 | + + + + + + + + + + + + + + + + + + | } -test { faultsim_test_result {0 {}} {1 {}} {1 {SQL logic error or missing database}} } do_faultsim_test pagerfault-14b -prep { faultsim_restore_and_reopen sqlite3 db2 "" db2 eval { PRAGMA page_size = 4096; CREATE TABLE xx(a) } } -body { sqlite3_backup B db2 main db main B step 200 set rc [B finish] if {[string match SQLITE_IOERR_* $rc]} {set rc SQLITE_IOERR} if {$rc != "SQLITE_OK"} { error [sqlite3_test_errstr $rc] } set {} {} } -test { faultsim_test_result {0 {}} } do_faultsim_test pagerfault-14c -prep { faultsim_restore_and_reopen sqlite3 db2 test.db2 db2 eval { PRAGMA synchronous = off; PRAGMA page_size = 4096; CREATE TABLE xx(a); } } -body { sqlite3_backup B db2 main db main B step 200 set rc [B finish] if {[string match SQLITE_IOERR_* $rc]} {set rc SQLITE_IOERR} if {$rc != "SQLITE_OK"} { error [sqlite3_test_errstr $rc] } set {} {} |
︙ | |||
815 816 817 818 819 820 821 | 832 833 834 835 836 837 838 839 840 841 842 843 844 845 | - - | } -body { execsql { PRAGMA journal_mode = delete } } -test { faultsim_test_result {0 delete} faultsim_integrity_check } |
︙ | |||
871 872 873 874 875 876 877 878 879 | 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 | + + + - + + - + - - - - - - - - - - + + + + + + + + + + + + - - - + + + + + + + + + + + + + + | SELECT * FROM t4; SELECT * FROM t6; } } -test { faultsim_test_result {0 {3 5 7}} } #------------------------------------------------------------------------- # This tests fault-injection in a special case in the auto-vacuum code. # do_test pagerfault-20-pre1 { faultsim_delete_and_reopen |