| 224 | |
| 225 | // Test use of compact on a database which has multiple chunks for a term. |
| 226 | DEFINE_TESTCASE(compactmultichunks1, brass || chert || flint) { |
| 227 | int status; |
| 228 | |
| 229 | string cmd = "../bin/xapian-compact >/dev/null 2>&1 "; |
| 230 | string indbpath = get_database_path("compactmultichunks1in", |
| 231 | make_multichunk_db, ""); |
| 232 | string outdbpath = get_named_writable_database_path("compactmultichunks1out"); |
| 233 | rm_rf(outdbpath); |
| 234 | |
| 235 | status = system(cmd + indbpath + ' ' + outdbpath); |
| 236 | TEST_EQUAL(WEXITSTATUS(status), 0); |
| 237 | |
| 238 | Xapian::Database indb(indbpath); |
| 239 | Xapian::Database outdb(outdbpath); |
| 240 | |
| 241 | TEST_EQUAL(indb.get_doccount(), outdb.get_doccount()); |
| 242 | dbcheck(outdb, outdb.get_doccount(), outdb.get_doccount()); |
| 243 | |
| 244 | return true; |
| 245 | } |