BPHash
General object hashing library for C++
Macros | Functions | Variables
test_helpers.hpp File Reference

Helper functions for testing. More...

#include "bphash/Hasher.hpp"
#include "bphash/types/All.hpp"
#include <iostream>
Include dependency graph for test_helpers.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define HANDLE_TEST_ARRAY(N)
 

Functions

template<typename T >
void test_single (const T &val, bphash::HashType htype, std::vector< bphash::HashValue > &all_hashes)
 
template<typename To , typename From >
void test_values (const std::vector< From > &vals, bphash::HashType htype, std::vector< bphash::HashValue > &all_hashes)
 
template<typename To , typename From >
void test_pointers (const std::vector< From > &vals, bphash::HashType htype, std::vector< bphash::HashValue > &all_hashes)
 
template<typename To , typename From , size_t N>
void test_array_helper (const std::vector< From > &vec, bphash::HashType htype, std::vector< bphash::HashValue > &all_hashes)
 
template<typename To , typename From >
void test_arrays (const std::vector< From > &values, bphash::HashType htype, std::vector< bphash::HashValue > &all_hashes)
 
template<typename To , typename From >
void test_containers (const std::vector< From > &values, bphash::HashType htype, std::vector< bphash::HashValue > &all_hashes)
 
template<typename To , typename From >
void test_fundamental (const std::vector< From > &values, bphash::HashType htype, std::vector< bphash::HashValue > &all_hashes)
 
template<typename To1 , typename To2 , typename From1 , typename From2 >
void test_tuples_2 (const std::vector< From1 > &values1, const std::vector< From2 > &values2, bphash::HashType htype, std::vector< bphash::HashValue > &all_hashes)
 

Variables

static const std::vector< long > int_test
 
static const std::vector< double > dbl_test
 
static std::vector< const char * > str_test
 

Detailed Description

Helper functions for testing.

Definition in file test_helpers.hpp.

Macro Definition Documentation

#define HANDLE_TEST_ARRAY (   N)
Value:
case N: \
test_array_helper<To, From, N>(values, htype, all_hashes); \
break;

Definition at line 129 of file test_helpers.hpp.

Function Documentation

template<typename To , typename From , size_t N>
void test_array_helper ( const std::vector< From > &  vec,
bphash::HashType  htype,
std::vector< bphash::HashValue > &  all_hashes 
)

Definition at line 109 of file test_helpers.hpp.

Here is the call graph for this function:

template<typename To , typename From >
void test_arrays ( const std::vector< From > &  values,
bphash::HashType  htype,
std::vector< bphash::HashValue > &  all_hashes 
)

Definition at line 135 of file test_helpers.hpp.

template<typename To , typename From >
void test_containers ( const std::vector< From > &  values,
bphash::HashType  htype,
std::vector< bphash::HashValue > &  all_hashes 
)

Definition at line 174 of file test_helpers.hpp.

Here is the call graph for this function:

template<typename To , typename From >
void test_fundamental ( const std::vector< From > &  values,
bphash::HashType  htype,
std::vector< bphash::HashValue > &  all_hashes 
)

Definition at line 198 of file test_helpers.hpp.

template<typename To , typename From >
void test_pointers ( const std::vector< From > &  vals,
bphash::HashType  htype,
std::vector< bphash::HashValue > &  all_hashes 
)

Definition at line 78 of file test_helpers.hpp.

Here is the call graph for this function:

template<typename T >
void test_single ( const T &  val,
bphash::HashType  htype,
std::vector< bphash::HashValue > &  all_hashes 
)

Definition at line 46 of file test_helpers.hpp.

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename To1 , typename To2 , typename From1 , typename From2 >
void test_tuples_2 ( const std::vector< From1 > &  values1,
const std::vector< From2 > &  values2,
bphash::HashType  htype,
std::vector< bphash::HashValue > &  all_hashes 
)

Definition at line 212 of file test_helpers.hpp.

Here is the call graph for this function:

template<typename To , typename From >
void test_values ( const std::vector< From > &  vals,
bphash::HashType  htype,
std::vector< bphash::HashValue > &  all_hashes 
)

Definition at line 68 of file test_helpers.hpp.

Here is the call graph for this function:

Variable Documentation

const std::vector<double> dbl_test
static
Initial value:
{ 0, 1.0, 1.000001, 1.12e12, 1.12001e12, 1.12001e-12
-1.0, -1.000001, -1.12e12, -1.12001e12, -1.12001e-12}

Definition at line 29 of file test_helpers.hpp.

const std::vector<long> int_test
static
Initial value:
{ 0, 1, 10, 100, 241,
-1, -10, -100, -241}

Definition at line 25 of file test_helpers.hpp.

std::vector<const char *> str_test
static
Initial value:
{"",
" ",
"\n",
"String1",
"String 1",
"string1",
"string 1",
"STRING1",
" String1",
"String1!",
"String1!\n"}

Definition at line 33 of file test_helpers.hpp.