]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Update test file walprotocol.test to account for the changes in the wal
authordan <dan@noemail.net>
Thu, 30 Nov 2017 07:55:15 +0000 (07:55 +0000)
committerdan <dan@noemail.net>
Thu, 30 Nov 2017 07:55:15 +0000 (07:55 +0000)
locking protocol.

FossilOrigin-Name: 64e567009dd56ef595850fe460925bc15fa875163541527638b654aa2b2cf785

manifest
manifest.uuid
test/walprotocol.test

index 3a1692e2eab41946008b93765b8ea4e9642f25b7..6f7fbcd4c603805a7b98cf5406bccc83e366138e 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Fix\san\sassertion\sfault\sfound\sby\sOSSFuzz.
-D 2017-11-28T20:43:40.167
+C Update\stest\sfile\swalprotocol.test\sto\saccount\sfor\sthe\schanges\sin\sthe\swal\nlocking\sprotocol.
+D 2017-11-30T07:55:15.935
 F Makefile.in 6a879cbf01e37f9eac131414955f71774b566502d9a57ded1b8585b507503cb8
 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
 F Makefile.msc e5d7606238f55816da99f719969598df5b091aa2e9a6935c9412fcae8f53fc44
@@ -1533,7 +1533,7 @@ F test/walmode.test 4022fe03ae6e830583672caa101f046438a0473c
 F test/walnoshm.test 84ca10c544632a756467336b7c3b864d493ee496
 F test/waloverwrite.test dad2f26567f1b45174e54fbf9a8dc1cb876a7f03
 F test/walpersist.test 8c6b7e3ec1ba91b5e4dc4e0921d6d3f87cd356a6
-F test/walprotocol.test 0b92feb132ccebd855494d917d3f6c2d717ace20
+F test/walprotocol.test a112aba0b79e3adeaa485fed09484b32c654e97df58e454aa8489ac2cd57bf84
 F test/walro.test cb438d05ba0d191f10b688e39c4f0cd5b71569a1d1f4440e5bdf3c6880e08c20
 F test/walro2.test 8812e514c968bf4ee317571fafedac43443360ae23edd7d0f4ef1eae0c13e8e8
 F test/walrofault.test c70cb6e308c443867701856cce92ad8288cd99488fa52afab77cca6cfd51af68
@@ -1679,7 +1679,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
 F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
 F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P b81a31495bd27c1d96f7df653da3502054240cb5acf66b860da7f0f9b422a524
-R 419b1183c51a17454670ae5c0f948f4f
+P 75d699877fa7d06d30285ecf008fbedfdf68cc7965bb328c96f5a931d1f13f04
+R fc8bdb8d48da4660663e6bac79ba45ec
 U dan
-Z af229f4b2717b4f314275fdbf907e896
+Z d8a8a814dbff1ab540fb1916cfe46931
index 3f2f6eee607714b19dba6ccabb390fe5515714da..86aba2434a27199ee8f2b390c979bd5b3f778ce0 100644 (file)
@@ -1 +1 @@
-75d699877fa7d06d30285ecf008fbedfdf68cc7965bb328c96f5a931d1f13f04
\ No newline at end of file
+64e567009dd56ef595850fe460925bc15fa875163541527638b654aa2b2cf785
\ No newline at end of file
index ee8d0b72a555553ea56f24f67525df4d42a7cf6b..b1d9e8c01fcca058892ce62db0420eff101cb6d1 100644 (file)
@@ -52,21 +52,21 @@ do_test 1.1 {
   set ::locks [list]
   sqlite3 db test.db -vfs T
   execsql { SELECT * FROM x }
-  lrange $::locks 0 3
-} [list {0 1 lock exclusive} {1 7 lock exclusive}      \
-        {1 7 unlock exclusive} {0 1 unlock exclusive}  \
+  lrange $::locks 0 5
+} [list {0 1 lock exclusive} {1 2 lock exclusive} {4 4 lock exclusive} \
+        {1 2 unlock exclusive} {4 4 unlock exclusive} {0 1 unlock exclusive}  \
 ]
 do_test 1.2 {
   db close
   set ::locks [list]
   sqlite3 db test.db -vfs T
   execsql { SELECT * FROM x }
-  lrange $::locks 0 3
-} [list {0 1 lock exclusive} {1 7 lock exclusive}      \
-        {1 7 unlock exclusive} {0 1 unlock exclusive}  \
+  lrange $::locks 0 5
+} [list {0 1 lock exclusive} {1 2 lock exclusive} {4 4 lock exclusive} \
+        {1 2 unlock exclusive} {4 4 unlock exclusive} {0 1 unlock exclusive}  \
 ]
 proc lock_callback {method filename handle lock} {
-  if {$lock == "1 7 lock exclusive"} { return SQLITE_BUSY }
+  if {$lock == "1 2 lock exclusive"} { return SQLITE_BUSY }
   return SQLITE_OK
 }
 puts "# Warning: This next test case causes SQLite to call xSleep(1) 100 times."
@@ -90,6 +90,18 @@ do_test 1.4 {
   sqlite3 db test.db -vfs T
   catchsql { SELECT * FROM x }
 } {1 {locking protocol}}
+
+puts "# Warning: Third time!"
+proc lock_callback {method filename handle lock} {
+  if {$lock == "4 4 lock exclusive"} { return SQLITE_BUSY }
+  return SQLITE_OK
+}
+do_test 1.5 {
+  db close
+  set ::locks [list]
+  sqlite3 db test.db -vfs T
+  catchsql { SELECT * FROM x }
+} {1 {locking protocol}}
 db close
 T delete
 
@@ -135,13 +147,14 @@ T filter xShmLock
 T script lock_callback
 
 proc lock_callback {method file handle spec} {
-  if {$spec == "1 7 unlock exclusive"} {
+  if {$spec == "1 2 unlock exclusive"} {
     T filter {}
     set ::r [catchsql { SELECT * FROM b } db2]
   }
 }
 sqlite3 db test.db
 sqlite3 db2 test.db
+puts "# Warning: Another slow test!"
 do_test 2.5 {
   execsql { SELECT * FROM b }
 } {Tehran Qom Markazi Qazvin Gilan Ardabil}
@@ -157,12 +170,13 @@ sqlite3 db2 test.db
 T filter xShmLock
 T script lock_callback
 proc lock_callback {method file handle spec} {
-  if {$spec == "1 7 unlock exclusive"} {
+  if {$spec == "1 2 unlock exclusive"} {
     T filter {}
     set ::r [catchsql { SELECT * FROM b } db2]
   }
 }
 unset ::r
+puts "# Warning: Last one!"
 do_test 2.7 {
   execsql { SELECT * FROM b }
 } {Tehran Qom Markazi Qazvin Gilan Ardabil}