BPHash
General object hashing library for C++
test_tuple.cpp
Go to the documentation of this file.
1 /*! \file
2  * \brief Testing of tuple and pair
3  */
4 
5 /* Copyright (c) 2016 Benjamin Pritchard <ben@bennyp.org>
6  * This file is part of the BPHash project, which is released
7  * under the BSD 3-clause license. See the LICENSE file for details
8  */
9 
10 #include "test_helpers.hpp"
11 
12 using namespace bphash;
13 
14 void test_tuple(HashType htype,
15  std::vector<HashValue> & all_hashes)
16 {
17  test_tuples_2<int, int >(int_test, int_test, htype, all_hashes);
18  test_tuples_2<int, long >(int_test, int_test, htype, all_hashes);
19  test_tuples_2<unsigned short, unsigned long>(int_test, int_test, htype, all_hashes);
20 
21  test_tuples_2<const char *, const char *>(str_test, str_test, htype, all_hashes);
22  test_tuples_2<std::string, const char *>(str_test, str_test, htype, all_hashes);
23  test_tuples_2<const char *, std::string >(str_test, str_test, htype, all_hashes);
24  test_tuples_2<std::string, std::string >(str_test, str_test, htype, all_hashes);
25 
26  test_tuples_2<int, const char * >(int_test, str_test, htype, all_hashes);
27  test_tuples_2<int, std::string >(int_test, str_test, htype, all_hashes);
28  test_tuples_2<unsigned short, std::string>(int_test, str_test, htype, all_hashes);
29 
30  test_tuples_2<const char *, int >(str_test, int_test, htype, all_hashes);
31  test_tuples_2<std::string, int >(str_test, int_test, htype, all_hashes);
32  test_tuples_2<std::string, unsigned short>(str_test, int_test, htype, all_hashes);
33 }
34 
Helper functions for testing.
void test_tuple(HashType htype, std::vector< HashValue > &all_hashes)
Definition: test_tuple.cpp:14
HashType
Type of hash to use.
Definition: Hasher.hpp:25
static const std::vector< long > int_test
static std::vector< const char * > str_test