xapian-core
1.4.27
|
Tests of serialisation functionality. More...
#include <config.h>
#include "api_serialise.h"
#include <xapian.h>
#include <exception>
#include <stdexcept>
#include "apitest.h"
#include "testutils.h"
Go to the source code of this file.
Classes | |
class | MyPostingSource2 |
class | ExceptionalPostingSource |
class | ExceptionalWeight |
class | ExceptionalMatchSpy |
Functions | |
DEFINE_TESTCASE (serialise_document1, !backend) | |
DEFINE_TESTCASE (serialise_document2, backend) | |
DEFINE_TESTCASE (serialise_query1, !backend) | |
DEFINE_TESTCASE (serialise_query2, !backend) | |
DEFINE_TESTCASE (serialise_query3, !backend) | |
DEFINE_TESTCASE (serialise_query4, !backend) | |
DEFINE_TESTCASE (double_register_leak, !backend) | |
Test for memory leaks when registering posting sources or weights twice. More... | |
DEFINE_TESTCASE (registry1, !backend) | |
Check that exceptions when registering a postingsource are handled well. More... | |
DEFINE_TESTCASE (registry2, !backend) | |
Check that exceptions when registering are handled well. More... | |
DEFINE_TESTCASE (registry3, !backend) | |
Check that exceptions when registering are handled well. More... | |
Tests of serialisation functionality.
Definition in file api_serialise.cc.
DEFINE_TESTCASE | ( | serialise_document1 | , |
! | backend | ||
) |
Definition at line 37 of file api_serialise.cc.
References Xapian::Document::add_posting(), Xapian::Document::add_term(), Xapian::Document::add_value(), Xapian::Document::get_data(), Xapian::Document::serialise(), Xapian::Document::set_data(), Xapian::Document::termlist_begin(), Xapian::Document::termlist_count(), Xapian::Document::termlist_end(), TEST_EQUAL, TEST_NOT_EQUAL, Xapian::Document::unserialise(), Xapian::Document::values_begin(), Xapian::Document::values_count(), and Xapian::Document::values_end().
DEFINE_TESTCASE | ( | serialise_document2 | , |
backend | |||
) |
Definition at line 110 of file api_serialise.cc.
References Xapian::WritableDatabase::add_document(), Xapian::Document::add_posting(), Xapian::Document::add_term(), Xapian::Document::add_value(), Xapian::Document::get_data(), get_database(), Xapian::Database::get_document(), Xapian::Document::set_data(), Xapian::Document::termlist_begin(), Xapian::Document::termlist_count(), Xapian::Document::termlist_end(), TEST_EQUAL, TEST_NOT_EQUAL, Xapian::Document::unserialise(), Xapian::Document::values_begin(), Xapian::Document::values_count(), and Xapian::Document::values_end().
DEFINE_TESTCASE | ( | serialise_query1 | , |
! | backend | ||
) |
Definition at line 180 of file api_serialise.cc.
References Xapian::Query::get_description(), Xapian::Query::serialise(), TEST_EQUAL, and Xapian::Query::unserialise().
DEFINE_TESTCASE | ( | serialise_query2 | , |
! | backend | ||
) |
Definition at line 218 of file api_serialise.cc.
References Xapian::Query::get_description(), Xapian::Query::serialise(), TEST_EQUAL, and Xapian::Query::unserialise().
DEFINE_TESTCASE | ( | serialise_query3 | , |
! | backend | ||
) |
Definition at line 240 of file api_serialise.cc.
References Xapian::Query::get_description(), Xapian::Query::serialise(), TEST_EQUAL, and Xapian::Query::unserialise().
DEFINE_TESTCASE | ( | serialise_query4 | , |
! | backend | ||
) |
Definition at line 294 of file api_serialise.cc.
References Xapian::Query::get_description(), Xapian::Registry::register_posting_source(), Xapian::Query::serialise(), TEST_EQUAL, TEST_EXCEPTION, and Xapian::Query::unserialise().
DEFINE_TESTCASE | ( | double_register_leak | , |
! | backend | ||
) |
Test for memory leaks when registering posting sources or weights twice.
Definition at line 310 of file api_serialise.cc.
References Xapian::Registry::register_posting_source(), and Xapian::Registry::register_weighting_scheme().
DEFINE_TESTCASE | ( | registry1 | , |
! | backend | ||
) |
Check that exceptions when registering a postingsource are handled well.
Definition at line 357 of file api_serialise.cc.
References ExceptionalPostingSource::CLONE, FAIL_TEST, Xapian::Registry::get_posting_source(), Xapian::PostingSource::name(), ExceptionalPostingSource::NONE, Xapian::Registry::register_posting_source(), Xapian::PostingSource::serialise(), TEST_EQUAL, TEST_EXCEPTION, and Xapian::PostingSource::unserialise().
DEFINE_TESTCASE | ( | registry2 | , |
! | backend | ||
) |
Check that exceptions when registering are handled well.
Definition at line 417 of file api_serialise.cc.
References ExceptionalWeight::CLONE, FAIL_TEST, Xapian::Registry::get_weighting_scheme(), Xapian::Weight::name(), ExceptionalWeight::NONE, Xapian::Registry::register_weighting_scheme(), and TEST_EQUAL.
DEFINE_TESTCASE | ( | registry3 | , |
! | backend | ||
) |
Check that exceptions when registering are handled well.
Definition at line 463 of file api_serialise.cc.
References ExceptionalMatchSpy::CLONE, FAIL_TEST, Xapian::Registry::get_match_spy(), Xapian::MatchSpy::name(), ExceptionalMatchSpy::NONE, Xapian::Registry::register_match_spy(), and TEST_EQUAL.