xapian-core
1.4.26
|
Tests of closing databases. More...
#include <config.h>
#include "api_closedb.h"
#include <xapian.h>
#include "safeunistd.h"
#include "apitest.h"
#include "testutils.h"
Go to the source code of this file.
Classes | |
struct | closedb1_iterators |
Macros | |
#define | COUNT_CLOSEDEXC(CODE) |
#define | IF_NOT_CLOSEDEXC(CODE) |
Functions | |
DEFINE_TESTCASE (closedb1, backend) | |
DEFINE_TESTCASE (closedb2, writable &&path) | |
DEFINE_TESTCASE (closedb3, backend) | |
Check API methods which might either work or throw an exception. More... | |
DEFINE_TESTCASE (closedb4, writable &&!inmemory) | |
Regression test for bug fixed in 1.1.4 - close() should implicitly commit(). More... | |
DEFINE_TESTCASE (closedb5, transactions) | |
Test the effects of close() on transactions. More... | |
DEFINE_TESTCASE (closedb6, remote) | |
Database::keep_alive() should fail after close() for a remote database. More... | |
DEFINE_TESTCASE (closedb7, writable) | |
DEFINE_TESTCASE (closedb8, writable &&spelling) | |
DEFINE_TESTCASE (closedb9, writable &&synonyms) | |
DEFINE_TESTCASE (closedb10, writable &&metadata) | |
Tests of closing databases.
Definition in file api_closedb.cc.
#define COUNT_CLOSEDEXC | ( | CODE | ) |
Definition at line 35 of file api_closedb.cc.
Referenced by closedb1_iterators::perform().
#define IF_NOT_CLOSEDEXC | ( | CODE | ) |
Definition at line 42 of file api_closedb.cc.
Referenced by closedb1_iterators::perform().
DEFINE_TESTCASE | ( | closedb1 | , |
backend | |||
) |
Definition at line 206 of file api_closedb.cc.
References close(), Xapian::Database::close(), get_database(), Xapian::Database::get_description(), closedb1_iterators::perform(), Xapian::Database::reopen(), closedb1_iterators::setup(), TEST, TEST_EQUAL, TEST_EXCEPTION, and TEST_NOT_EQUAL.
DEFINE_TESTCASE | ( | closedb2 | , |
writable && | path | ||
) |
Definition at line 250 of file api_closedb.cc.
References Xapian::Database::close(), Xapian::DB_OPEN, get_named_writable_database(), get_named_writable_database_path(), Xapian::Database::postlist_begin(), Xapian::Database::postlist_end(), TEST_EQUAL, and TEST_EXCEPTION.
DEFINE_TESTCASE | ( | closedb3 | , |
backend | |||
) |
Check API methods which might either work or throw an exception.
Definition at line 263 of file api_closedb.cc.
References Xapian::Database::close(), Xapian::Database::get_avlength(), get_database(), Xapian::Database::get_doccount(), Xapian::Database::get_doclength_lower_bound(), Xapian::Database::get_doclength_upper_bound(), Xapian::Database::get_lastdocid(), Xapian::Database::get_uuid(), Xapian::Database::get_wdf_upper_bound(), Xapian::Database::has_positions(), Xapian::Database::keep_alive(), TEST, TEST_EQUAL, and TEST_REL.
DEFINE_TESTCASE | ( | closedb4 | , |
writable &&! | inmemory | ||
) |
Regression test for bug fixed in 1.1.4 - close() should implicitly commit().
Definition at line 303 of file api_closedb.cc.
References Xapian::WritableDatabase::add_document(), Xapian::Database::close(), Xapian::Database::get_doccount(), get_writable_database(), get_writable_database_as_database(), and TEST_EQUAL.
DEFINE_TESTCASE | ( | closedb5 | , |
transactions | |||
) |
Test the effects of close() on transactions.
Definition at line 313 of file api_closedb.cc.
References Xapian::WritableDatabase::add_document(), Xapian::WritableDatabase::begin_transaction(), Xapian::WritableDatabase::cancel_transaction(), Xapian::Database::close(), Xapian::WritableDatabase::commit_transaction(), Xapian::Database::get_doccount(), get_writable_database(), get_writable_database_as_database(), TEST_EQUAL, and TEST_EXCEPTION.
DEFINE_TESTCASE | ( | closedb6 | , |
remote | |||
) |
Database::keep_alive() should fail after close() for a remote database.
Definition at line 386 of file api_closedb.cc.
References Xapian::Database::close(), FAIL_TEST, get_database(), and Xapian::Database::keep_alive().
DEFINE_TESTCASE | ( | closedb7 | , |
writable | |||
) |
DEFINE_TESTCASE | ( | closedb8 | , |
writable && | spelling | ||
) |
DEFINE_TESTCASE | ( | closedb9 | , |
writable && | synonyms | ||
) |
Definition at line 440 of file api_closedb.cc.
References Xapian::WritableDatabase::add_synonym(), Xapian::WritableDatabase::clear_synonyms(), Xapian::Database::close(), get_writable_database(), Xapian::WritableDatabase::remove_synonym(), Xapian::Database::synonym_keys_begin(), Xapian::Database::synonyms_begin(), and TEST_EXCEPTION.
DEFINE_TESTCASE | ( | closedb10 | , |
writable && | metadata | ||
) |
Definition at line 459 of file api_closedb.cc.
References Xapian::Database::close(), Xapian::Database::get_metadata(), get_writable_database(), Xapian::Database::metadata_keys_begin(), Xapian::WritableDatabase::set_metadata(), and TEST_EXCEPTION.