xapian-core
1.4.27
|
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 <utility>
#include "safeunistd.h"
#include "testsuite.h"
#include "../common/stringutils.h"
#include "../common/log2.h"
#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/parseint.h"
#include "../common/posixy_wrapper.cc"
#include "../common/serialise-double.cc"
#include "../common/str.cc"
#include "../backends/uuids.cc"
#include "../net/length.cc"
#include "../net/serialise-error.cc"
#include "../api/error.cc"
#include "../api/sortable-serialise.cc"
#include "../common/msvc_dirent.cc"
#include "../api/constinfo.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, const std::string &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_serialiselength1 () |
static void | test_serialiselength2 () |
static void | test_serialiseerror1 () |
static void | test_log2 () |
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_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... | |
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 66 of file unittest.cc.
Referenced by test_serialiselength2().
#define UNITTEST_ASSERT_LOCATION | ( | MSG | ) | UNITTEST_ASSERT_LOCATION_(__LINE__,MSG) |
Definition at line 52 of file unittest.cc.
#define UNITTEST_ASSERT_LOCATION_ | ( | LINE, | |
MSG | |||
) | UNITTEST_ASSERT_LOCATION__(LINE,MSG) |
Definition at line 51 of file unittest.cc.
#define UNITTEST_ASSERT_LOCATION__ | ( | LINE, | |
MSG | |||
) | __FILE__":"#LINE": "#MSG |
Definition at line 50 of file unittest.cc.
#define UNITTEST_ASSERT_NOTHROW | ( | COND, | |
RET | |||
) |
Definition at line 53 of file unittest.cc.
#define UNITTEST_CHECK_EXCEPTION |
Definition at line 39 of file unittest.cc.
#define XAPIAN_UNITTEST |
Definition at line 37 of file unittest.cc.
|
static |
Definition at line 205 of file unittest.cc.
References serialise_double(), TEST, TEST_EQUAL, and unserialise_double().
Referenced by DEFINE_TESTCASE_().
DEFINE_TESTCASE_ | ( | simple_exceptions_work1 | ) |
Definition at line 107 of file unittest.cc.
References TEST_EQUAL.
DEFINE_TESTCASE_ | ( | class_exceptions_work1 | ) |
Definition at line 117 of file unittest.cc.
DEFINE_TESTCASE_ | ( | resolverelativepath1 | ) |
Definition at line 131 of file unittest.cc.
References r_r_p(), and TEST_EQUAL.
DEFINE_TESTCASE_ | ( | serialisedouble1 | ) |
Definition at line 231 of file unittest.cc.
References check_double_serialisation().
void description_append | ( | std::string & | desc, |
const std::string & | s | ||
) |
Definition at line 102 of file unittest.cc.
Referenced by decode_and_show_value(), ValueGePostList::get_description(), DocumentValueList::get_description(), Xapian::Internal::QueryTerm::get_description(), Xapian::Internal::ExpandTerm::get_description(), SlowValueList::get_description(), ValueRangePostList::get_description(), NetworkPostList::get_description(), Xapian::DatabaseMaster::get_description(), Xapian::Internal::QueryValueRange::get_description(), Xapian::Error::get_description(), Xapian::Internal::QueryValueLE::get_description(), Xapian::Internal::QueryValueGE::get_description(), Xapian::Document::Internal::get_description(), GlassPostList::get_description(), Xapian::Internal::QueryWildcard::get_description(), ChertTableCheck::print_key(), GlassTableCheck::print_key(), ChertTableCheck::print_tag(), and GlassTableCheck::print_tag().
int main | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 1030 of file unittest.cc.
References test_driver::parse_command_line(), and test_driver::run().
|
inlinestatic |
Definition at line 868 of file unittest.cc.
References parse_signed(), Xapian::Internal::str(), TEST, TEST_EQUAL, and tout.
|
inlinestatic |
Definition at line 839 of file unittest.cc.
References parse_unsigned(), Xapian::Internal::str(), TEST, TEST_EQUAL, and tout.
|
inlinestatic |
Definition at line 125 of file unittest.cc.
References resolve_relative_path().
Referenced by DEFINE_TESTCASE_().
|
static |
Definition at line 742 of file unittest.cc.
References add_overflows(), TEST, and TEST_EQUAL.
|
static |
Definition at line 571 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 907 of file unittest.cc.
References BLOCK_SIZE, close(), errno_to_string(), Xapian::Error::get_description(), 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 412 of file unittest.cc.
References log2(), and TEST_EQUAL.
|
static |
Definition at line 700 of file unittest.cc.
References Xapian::Internal::intrusive_ptr< T >::get(), Xapian::Internal::opt_intrusive_ptr< T >::get(), A::get_x(), B::get_x(), B::release(), and TEST_EQUAL.
|
static |
Definition at line 811 of file unittest.cc.
References mul_overflows(), TEST, and TEST_EQUAL.
|
static |
Definition at line 897 of file unittest.cc.
|
static |
Definition at line 858 of file unittest.cc.
|
static |
Definition at line 376 of file unittest.cc.
References errno_to_string(), Xapian::Error::get_description(), Xapian::Error::get_error_string(), serialise_error(), TEST, TEST_STRINGS_EQUAL, and unserialise_error().
|
static |
Definition at line 263 of file unittest.cc.
References decode_length(), encode_length(), TEST_EQUAL, and tout.
|
static |
Definition at line 284 of file unittest.cc.
References decode_length_and_check(), encode_length(), TEST, TEST_EQUAL, and TEST_EXCEPTION.
|
static |
Definition at line 469 of file unittest.cc.
References 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 565 of file unittest.cc.
References Xapian::Internal::str(), and TEST_EQUAL.
|
static |
Definition at line 795 of file unittest.cc.
References sub_overflows(), TEST, and TEST_EQUAL.
|
static |
Definition at line 524 of file unittest.cc.
References Xapian::Internal::str(), and TEST_EQUAL.
|
static |
Definition at line 595 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 508 of file unittest.cc.
References Xapian::Internal::str(), TEST_EQUAL, and tout.
|
static |
Definition at line 420 of file unittest.cc.
Referenced by test_sortableserialise1().
|
static |
Definition at line 1004 of file unittest.cc.
|
static |
Definition at line 38 of file unittest.cc.