xapian-core  1.4.26
Classes | Functions
api_percentages.cc File Reference

Tests of percentage calculations. More...

#include <config.h>
#include "api_percentages.h"
#include <xapian.h>
#include "apitest.h"
#include "str.h"
#include "testutils.h"
#include <cfloat>
+ Include dependency graph for api_percentages.cc:

Go to the source code of this file.

Classes

class  MyPostingSource
 
class  ZWeight
 

Functions

 DEFINE_TESTCASE (consistency3, backend)
 
 DEFINE_TESTCASE (pctcutoff4, backend &&!remote &&!multi)
 Test for rounding errors in percentage weight calculations and cutoffs. More...
 
 DEFINE_TESTCASE (pctcutoff5, backend)
 Check we throw for a percentage cutoff while sorting primarily by value. More...
 
 DEFINE_TESTCASE (topercent3, backend)
 
 DEFINE_TESTCASE (topercent4, backend)
 
 DEFINE_TESTCASE (topercent5, backend)
 Test that a search with a non-existent term doesn't get 100%. More...
 
 DEFINE_TESTCASE (topercent6, backend)
 Test that OP_FILTER doesn't affect percentages. More...
 
static void make_topercent7_db (Xapian::WritableDatabase &db, const string &)
 
 DEFINE_TESTCASE (topercent7, backend)
 Test that a term with wdf always = 0 gets counted. More...
 
 DEFINE_TESTCASE (checkzeromaxpartopt1, backend &&!remote)
 Regression test for bug introduced in 1.3.1 and fixed in 1.3.2. More...
 

Detailed Description

Tests of percentage calculations.

Definition in file api_percentages.cc.

Function Documentation

◆ DEFINE_TESTCASE() [1/9]

DEFINE_TESTCASE ( consistency3  ,
backend   
)

◆ DEFINE_TESTCASE() [2/9]

DEFINE_TESTCASE ( pctcutoff4  ,
backend &&!remote &&!  multi 
)

◆ DEFINE_TESTCASE() [3/9]

DEFINE_TESTCASE ( pctcutoff5  ,
backend   
)

◆ DEFINE_TESTCASE() [4/9]

DEFINE_TESTCASE ( topercent3  ,
backend   
)

◆ DEFINE_TESTCASE() [5/9]

DEFINE_TESTCASE ( topercent4  ,
backend   
)

◆ DEFINE_TESTCASE() [6/9]

DEFINE_TESTCASE ( topercent5  ,
backend   
)

Test that a search with a non-existent term doesn't get 100%.

Definition at line 236 of file api_percentages.cc.

References Xapian::MSet::empty(), get_database(), Xapian::Enquire::get_mset(), Xapian::Query::OP_OR, Xapian::Enquire::set_query(), Xapian::Enquire::set_weighting_scheme(), TEST, and TEST_REL.

◆ DEFINE_TESTCASE() [7/9]

DEFINE_TESTCASE ( topercent6  ,
backend   
)

◆ DEFINE_TESTCASE() [8/9]

DEFINE_TESTCASE ( topercent7  ,
backend   
)

◆ DEFINE_TESTCASE() [9/9]

DEFINE_TESTCASE ( checkzeromaxpartopt1  ,
backend &&!  remote 
)

◆ make_topercent7_db()

static void make_topercent7_db ( Xapian::WritableDatabase db,
const string &   
)
static