xapian-core
1.4.26
|
Tests of Database::compact() More...
#include <config.h>
#include "api_compact.h"
#include <xapian.h>
#include "apitest.h"
#include "dbcheck.h"
#include "filetests.h"
#include "msvcignoreinvalidparam.h"
#include "str.h"
#include "testsuite.h"
#include "testutils.h"
#include <cerrno>
#include <cstdlib>
#include <fstream>
#include <sys/types.h>
#include "safesysstat.h"
#include "safefcntl.h"
#include "safeunistd.h"
#include "unixcmds.h"
Go to the source code of this file.
Functions | |
static void | make_sparse_db (Xapian::WritableDatabase &db, const string &s) |
static void | check_sparse_uid_terms (const string &path) |
DEFINE_TESTCASE (compactnorenumber1, compact &&!multi) | |
DEFINE_TESTCASE (compactmerge1, compact) | |
static void | make_multichunk_db (Xapian::WritableDatabase &db, const string &) |
DEFINE_TESTCASE (compactmultichunks1, compact) | |
DEFINE_TESTCASE (compactstub1, compact) | |
DEFINE_TESTCASE (compactstub2, compact) | |
DEFINE_TESTCASE (compactstub3, compact) | |
DEFINE_TESTCASE (compactstub4, compact) | |
static void | make_all_tables (Xapian::WritableDatabase &db, const string &) |
static void | make_missing_tables (Xapian::WritableDatabase &db, const string &) |
DEFINE_TESTCASE (compactmissingtables1, compact) | |
static void | make_all_tables2 (Xapian::WritableDatabase &db, const string &) |
DEFINE_TESTCASE (compactmergesynonym1, compact) | |
Adds coverage for merging synonym table. More... | |
DEFINE_TESTCASE (compactempty1, compact) | |
DEFINE_TESTCASE (compactmultipass1, compact) | |
DEFINE_TESTCASE (compacttofd1, compact &&!chert) | |
DEFINE_TESTCASE (compacttofd2, compact &&!chert) | |
DEFINE_TESTCASE (compactsingle1, compact &&writable &&!chert) | |
DEFINE_TESTCASE (compact1, compact &&writable) | |
Tests of Database::compact()
Definition in file api_compact.cc.
|
static |
Definition at line 93 of file api_compact.cc.
References Xapian::Database::allterms_begin(), Xapian::Database::allterms_end(), Xapian::Database::postlist_begin(), and TEST_EQUAL.
Referenced by DEFINE_TESTCASE().
DEFINE_TESTCASE | ( | compactnorenumber1 | , |
compact &&! | multi | ||
) |
Definition at line 105 of file api_compact.cc.
References Xapian::Database::add_database(), check_sparse_uid_terms(), Xapian::Database::compact(), dbcheck(), Xapian::DBCOMPACT_NO_RENUMBER, dir_exists(), get_compaction_output_path(), get_database_path(), Xapian::Database::get_uuid(), make_sparse_db(), rm_rf(), TEST, TEST_EQUAL, TEST_EXCEPTION, and TEST_NOT_EQUAL.
DEFINE_TESTCASE | ( | compactmerge1 | , |
compact | |||
) |
Definition at line 240 of file api_compact.cc.
References Xapian::Database::add_database(), Xapian::Database::check(), Xapian::Database::compact(), dbcheck(), Xapian::DBCOMPACT_SINGLE_FILE, dir_exists(), file_exists(), get_compaction_output_path(), get_database(), get_database_path(), get_dbtype(), Xapian::Database::get_doccount(), rm_rf(), Xapian::Database::size(), startswith(), TEST, TEST_EQUAL, and tout.
DEFINE_TESTCASE | ( | compactmultichunks1 | , |
compact | |||
) |
Definition at line 313 of file api_compact.cc.
References Xapian::Database::compact(), dbcheck(), get_compaction_output_path(), get_database_path(), Xapian::Database::get_doccount(), make_multichunk_db(), rm_rf(), and TEST_EQUAL.
DEFINE_TESTCASE | ( | compactstub1 | , |
compact | |||
) |
Definition at line 332 of file api_compact.cc.
References Xapian::Database::compact(), dbcheck(), get_compaction_output_path(), get_database_path(), Xapian::Database::get_doccount(), rm_rf(), TEST, and TEST_EQUAL.
DEFINE_TESTCASE | ( | compactstub2 | , |
compact | |||
) |
Definition at line 359 of file api_compact.cc.
References Xapian::Database::compact(), dbcheck(), get_compaction_output_path(), get_database_path(), Xapian::Database::get_doccount(), rm_rf(), TEST, and TEST_EQUAL.
DEFINE_TESTCASE | ( | compactstub3 | , |
compact | |||
) |
Definition at line 384 of file api_compact.cc.
References Xapian::Database::compact(), dbcheck(), get_database_path(), Xapian::Database::get_doccount(), TEST, and TEST_EQUAL.
DEFINE_TESTCASE | ( | compactstub4 | , |
compact | |||
) |
Definition at line 407 of file api_compact.cc.
References Xapian::Database::compact(), dbcheck(), get_database_path(), Xapian::Database::get_doccount(), TEST, and TEST_EQUAL.
DEFINE_TESTCASE | ( | compactmissingtables1 | , |
compact | |||
) |
Definition at line 454 of file api_compact.cc.
References Xapian::Database::add_database(), Xapian::Database::compact(), get_compaction_output_path(), get_database_path(), make_all_tables(), make_missing_tables(), rm_rf(), Xapian::Database::spellings_begin(), Xapian::Database::spellings_end(), Xapian::Database::synonym_keys_begin(), Xapian::Database::synonym_keys_end(), and TEST_NOT_EQUAL.
DEFINE_TESTCASE | ( | compactmergesynonym1 | , |
compact | |||
) |
Adds coverage for merging synonym table.
Definition at line 494 of file api_compact.cc.
References Xapian::Database::add_database(), Xapian::Database::compact(), get_compaction_output_path(), get_database_path(), make_all_tables(), make_all_tables2(), rm_rf(), Xapian::Database::spellings_begin(), Xapian::Database::spellings_end(), Xapian::Database::synonym_keys_begin(), Xapian::Database::synonym_keys_end(), TEST_EQUAL, and TEST_NOT_EQUAL.
DEFINE_TESTCASE | ( | compactempty1 | , |
compact | |||
) |
Definition at line 539 of file api_compact.cc.
References Xapian::Database::add_database(), Xapian::Database::compact(), dbcheck(), get_compaction_output_path(), get_database_path(), Xapian::Database::get_doccount(), rm_rf(), and TEST_EQUAL.
DEFINE_TESTCASE | ( | compactmultipass1 | , |
compact | |||
) |
Definition at line 568 of file api_compact.cc.
References Xapian::Database::add_database(), Xapian::Database::compact(), dbcheck(), Xapian::DBCOMPACT_MULTIPASS, get_compaction_output_path(), get_database_path(), make_sparse_db(), and rm_rf().
DEFINE_TESTCASE | ( | compacttofd1 | , |
compact &&! | chert | ||
) |
Definition at line 596 of file api_compact.cc.
References close(), Xapian::Database::compact(), dbcheck(), get_compaction_output_path(), get_database(), Xapian::Database::get_doccount(), O_BINARY, Xapian::InMemory::open(), rm_rf(), TEST, and TEST_EQUAL.
DEFINE_TESTCASE | ( | compacttofd2 | , |
compact &&! | chert | ||
) |
Definition at line 623 of file api_compact.cc.
References close(), Xapian::Database::compact(), dbcheck(), get_compaction_output_path(), get_database(), Xapian::Database::get_doccount(), O_BINARY, Xapian::InMemory::open(), rm_rf(), TEST, and TEST_EQUAL.
DEFINE_TESTCASE | ( | compactsingle1 | , |
compact &&writable &&! | chert | ||
) |
Definition at line 669 of file api_compact.cc.
References Xapian::Document::add_boolean_term(), Xapian::WritableDatabase::add_document(), Xapian::Document::add_term(), Xapian::Database::check(), Xapian::Database::close(), Xapian::WritableDatabase::commit(), Xapian::Database::compact(), Xapian::DBCOMPACT_SINGLE_FILE, file_exists(), get_compaction_output_path(), get_writable_database(), TEST, TEST_EQUAL, TEST_EXCEPTION, touch(), and tout.
DEFINE_TESTCASE | ( | compact1 | , |
compact && | writable | ||
) |
Definition at line 707 of file api_compact.cc.
References Xapian::Document::add_boolean_term(), Xapian::WritableDatabase::add_document(), Xapian::Document::add_term(), Xapian::Database::check(), Xapian::Database::close(), Xapian::WritableDatabase::commit(), Xapian::Database::compact(), get_compaction_output_path(), get_writable_database(), rm_rf(), TEST_EQUAL, TEST_EXCEPTION, and tout.
|
static |
Definition at line 432 of file api_compact.cc.
References Xapian::WritableDatabase::add_document(), Xapian::WritableDatabase::add_spelling(), Xapian::WritableDatabase::add_synonym(), Xapian::Document::add_term(), and Xapian::WritableDatabase::commit().
Referenced by DEFINE_TESTCASE().
|
static |
Definition at line 480 of file api_compact.cc.
References Xapian::WritableDatabase::add_document(), Xapian::WritableDatabase::add_spelling(), Xapian::WritableDatabase::add_synonym(), Xapian::Document::add_term(), and Xapian::WritableDatabase::commit().
Referenced by DEFINE_TESTCASE().
|
static |
Definition at line 445 of file api_compact.cc.
References Xapian::WritableDatabase::add_document(), Xapian::Document::add_term(), and Xapian::WritableDatabase::commit().
Referenced by DEFINE_TESTCASE().
|
static |
Definition at line 297 of file api_compact.cc.
References Xapian::WritableDatabase::add_document(), Xapian::Document::add_term(), and Xapian::WritableDatabase::commit().
Referenced by DEFINE_TESTCASE().
|
static |
Definition at line 51 of file api_compact.cc.
References Xapian::Document::add_term(), Xapian::WritableDatabase::commit(), Xapian::WritableDatabase::delete_document(), FAIL_TEST, Xapian::WritableDatabase::replace_document(), Xapian::Document::set_data(), Xapian::Internal::str(), and tout.
Referenced by DEFINE_TESTCASE().