A Discrete-Event Network Simulator
API
+ Collaboration diagram for Hash test suite:

Files

file  hash-test-suite.cc
 Hash test suite.
 

Classes

class  ns3::tests::DefaultHashTestCase
 Test default hash on fixed string. More...
 
class  ns3::tests::Fnv1aTestCase
 FNV hash on fixed string. More...
 
class  ns3::tests::Hash32FunctionPtrTestCase
 Test 32-bit function pointer. More...
 
class  ns3::tests::Hash64FunctionPtrTestCase
 Test 64-bit function pointer. More...
 
class  ns3::tests::HashTestCase
 Base class for hash tests. More...
 
class  ns3::tests::HashTestSuite
 Hash functions test suite. More...
 
class  ns3::tests::IncrementalTestCase
 Test incremental hashing. More...
 
class  ns3::tests::Murmur3TestCase
 Test Murmur3 hash on fixed string. More...
 

Functions

uint16_t ns3::tests::gnu_sum (const char *buffer, const std::size_t size)
 Simple hash function based on the GNU sum program. More...
 
uint32_t ns3::tests::gnu_sum32 (const char *buffer, const std::size_t size)
 A 32-bit hash function, based on gnu_sum(). More...
 
uint64_t ns3::tests::gnu_sum64 (const char *buffer, const std::size_t size)
 A 64-bit hash function, base on gnu_sum(). More...
 

Variables

static HashTestSuite ns3::tests::g_hashTestSuite
 HashTestSuite instance variable. More...
 

Detailed Description

Function Documentation

◆ gnu_sum()

uint16_t ns3::tests::gnu_sum ( const char *  buffer,
const std::size_t  size 
)

Simple hash function based on the GNU sum program.

16-bit checksum algorithm. See http://svnweb.freebsd.org/base/stable/9/usr.bin/cksum/sum1.c?view=markup

Used to test Hash32Function_ptr/Hash64Function_ptr

Parameters
[in,out]bufferThe data to hash.
[in]sizeThe buffer size.
Returns
The checksum of the buffer contents.

Definition at line 271 of file hash-test-suite.cc.

Referenced by ns3::tests::gnu_sum32().

+ Here is the caller graph for this function:

◆ gnu_sum32()

uint32_t ns3::tests::gnu_sum32 ( const char *  buffer,
const std::size_t  size 
)

A 32-bit hash function, based on gnu_sum().

16-bit checksum algorithm. See http://svnweb.freebsd.org/base/stable/9/usr.bin/cksum/sum1.c?view=markup

Used to test Hash32Function_ptr/Hash64Function_ptr

Parameters
[in,out]bufferThe data to hash.
[in]sizeThe buffer size.
Returns
The checksum of the buffer contents.

Definition at line 292 of file hash-test-suite.cc.

References ns3::tests::gnu_sum().

Referenced by ns3::tests::Hash32FunctionPtrTestCase::DoRun(), and ns3::tests::gnu_sum64().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gnu_sum64()

uint64_t ns3::tests::gnu_sum64 ( const char *  buffer,
const std::size_t  size 
)

A 64-bit hash function, base on gnu_sum().

16-bit checksum algorithm. See http://svnweb.freebsd.org/base/stable/9/usr.bin/cksum/sum1.c?view=markup

Used to test Hash32Function_ptr/Hash64Function_ptr

Parameters
[in,out]bufferThe data to hash.
[in]sizeThe buffer size.
Returns
The checksum of the buffer contents.

Definition at line 304 of file hash-test-suite.cc.

References ns3::tests::gnu_sum32().

Referenced by ns3::tests::Hash64FunctionPtrTestCase::DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ g_hashTestSuite

HashTestSuite ns3::tests::g_hashTestSuite
static

HashTestSuite instance variable.

Definition at line 466 of file hash-test-suite.cc.