| 2178 | |
| 2179 | static const int bug287_terms[] = { 219, 221, 222, 223, 224, 225, 226 }; |
| 2180 | static const int bug287_copies[] = { 74, 116, 199, 21, 45, 155, 189 }; |
| 2181 | |
| 2182 | DEFINE_TESTCASE(bug287, flint) { |
| 2183 | { |
| 2184 | Xapian::WritableDatabase db = get_named_writable_database("bug287", string()); |
| 2185 | |
| 2186 | for (size_t i = 0; i < sizeof(bug287_terms) / sizeof(bug287_terms[0]); ++i) { |
| 2187 | Xapian::Document doc; |
| 2188 | doc.add_term("XC" + om_tostring(bug287_terms[i])); |
| 2189 | doc.add_term("XTabc"); |
| 2190 | doc.add_term("XAdef"); |
| 2191 | doc.add_term("XRghi"); |
| 2192 | doc.add_term("XYabc"); |
| 2193 | size_t copies = bug287_copies[i]; |
| 2194 | while (copies--) db.add_document(doc); |
| 2195 | } |
| 2196 | |
| 2197 | db.flush(); |
| 2198 | |
| 2199 | for (size_t i = 0; i < sizeof(bug287_terms) / sizeof(bug287_terms[0]); ++i) { |
| 2200 | db.delete_document("XC" + om_tostring(bug287_terms[i])); |
| 2201 | } |
| 2202 | } |
| 2203 | |
| 2204 | if (system("../bin/xapian-check .flint/dbw__bug287") != 0) return false; |
| 2205 | |
| 2206 | return true; |
| 2207 | } |