tests/perftest/perftest_randomidx.cc File Reference

#include <config.h>
#include "perftest/perftest_randomidx.h"
#include <cstdlib>
#include <string>
#include <xapian.h>
#include "backendmanager.h"
#include "perftest.h"
#include "testrunner.h"
#include "testsuite.h"
#include "testutils.h"
#include "str.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.
static unsigned int rand_int (unsigned int min, unsigned int max)
 Generate a random integer from min to max.
static double rand_01 ()
 Generate a random double in range 0.0 <= v < 1.0.
static string gen_word (unsigned int length, unsigned int char_range)
 Generate a "word", of the specified length.
 DEFINE_TESTCASE (randomidx1, writable &&!inmemory)


Function Documentation

DEFINE_TESTCASE ( randomidx1  ,
writable &&!  inmemory 
)

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

Generate a "word", of the specified length.

Parameters:
length The length of the word to generate.
char_range The range of characters to use in the word.

Definition at line 71 of file perftest_randomidx.cc.

References rand_int().

Referenced by DEFINE_TESTCASE().

static double rand_01 (  )  [static]

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

Definition at line 60 of file perftest_randomidx.cc.

Referenced by DEFINE_TESTCASE().

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

Generate a random integer from min to max.

Definition at line 50 of file perftest_randomidx.cc.

static unsigned int rand_int ( unsigned int  range  )  [static]

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

Definition at line 42 of file perftest_randomidx.cc.

Referenced by DEFINE_TESTCASE(), and gen_word().


Documentation for Xapian (version 1.2.13).
Generated on 9 Jan 2013 by Doxygen 1.5.9.