xapian-core  1.4.21
Classes | Functions
api_weight.cc File Reference

tests of Xapian::Weight subclasses More...

#include <config.h>
#include "api_weight.h"
#include <cmath>
#include <xapian.h>
#include "apitest.h"
#include "testutils.h"
+ Include dependency graph for api_weight.cc:

Go to the source code of this file.

Classes

class  CheckInitWeight
 
class  CheckStatsWeight
 

Functions

 DEFINE_TESTCASE (tradweight3, !backend)
 
 DEFINE_TESTCASE (unigramlmweight3, !backend)
 
 DEFINE_TESTCASE (bm25weight3, !backend)
 
 DEFINE_TESTCASE (bm25weight4, backend)
 
 DEFINE_TESTCASE (bm25weight5, backend)
 Test non-zero k2 with zero k1. More...
 
 DEFINE_TESTCASE (bm25plusweight1, !backend)
 
 DEFINE_TESTCASE (bm25plusweight2, backend)
 
 DEFINE_TESTCASE (bm25plusweight3, backend)
 
 DEFINE_TESTCASE (inl2weight1, !backend)
 
 DEFINE_TESTCASE (inl2weight2, !backend)
 
 DEFINE_TESTCASE (inl2weight3, backend)
 
 DEFINE_TESTCASE (ifb2weight1, !backend)
 
 DEFINE_TESTCASE (ifb2weight2, !backend)
 
 DEFINE_TESTCASE (ifb2weight3, backend)
 
 DEFINE_TESTCASE (ineb2weight1, !backend)
 
 DEFINE_TESTCASE (ineb2weight2, !backend)
 
 DEFINE_TESTCASE (ineb2weight3, backend)
 
 DEFINE_TESTCASE (bb2weight1, !backend)
 
 DEFINE_TESTCASE (bb2weight2, !backend)
 
 DEFINE_TESTCASE (bb2weight3, backend)
 
 DEFINE_TESTCASE (bb2weight4, backend)
 
 DEFINE_TESTCASE (dlhweight1, backend)
 
 DEFINE_TESTCASE (dlhweight2, !backend)
 
static void gen_wdf_eq_doclen_db (Xapian::WritableDatabase &db, const string &)
 
 DEFINE_TESTCASE (dlhweight3, generated)
 
 DEFINE_TESTCASE (pl2weight1, !backend)
 
 DEFINE_TESTCASE (pl2weight2, !backend)
 
 DEFINE_TESTCASE (pl2weight3, backend)
 
 DEFINE_TESTCASE (pl2plusweight1, !backend)
 
 DEFINE_TESTCASE (pl2plusweight2, !backend)
 
 DEFINE_TESTCASE (pl2plusweight3, !backend)
 
 DEFINE_TESTCASE (pl2plusweight4, backend)
 
 DEFINE_TESTCASE (pl2plusweight5, backend)
 
 DEFINE_TESTCASE (dphweight1, backend)
 
 DEFINE_TESTCASE (dphweight2, !backend)
 
 DEFINE_TESTCASE (dphweight3, generated)
 
 DEFINE_TESTCASE (tfidfweight1, !backend)
 
 DEFINE_TESTCASE (tfidfweight2, !backend)
 
 DEFINE_TESTCASE (tfidfweight3, backend)
 
 DEFINE_TESTCASE (checkinitweight1, backend &&!multi &&!remote)
 Regression test - check init() is called for the term-indep Weight obj. More...
 
 DEFINE_TESTCASE (checkstatsweight1, backend &&!remote)
 Check the weight subclass gets the correct stats. More...
 
 DEFINE_TESTCASE (checkstatsweight2, backend &&!remote)
 Check the weight subclass gets the correct stats with OP_SYNONYM. More...
 
 DEFINE_TESTCASE (checkstatsweight3, backend &&!remote &&!multi)
 Check the weight subclass gets the correct stats with OP_WILDCARD. More...
 
 DEFINE_TESTCASE (checkstatsweight4, backend &&!remote &&!multi)
 Check the stats for a repeated term are correct. More...
 
 DEFINE_TESTCASE (unigramlmweight4, backend)
 
 DEFINE_TESTCASE (unigramlmweight5, backend)
 
 DEFINE_TESTCASE (unigramlmweight6, !backend)
 
 DEFINE_TESTCASE (unigramlmweight7, backend)
 
 DEFINE_TESTCASE (unigramlmweight8, backend)
 
 DEFINE_TESTCASE (boolweight1, !backend)
 
 DEFINE_TESTCASE (coordweight1, backend)
 
 DEFINE_TESTCASE (coordweight2, !backend)
 

