| OLD | NEW |
| 1 # 2008 August 29 | 1 # 2008 August 29 |
| 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 #*********************************************************************** |
| 11 # | 11 # |
| 12 # This file is focused on testing the pcache module. | 12 # This file is focused on testing the pcache module. |
| 13 # | 13 # |
| 14 # $Id: pcache.test,v 1.5 2009/05/08 06:52:48 danielk1977 Exp $ | 14 # $Id: pcache.test,v 1.5 2009/05/08 06:52:48 danielk1977 Exp $ |
| 15 | 15 |
| 16 set testdir [file dirname $argv0] | 16 set testdir [file dirname $argv0] |
| 17 source $testdir/tester.tcl | 17 source $testdir/tester.tcl |
| 18 | 18 |
| 19 # Do not use a codec for tests in this file, as the database file is |
| 20 # manipulated directly using tcl scripts (using the [hexio_write] command). |
| 21 # |
| 22 do_not_use_codec |
| 23 |
| 24 # Only works with a mode-2 pcache where all pcaches share a single set |
| 25 # of pages. |
| 26 # |
| 27 ifcapable {!memorymanage && threadsafe} { |
| 28 finish_test |
| 29 return |
| 30 } |
| 19 | 31 |
| 20 # The pcache module limits the number of pages available to purgeable | 32 # The pcache module limits the number of pages available to purgeable |
| 21 # caches to the sum of the 'cache_size' values for the set of open | 33 # caches to the sum of the 'cache_size' values for the set of open |
| 22 # caches. This block of tests, pcache-1.*, test that the library behaves | 34 # caches. This block of tests, pcache-1.*, test that the library behaves |
| 23 # corrctly when it is forced to exceed this limit. | 35 # corrctly when it is forced to exceed this limit. |
| 24 # | 36 # |
| 25 do_test pcache-1.1 { | 37 do_test pcache-1.1 { |
| 26 db close | 38 db close |
| 27 pcache_stats | 39 pcache_stats |
| 28 } {current 0 max 0 min 0 recyclable 0} | 40 } {current 0 max 0 min 0 recyclable 0} |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 SELECT * FROM t5 ORDER BY a; SELECT * FROM t5; | 172 SELECT * FROM t5 ORDER BY a; SELECT * FROM t5; |
| 161 SELECT * FROM t6 ORDER BY a; SELECT * FROM t6; | 173 SELECT * FROM t6 ORDER BY a; SELECT * FROM t6; |
| 162 SELECT * FROM t7 ORDER BY a; SELECT * FROM t7; | 174 SELECT * FROM t7 ORDER BY a; SELECT * FROM t7; |
| 163 SELECT * FROM t8 ORDER BY a; SELECT * FROM t8; | 175 SELECT * FROM t8 ORDER BY a; SELECT * FROM t8; |
| 164 SELECT * FROM t9 ORDER BY a; SELECT * FROM t9; | 176 SELECT * FROM t9 ORDER BY a; SELECT * FROM t9; |
| 165 } | 177 } |
| 166 pcache_stats | 178 pcache_stats |
| 167 } {current 14 max 15 min 10 recyclable 14} | 179 } {current 14 max 15 min 10 recyclable 14} |
| 168 | 180 |
| 169 finish_test | 181 finish_test |
| OLD | NEW |