xapian-core  1.4.27
Functions
perftest_randomidx.cc File Reference

performance tests involving a randomly generated index More...

#include <config.h>
#include "perftest/perftest_randomidx.h"
#include <cstdlib>
#include <string>
#include <xapian.h>
#include "backendmanager.h"
#include "perftest.h"
#include "str.h"
#include "testrunner.h"
#include "testsuite.h"
#include "testutils.h"
+ Include dependency graph for perftest_randomidx.cc:

Go to the source code of this file.

Functions

static unsigned int rand_int (unsigned int range)
 Generate a random integer from 0 to "range" - 1. More...
 
static unsigned int rand_int (unsigned int min, unsigned int max)
 Generate a random integer from min to max. More...
 
static double rand_01 ()
 Generate a random double in range 0.0 <= v < 1.0. More...
 
static string gen_word (unsigned int length, unsigned int char_range)
 Generate a "word", of the specified length. More...
 
 DEFINE_TESTCASE (randomidx1, writable &&!inmemory)
 

Detailed Description

performance tests involving a randomly generated index

Definition in file perftest_randomidx.cc.

Function Documentation

◆ DEFINE_TESTCASE()

DEFINE_TESTCASE ( randomidx1  ,
writable &&!  inmemory 
)

◆ gen_word()

static string gen_word ( unsigned int  length,
unsigned int  char_range 
)
static

Generate a "word", of the specified length.

Parameters
lengthThe length of the word to generate.
char_rangeThe range of characters to use in the word.

Definition at line 70 of file perftest_randomidx.cc.

References rand_int().

Referenced by DEFINE_TESTCASE().

◆ rand_01()

static double rand_01 ( )
static

Generate a random double in range 0.0 <= v < 1.0.

Definition at line 59 of file perftest_randomidx.cc.

Referenced by DEFINE_TESTCASE().

◆ rand_int() [1/2]

static unsigned int rand_int ( unsigned int  range)
static

Generate a random integer from 0 to "range" - 1.

Definition at line 43 of file perftest_randomidx.cc.

Referenced by DEFINE_TESTCASE(), and gen_word().

◆ rand_int() [2/2]

static unsigned int rand_int ( unsigned int  min,
unsigned int  max 
)
static

Generate a random integer from min to max.

Definition at line 51 of file perftest_randomidx.cc.