|
xapian-core
2.0.0
|
Unit tests of non-Xapian-specific internal code. More...
#include <config.h>#include <cctype>#include <cerrno>#include <cfloat>#include <climits>#include <cmath>#include <cstring>#include <iostream>#include <limits>#include <memory>#include <string_view>#include <utility>#include "safeunistd.h"#include "testsuite.h"#include "../backends/multi.h"#include "../common/stringutils.h"#include "../backends/uuids.cc"#include "../common/closefrom.cc"#include "../common/errno_to_string.cc"#include "../common/io_utils.cc"#include "../common/fileutils.cc"#include "../common/overflow.h"#include "../common/pack.cc"#include "../common/parseint.h"#include "../common/posixy_wrapper.cc"#include "../common/serialise-double.cc"#include "../common/str.cc"#include "../net/serialise-error.cc"#include "../api/error.cc"#include "../api/smallvector.cc"#include "../api/sortable-serialise.cc"#include "../include/xapian/intrusive_ptr.h"#include "../common/msvc_dirent.cc"#include "../api/constinfo.cc"
Include dependency graph for unittest.cc:Go to the source code of this file.
Classes | |
| class | TestException |
| class | A |
| class | B |
Macros | |
| #define | XAPIAN_UNITTEST |
| #define | UNITTEST_CHECK_EXCEPTION |
| #define | UNITTEST_ASSERT_LOCATION__(LINE, MSG) __FILE__":"#LINE": "#MSG |
| #define | UNITTEST_ASSERT_LOCATION_(LINE, MSG) UNITTEST_ASSERT_LOCATION__(LINE,MSG) |
| #define | UNITTEST_ASSERT_LOCATION(MSG) UNITTEST_ASSERT_LOCATION_(__LINE__,MSG) |
| #define | UNITTEST_ASSERT_NOTHROW(COND, RET) |
| #define | TEST_EXCEPTION(TYPE, CODE) |
Functions | |
| void | description_append (std::string &desc, std::string_view s) |
| DEFINE_TESTCASE (simple_exceptions_work1) | |
| DEFINE_TESTCASE (class_exceptions_work1) | |
| static string | r_r_p (string a, const string &b) |
| DEFINE_TESTCASE (resolverelativepath1) | |
| static void | check_double_serialisation (double u) |
| DEFINE_TESTCASE (serialisedouble1) | |
| static void | test_packuint1 () |
| static void | packstring1_helper (size_t len) |
| static void | test_packstring1 () |
| static void | test_packstring2 () |
| static void | test_sortableserialise1 () |
| template<typename S > | |
| static void | tostring_helper () |
| static void | test_tostring1 () |
| static void | test_strbool1 () |
| Regression test for bug fixed in 1.1.1. More... | |
| static void | test_closefrom1 () |
| static void | test_shard1 () |
| static void | test_uuid1 () |
| static void | test_movesupport1 () |
| static void | test_addoverflows1 () |
| static void | test_suboverflows1 () |
| static void | test_muloverflows1 () |
| template<typename U > | |
| static void | parseunsigned_helper () |
| static void | test_parseunsigned1 () |
| template<typename S > | |
| static void | parsesigned_helper () |
| static void | test_parsesigned1 () |
| static void | test_ioblock1 () |
| Test working with a block-based file using functions from io_utils.h. More... | |
| DEFINE_TESTCASE (vec1) | |
| DEFINE_TESTCASE (vecdeleter1) | |
| int | main (int argc, char **argv) |
Variables | |
| static const char * | unittest_assertion_failed = NULL |
| static const double | test_sortableserialise_numbers [] |
| static const test_desc | tests [] |
Unit tests of non-Xapian-specific internal code.
Definition in file unittest.cc.
| #define TEST_EXCEPTION | ( | TYPE, | |
| CODE | |||
| ) |
Definition at line 65 of file unittest.cc.
| #define UNITTEST_ASSERT_LOCATION | ( | MSG | ) | UNITTEST_ASSERT_LOCATION_(__LINE__,MSG) |
Definition at line 51 of file unittest.cc.
| #define UNITTEST_ASSERT_LOCATION_ | ( | LINE, | |
| MSG | |||
| ) | UNITTEST_ASSERT_LOCATION__(LINE,MSG) |
Definition at line 50 of file unittest.cc.
| #define UNITTEST_ASSERT_LOCATION__ | ( | LINE, | |
| MSG | |||
| ) | __FILE__":"#LINE": "#MSG |
Definition at line 49 of file unittest.cc.
| #define UNITTEST_ASSERT_NOTHROW | ( | COND, | |
| RET | |||
| ) |
Definition at line 52 of file unittest.cc.
| #define UNITTEST_CHECK_EXCEPTION |
Definition at line 40 of file unittest.cc.
| #define XAPIAN_UNITTEST |
Definition at line 38 of file unittest.cc.
|
static |
Definition at line 208 of file unittest.cc.
References serialise_double(), TEST, TEST_EQUAL, and unserialise_double().
Referenced by DEFINE_TESTCASE().
| DEFINE_TESTCASE | ( | class_exceptions_work1 | ) |
Definition at line 120 of file unittest.cc.
| DEFINE_TESTCASE | ( | resolverelativepath1 | ) |
Definition at line 134 of file unittest.cc.
References r_r_p(), and TEST_EQUAL.
| DEFINE_TESTCASE | ( | serialisedouble1 | ) |
Definition at line 234 of file unittest.cc.
References check_double_serialisation().
| DEFINE_TESTCASE | ( | simple_exceptions_work1 | ) |
Definition at line 110 of file unittest.cc.
References TEST_EQUAL.
| DEFINE_TESTCASE | ( | vec1 | ) |
Definition at line 1018 of file unittest.cc.
References Xapian::Vec< T, COW, UNIQUEPTR, typename >::push_back().
| DEFINE_TESTCASE | ( | vecdeleter1 | ) |
Definition at line 1031 of file unittest.cc.
References Xapian::Vec< T, COW, UNIQUEPTR, typename >::push_back().
| void description_append | ( | std::string & | desc, |
| std::string_view | s | ||
| ) |
Definition at line 105 of file unittest.cc.
Referenced by decode_and_show_value(), HoneyCursor::do_find(), HoneyCursor::do_next(), DocumentValueList::get_description(), Xapian::Internal::QueryTerm::get_description(), Xapian::Internal::QueryValueRange::get_description(), Xapian::Internal::QueryValueLE::get_description(), Xapian::Internal::QueryValueGE::get_description(), Xapian::Internal::QueryWildcard::get_description(), Xapian::Internal::QueryEditDistance::get_description(), Xapian::DatabaseMaster::get_description(), Result::get_description(), Xapian::Document::Internal::get_description(), GlassPostList::get_description(), NetworkPostList::get_description(), SlowValueList::get_description(), Xapian::Internal::ExpandTerm::get_description(), Xapian::Error::get_description(), ValueGePostList::get_description(), ValueRangePostList::get_description(), HoneyTable::get_exact_entry(), SSTIndex::maybe_add_entry(), GlassTableCheck::print_key(), GlassTableCheck::print_tag(), HoneyTable::read_key(), HoneyCursor::read_tag(), and HoneyTable::read_val().
| int main | ( | int | argc, |
| char ** | argv | ||
| ) |
Definition at line 1070 of file unittest.cc.
References test_driver::parse_command_line(), test_driver::run(), and tests.
|
static |
Definition at line 285 of file unittest.cc.
References p, pack_string(), TEST, TEST_EQUAL, and unpack_string().
Referenced by test_packstring1().
|
inlinestatic |
Definition at line 874 of file unittest.cc.
References parse_signed(), Xapian::Internal::str(), TEST, TEST_EQUAL, and tout.
|
inlinestatic |
Definition at line 845 of file unittest.cc.
References parse_unsigned(), Xapian::Internal::str(), TEST, TEST_EQUAL, and tout.
|
inlinestatic |
Definition at line 128 of file unittest.cc.
References resolve_relative_path().
Referenced by DEFINE_TESTCASE().
|
static |
Definition at line 748 of file unittest.cc.
References add_overflows(), TEST, and TEST_EQUAL.
|
static |
Definition at line 531 of file unittest.cc.
References close(), Xapian::Internal::closefrom(), TEST, and TEST_EQUAL.
|
static |
Test working with a block-based file using functions from io_utils.h.
Definition at line 921 of file unittest.cc.
References BLOCK_SIZE, close(), errno_to_string(), Xapian::Error::get_error_string(), io_full_sync(), io_open_block_rd(), io_open_block_wr(), io_read_block(), io_readahead_block(), io_sync(), io_unlink(), io_write_block(), SKIP_TEST, TEST, TEST_EQUAL, and TEST_REL.
|
static |
Definition at line 682 of file unittest.cc.
References Xapian::Internal::intrusive_ptr< T >::get(), Xapian::Internal::intrusive_ptr_nonnull< T >::get(), Xapian::Internal::opt_intrusive_ptr< T >::get(), B::release(), TEST, and TEST_EQUAL.
|
static |
Definition at line 817 of file unittest.cc.
References mul_overflows(), TEST, and TEST_EQUAL.
|
static |
Definition at line 323 of file unittest.cc.
References packstring1_helper().
|
static |
Definition at line 334 of file unittest.cc.
References pack_string(), pack_string_empty(), and TEST_EQUAL.
|
static |
Definition at line 263 of file unittest.cc.
References p, pack_uint(), TEST, TEST_EQUAL, tout, and unpack_uint().
|
static |
Definition at line 911 of file unittest.cc.
|
static |
Definition at line 864 of file unittest.cc.
|
static |
Definition at line 555 of file unittest.cc.
References shard_docid(), shard_number(), TEST, TEST_EQUAL, and unshard().
|
static |
Definition at line 429 of file unittest.cc.
References p, Xapian::sortable_serialise(), Xapian::sortable_unserialise(), Xapian::Internal::str(), TEST_AND_EXPLAIN, TEST_EQUAL, test_sortableserialise_numbers, and tout.
|
static |
Regression test for bug fixed in 1.1.1.
Definition at line 525 of file unittest.cc.
References Xapian::Internal::str(), and TEST_EQUAL.
|
static |
Definition at line 801 of file unittest.cc.
References sub_overflows(), TEST, and TEST_EQUAL.
|
static |
Definition at line 484 of file unittest.cc.
References Xapian::Internal::str(), and TEST_EQUAL.
|
static |
Definition at line 577 of file unittest.cc.
References Uuid::BINARY_SIZE, Uuid::clear(), Uuid::data(), Uuid::generate(), Uuid::is_null(), Uuid::parse(), Xapian::Internal::str(), TEST, TEST_EQUAL, TEST_NOT_EQUAL, TEST_REL, and Uuid::to_string().
|
inlinestatic |
Definition at line 468 of file unittest.cc.
References Xapian::Internal::str(), TEST_EQUAL, and tout.
|
static |
Definition at line 380 of file unittest.cc.
Referenced by test_sortableserialise1().
|
static |
Definition at line 1041 of file unittest.cc.
Referenced by main().
|
static |
Definition at line 39 of file unittest.cc.