BPHash
General object hashing library for C++
test_integers.cpp
Go to the documentation of this file.
1 /*! \file
2  * \brief Testing of integral types
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 
15  std::vector<HashValue> & all_hashes)
16 {
17  // create tests for complex values that are just combinations
18  // of the vector above
19  std::vector<std::complex<long>> cmplx_test;
20  for(auto i : int_test)
21  for(auto j : int_test)
22  cmplx_test.push_back({i,j});
23 
24  test_fundamental<signed char >(int_test, htype, all_hashes);
25  test_fundamental<signed short >(int_test, htype, all_hashes);
26  test_fundamental<signed int >(int_test, htype, all_hashes);
27  test_fundamental<signed long >(int_test, htype, all_hashes);
28  test_fundamental<signed long long >(int_test, htype, all_hashes);
29  test_fundamental<unsigned char >(int_test, htype, all_hashes);
30  test_fundamental<unsigned short >(int_test, htype, all_hashes);
31  test_fundamental<unsigned int >(int_test, htype, all_hashes);
32  test_fundamental<unsigned long >(int_test, htype, all_hashes);
33  test_fundamental<unsigned long long >(int_test, htype, all_hashes);
34 }
35 
Helper functions for testing.
void test_integers(HashType htype, std::vector< HashValue > &all_hashes)
HashType
Type of hash to use.
Definition: Hasher.hpp:25
static const std::vector< long > int_test