tests/dbcheck.cc File Reference

#include <config.h>
#include "dbcheck.h"
#include "utils.h"
#include "testsuite.h"

Include dependency graph for dbcheck.cc:

Go to the source code of this file.

Functions

string positions_to_string (Xapian::PositionIterator &it, const Xapian::PositionIterator &end, Xapian::termcount *count)
 Convert the list of positions in a positionlist to a string.
string postlist_to_string (const Xapian::Database &db, const string &tname)
string docterms_to_string (const Xapian::Database &db, Xapian::docid did)
 Convert the list of terms in a document to a string.
string docstats_to_string (const Xapian::Database &db, Xapian::docid did)
 Convert statistics about a document to a string.
string termstats_to_string (const Xapian::Database &db, const string &term)
string dbstats_to_string (const Xapian::Database &db)
 Convert global statistics about the database to a string.
void dbcheck (const Xapian::Database &db, Xapian::doccount expected_doccount, Xapian::docid expected_lastdocid)
 Check consistency of database and statistics.


Function Documentation

string positions_to_string ( Xapian::PositionIterator it,
const Xapian::PositionIterator end,
Xapian::termcount count = NULL 
)

Convert the list of positions in a positionlist to a string.

Parameters:
it The start iterator for the positionlist. This will be moved.
end The end iterator for the positionlist.
count If not NULL, a pointer to a value which will be set to the number of positions found.

Definition at line 32 of file dbcheck.cc.

References om_tostring().

Referenced by dbcheck(), docterms_to_string(), and postlist_to_string().

string postlist_to_string ( const Xapian::Database db,
const string &  tname 
)

Definition at line 54 of file dbcheck.cc.

References om_tostring(), positions_to_string(), Xapian::Database::postlist_begin(), and Xapian::Database::postlist_end().

Referenced by DEFINE_TESTCASE().

string docterms_to_string ( const Xapian::Database db,
Xapian::docid  did 
)

Convert the list of terms in a document to a string.

This will include positional information when such information is present.

Definition at line 81 of file dbcheck.cc.

References om_tostring(), positions_to_string(), Xapian::Database::termlist_begin(), and Xapian::Database::termlist_end().

Referenced by DEFINE_TESTCASE().

string docstats_to_string ( const Xapian::Database db,
Xapian::docid  did 
)

Convert statistics about a document to a string.

Definition at line 103 of file dbcheck.cc.

References Xapian::Database::get_doclength(), and om_tostring().

Referenced by DEFINE_TESTCASE().

string termstats_to_string ( const Xapian::Database db,
const string &  term 
)

Definition at line 113 of file dbcheck.cc.

References Xapian::Database::get_collection_freq(), Xapian::Database::get_termfreq(), and om_tostring().

Referenced by DEFINE_TESTCASE().

string dbstats_to_string ( const Xapian::Database db  ) 

Convert global statistics about the database to a string.

Definition at line 124 of file dbcheck.cc.

References Xapian::Database::get_avlength(), Xapian::Database::get_doccount(), Xapian::Database::get_lastdocid(), and om_tostring().

Referenced by DEFINE_TESTCASE().

void dbcheck ( const Xapian::Database db,
Xapian::doccount  expected_doccount,
Xapian::docid  expected_lastdocid 
)

Check consistency of database and statistics.

Raises a TestFail exception if the database is inconsistent.

Definition at line 136 of file dbcheck.cc.

References Xapian::Database::allterms_begin(), Xapian::Database::allterms_end(), Xapian::Database::get_avlength(), Xapian::Database::get_collection_freq(), Xapian::Database::get_doccount(), Xapian::Database::get_doclength(), Xapian::Database::get_document(), Xapian::Database::get_lastdocid(), Xapian::Database::get_termfreq(), Xapian::TermIterator::get_termfreq(), Xapian::TermIterator::get_wdf(), om_tostring(), Xapian::TermIterator::positionlist_begin(), Xapian::TermIterator::positionlist_count(), Xapian::TermIterator::positionlist_end(), positions_to_string(), Xapian::Database::postlist_begin(), Xapian::Database::postlist_end(), Xapian::Database::term_exists(), Xapian::Database::termlist_begin(), Xapian::Database::termlist_end(), TEST, TEST_EQUAL, and TEST_EQUAL_DOUBLE.

Referenced by DEFINE_TESTCASE().


Documentation for Xapian (version 1.0.20).
Generated on 28 Apr 2010 by Doxygen 1.5.2.