Detailed Description

tests of Xapian::Weight subclasses

Definition in file api_weight.cc.

Function Documentation

◆ DEFINE_TESTCASE() [1/51]

DEFINE_TESTCASE ( tradweight3  ,
backend 
)

◆ DEFINE_TESTCASE() [2/51]

DEFINE_TESTCASE ( unigramlmweight3  ,
backend 
)

◆ DEFINE_TESTCASE() [3/51]

DEFINE_TESTCASE ( bm25weight3  ,
backend 
)

◆ DEFINE_TESTCASE() [4/51]

DEFINE_TESTCASE ( bm25weight4  ,
backend   
)

◆ DEFINE_TESTCASE() [5/51]

DEFINE_TESTCASE ( bm25weight5  ,
backend   
)

◆ DEFINE_TESTCASE() [6/51]

DEFINE_TESTCASE ( bm25plusweight1  ,
backend 
)

◆ DEFINE_TESTCASE() [7/51]

DEFINE_TESTCASE ( bm25plusweight2  ,
backend   
)

◆ DEFINE_TESTCASE() [8/51]

DEFINE_TESTCASE ( bm25plusweight3  ,
backend   
)

◆ DEFINE_TESTCASE() [9/51]

DEFINE_TESTCASE ( inl2weight1  ,
backend 
)

◆ DEFINE_TESTCASE() [10/51]

DEFINE_TESTCASE ( inl2weight2  ,
backend 
)

Definition at line 209 of file api_weight.cc.

References Xapian::InL2Weight::serialise(), TEST_EQUAL, and TEST_EXCEPTION.

◆ DEFINE_TESTCASE() [11/51]

DEFINE_TESTCASE ( inl2weight3  ,
backend   
)

◆ DEFINE_TESTCASE() [12/51]

DEFINE_TESTCASE ( ifb2weight1  ,
backend 
)

◆ DEFINE_TESTCASE() [13/51]

DEFINE_TESTCASE ( ifb2weight2  ,
backend 
)

Definition at line 269 of file api_weight.cc.

References Xapian::IfB2Weight::serialise(), TEST_EQUAL, and TEST_EXCEPTION.

◆ DEFINE_TESTCASE() [14/51]

DEFINE_TESTCASE ( ifb2weight3  ,
backend   
)

◆ DEFINE_TESTCASE() [15/51]

DEFINE_TESTCASE ( ineb2weight1  ,
backend 
)

◆ DEFINE_TESTCASE() [16/51]

DEFINE_TESTCASE ( ineb2weight2  ,
backend 
)

Definition at line 328 of file api_weight.cc.

References Xapian::IneB2Weight::serialise(), TEST_EQUAL, and TEST_EXCEPTION.

◆ DEFINE_TESTCASE() [17/51]

DEFINE_TESTCASE ( ineb2weight3  ,
backend   
)

◆ DEFINE_TESTCASE() [18/51]

DEFINE_TESTCASE ( bb2weight1  ,
backend 
)

◆ DEFINE_TESTCASE() [19/51]

DEFINE_TESTCASE ( bb2weight2  ,
backend 
)

Definition at line 390 of file api_weight.cc.

References Xapian::BB2Weight::serialise(), TEST_EQUAL, and TEST_EXCEPTION.

◆ DEFINE_TESTCASE() [20/51]

DEFINE_TESTCASE ( bb2weight3  ,
backend   
)

◆ DEFINE_TESTCASE() [21/51]

DEFINE_TESTCASE ( bb2weight4  ,
backend   
)

◆ DEFINE_TESTCASE() [22/51]

DEFINE_TESTCASE ( dlhweight1  ,
backend   
)

◆ DEFINE_TESTCASE() [23/51]

DEFINE_TESTCASE ( dlhweight2  ,
backend 
)

◆ DEFINE_TESTCASE() [24/51]

DEFINE_TESTCASE ( dlhweight3  ,
generated   
)

