OLD | NEW |
1 # 2008 June 18 | 1 # 2008 June 18 |
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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 | 73 |
74 # Test 2: Verify that the highwater mark increases after a large | 74 # Test 2: Verify that the highwater mark increases after a large |
75 # allocation. | 75 # allocation. |
76 # | 76 # |
77 sqlite3_memory_highwater 1 | 77 sqlite3_memory_highwater 1 |
78 set highwater [sqlite3_memory_highwater 0] | 78 set highwater [sqlite3_memory_highwater 0] |
79 do_test memsubsys2-2.1 { | 79 do_test memsubsys2-2.1 { |
80 sqlite3_free [set x [sqlite3_malloc 100000]] | 80 sqlite3_free [set x [sqlite3_malloc 100000]] |
81 expr {$x!="0"} | 81 expr {$x!="0"} |
82 } {1} | 82 } {1} |
83 do_test memsubsys2-2.2 { | 83 do_test memsubsys2-2.2.1 { |
84 expr {[sqlite3_memory_highwater 0]>=[sqlite3_memory_used]+$highwater} | 84 expr {[sqlite3_memory_highwater 0]>=[sqlite3_memory_used]+100000} |
| 85 } {1} |
| 86 do_test memsubsys2-2.2.2 { |
| 87 expr {[sqlite3_memory_highwater 0]>=$highwater+50000} |
85 } {1} | 88 } {1} |
86 | 89 |
87 # Test 3: Verify that turning of memstatus disables the statistics | 90 # Test 3: Verify that turning of memstatus disables the statistics |
88 # tracking. | 91 # tracking. |
89 # | 92 # |
90 db close | 93 db close |
91 sqlite3_shutdown | 94 sqlite3_shutdown |
92 sqlite3_config_memstatus 0 | 95 sqlite3_config_memstatus 0 |
93 sqlite3_initialize | 96 sqlite3_initialize |
94 reset_highwater_marks | 97 reset_highwater_marks |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 } {1} | 167 } {1} |
165 do_test memsubsys2-4.11 { | 168 do_test memsubsys2-4.11 { |
166 sqlite3_memory_used | 169 sqlite3_memory_used |
167 } {0} | 170 } {0} |
168 | 171 |
169 | 172 |
170 | 173 |
171 | 174 |
172 autoinstall_test_functions | 175 autoinstall_test_functions |
173 finish_test | 176 finish_test |
OLD | NEW |