| 136 | } |
| 137 | |
| 138 | bool test_batch() { |
| 139 | IndexFixture f("test_batch"); |
| 140 | if (!f.init()) return false; |
| 141 | |
| 142 | if (f.add_batch(0, 100) != 0) return false; |
| 143 | |
| 144 | if (f.get(0).second != "doc0") return false; |
| 145 | if (f.get(50).second != "doc50") return false; |
| 146 | if (f.get(99).second != "doc99") return false; |
| 147 | |
| 148 | if (f.del({10, 20, 30, 40, 50}) != 0) return false; |
| 149 | if (f.get(50).first == 0) return false; |
| 150 | if (f.get(51).first != 0) return false; |
| 151 | |
| 152 | return true; |
| 153 | } |
| 154 | |
| 155 | bool test_query() { |
| 156 | IndexFixture f("test_query"); |