Ticket #440: patch1.patch
File patch1.patch, 2.0 KB (added by , 15 years ago) |
---|
-
api_compact.cc
32 32 #include <xapian.h> 33 33 34 34 #include <cstdlib> 35 36 #ifdef __WIN32__ 37 #define WEXITSTATUS(w) w 38 #else 35 39 #include <sys/wait.h> 40 #endif 36 41 37 42 #include "utils.h" 38 43 #include "unixcmds.h" … … 93 98 } 94 99 } 95 100 101 #ifdef __WIN32__ 102 #define XAPIANCOMPACTPATH "..\\win32\\Release\\xapian-compact >nul " 103 #else 104 #define XAPIANCOMPACTPATH "../bin/xapian-compact >/dev/null 2>&1 " 105 #endif 106 107 96 108 DEFINE_TESTCASE(compactnorenumber1, flint) { 97 109 int status; 98 110 … … 103 115 "3000 999999 !999999"); 104 116 d += ' '; 105 117 106 string cmd = "../bin/xapian-compact >/dev/null 2>&1 --no-renumber ";118 string cmd = XAPIANCOMPACTPATH; 107 119 string out = get_named_writable_database_path("compactnorenumber1out"); 108 120 109 121 rm_rf(out); 110 status = system(cmd + b + out);122 status = system(cmd + " --no-renumber " + b + out); 111 123 TEST_EQUAL(WEXITSTATUS(status), 0); 112 124 check_sparse_uid_terms(out); 113 125 114 126 // Should fail for 1.0.x which doesn't support --no-renumber when merging. 115 127 rm_rf(out); 116 status = system(cmd + b + d + out);128 status = system(cmd + " --no-renumber " + b + d + out); 117 129 TEST_NOT_EQUAL(WEXITSTATUS(status), 0); 118 130 119 131 return true; … … 123 135 DEFINE_TESTCASE(compactmerge1, flint) { 124 136 int status; 125 137 126 string cmd = "../bin/xapian-compact >/dev/null 2>&1 ";138 string cmd = XAPIANCOMPACTPATH; 127 139 string indbpath = get_database_path("apitest_simpledata") + ' '; 128 140 string outdbpath = get_named_writable_database_path("compactmerge1out"); 129 141 rm_rf(outdbpath); … … 160 172 DEFINE_TESTCASE(compactmultichunks1, flint) { 161 173 int status; 162 174 163 string cmd = "../bin/xapian-compact >/dev/null 2>&1 ";175 string cmd = XAPIANCOMPACTPATH; 164 176 string indbpath = get_database_path("compactmultichunks1in", 165 177 make_multichunk_db, ""); 166 178 string outdbpath = get_named_writable_database_path("compactmultichunks1out");