◆ DEFINE_TESTCASE() [25/51]

DEFINE_TESTCASE ( pl2weight1  ,
backend 
)

◆ DEFINE_TESTCASE() [26/51]

DEFINE_TESTCASE ( pl2weight2  ,
backend 
)

Definition at line 554 of file api_weight.cc.

References Xapian::PL2Weight::serialise(), TEST_EQUAL, and TEST_EXCEPTION.

◆ DEFINE_TESTCASE() [27/51]

DEFINE_TESTCASE ( pl2weight3  ,
backend   
)

◆ DEFINE_TESTCASE() [28/51]

DEFINE_TESTCASE ( pl2plusweight1  ,
backend 
)

◆ DEFINE_TESTCASE() [29/51]

DEFINE_TESTCASE ( pl2plusweight2  ,
backend 
)

Definition at line 611 of file api_weight.cc.

References TEST_EXCEPTION.

◆ DEFINE_TESTCASE() [30/51]

DEFINE_TESTCASE ( pl2plusweight3  ,
backend 
)

Definition at line 622 of file api_weight.cc.

References Xapian::PL2PlusWeight::serialise(), and TEST_EQUAL.

◆ DEFINE_TESTCASE() [31/51]

DEFINE_TESTCASE ( pl2plusweight4  ,
backend   
)

◆ DEFINE_TESTCASE() [32/51]

DEFINE_TESTCASE ( pl2plusweight5  ,
backend   
)

◆ DEFINE_TESTCASE() [33/51]

DEFINE_TESTCASE ( dphweight1  ,
backend   
)

◆ DEFINE_TESTCASE() [34/51]

DEFINE_TESTCASE ( dphweight2  ,
backend 
)

◆ DEFINE_TESTCASE() [35/51]

DEFINE_TESTCASE ( dphweight3  ,
generated   
)

◆ DEFINE_TESTCASE() [36/51]

DEFINE_TESTCASE ( tfidfweight1  ,
backend 
)

Definition at line 740 of file api_weight.cc.

References Xapian::TfIdfWeight::serialise(), TEST_EQUAL, and TEST_EXCEPTION.

◆ DEFINE_TESTCASE() [37/51]

DEFINE_TESTCASE ( tfidfweight2  ,
backend 
)

◆ DEFINE_TESTCASE() [38/51]

DEFINE_TESTCASE ( tfidfweight3  ,
backend   
)

◆ DEFINE_TESTCASE() [39/51]

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

Regression test - check init() is called for the term-indep Weight obj.

Definition at line 922 of file api_weight.cc.

References get_database(), Xapian::Enquire::get_mset(), Xapian::Query::OP_AND, Xapian::Enquire::set_query(), Xapian::Enquire::set_weighting_scheme(), and TEST_EQUAL.

◆ DEFINE_TESTCASE() [40/51]

DEFINE_TESTCASE ( checkstatsweight1  ,
backend &&!  remote 
)

◆ DEFINE_TESTCASE() [41/51]

DEFINE_TESTCASE ( checkstatsweight2  ,
backend &&!  remote 
)

◆ DEFINE_TESTCASE() [42/51]

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

◆ DEFINE_TESTCASE() [43/51]

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

◆ DEFINE_TESTCASE() [44/51]

DEFINE_TESTCASE ( unigramlmweight4  ,
backend   
)

◆ DEFINE_TESTCASE() [45/51]

DEFINE_TESTCASE ( unigramlmweight5  ,
backend   
)

◆ DEFINE_TESTCASE() [46/51]

DEFINE_TESTCASE ( unigramlmweight6  ,
backend 
)

◆ DEFINE_TESTCASE() [47/51]

DEFINE_TESTCASE ( unigramlmweight7  ,
backend   
)

◆ DEFINE_TESTCASE() [48/51]

DEFINE_TESTCASE ( unigramlmweight8  ,
backend   
)

◆ DEFINE_TESTCASE() [49/51]

DEFINE_TESTCASE ( boolweight1  ,
backend 
)

◆ DEFINE_TESTCASE() [50/51]

DEFINE_TESTCASE ( coordweight1  ,
backend   
)

◆ DEFINE_TESTCASE() [51/51]

DEFINE_TESTCASE ( coordweight2  ,
backend 
)

◆ gen_wdf_eq_doclen_db()

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