OLD | NEW |
1 # 2011 March 28 | 1 # 2011 March 28 |
2 # | 2 # |
3 # The author disclaims copyright to this source code. In place of | 3 # The author disclaims copyright to this source code. In place of |
4 # a legal notice, here is a blessing: | 4 # a legal notice, here is a blessing: |
5 # | 5 # |
6 # May you do good and not evil. | 6 # May you do good and not evil. |
7 # May you find forgiveness for yourself and forgive others. | 7 # May you find forgiveness for yourself and forgive others. |
8 # May you share freely, never taking more than you give. | 8 # May you share freely, never taking more than you give. |
9 # | 9 # |
10 #*********************************************************************** | 10 #*********************************************************************** |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 | 236 |
237 execsql { | 237 execsql { |
238 INSERT INTO t1 VALUES(randomblob(10000), randomblob(10000)); | 238 INSERT INTO t1 VALUES(randomblob(10000), randomblob(10000)); |
239 SELECT length(a) + length(b) FROM t1; | 239 SELECT length(a) + length(b) FROM t1; |
240 COMMIT; | 240 COMMIT; |
241 } | 241 } |
242 } -test { | 242 } -test { |
243 faultsim_test_result {0 20000} | 243 faultsim_test_result {0 20000} |
244 } | 244 } |
245 | 245 |
| 246 #------------------------------------------------------------------------- |
| 247 # Test errors in mmap(). |
| 248 # |
| 249 proc vfsfault_install {} { |
| 250 test_syscall reset |
| 251 test_syscall install {mmap} |
| 252 } |
| 253 |
| 254 faultsim_delete_and_reopen |
| 255 execsql { |
| 256 CREATE TABLE t1(a, b); |
| 257 INSERT INTO t1 VALUES(1, 2); |
| 258 } |
| 259 faultsim_save_and_close |
| 260 |
| 261 do_faultsim_test 4 -faults vfsfault-* -prep { |
| 262 faultsim_restore_and_reopen |
| 263 file_control_chunksize_test db main 8192 |
| 264 execsql { |
| 265 PRAGMA mmap_size = 1000000; |
| 266 } |
| 267 } -body { |
| 268 test_syscall errno mmap EACCES |
| 269 |
| 270 execsql { |
| 271 SELECT * FROM t1; |
| 272 } |
| 273 } -test { |
| 274 faultsim_test_result {0 {1 2}} {1 {disk I/O error}} |
| 275 } |
| 276 |
246 finish_test | 277 finish_test |
247 | |
OLD | NEW |