DiSMEC++
hash_vector.cpp File Reference
#include "hash_vector.h"
#include <atomic>
#include "doctest.h"

Go to the source code of this file.

Namespaces

 anonymous_namespace{hash_vector.cpp}
 Local namespace in which we define the counter used to create the unique ids for the hash vector.
 

Functions

std::size_t anonymous_namespace{hash_vector.cpp}::get_next_id ()
 Get the next valid id. More...
 
 TEST_CASE ("HashVector content")
 
 TEST_CASE ("HashVector versioning")
 
 TEST_CASE ("HashVector uniqueness")
 
 TEST_CASE ("uninitialized VectorHash")
 

Function Documentation

◆ TEST_CASE() [1/4]

TEST_CASE ( "HashVector content"  )
Test:
This checks that construction and assignment result in the correct content in the vector.

Definition at line 57 of file hash_vector.cpp.

◆ TEST_CASE() [2/4]

TEST_CASE ( "HashVector uniqueness"  )
Test:
This checks that two different HashVector objects always have different hash.

Definition at line 94 of file hash_vector.cpp.

References dismec::HashVector::hash().

◆ TEST_CASE() [3/4]

TEST_CASE ( "HashVector versioning"  )
Test:
This checks that non-mutation operations leave the hash value as is, but mutation operations change the value.

Definition at line 73 of file hash_vector.cpp.

References dismec::HashVector::get(), and dismec::HashVector::hash().

◆ TEST_CASE() [4/4]

TEST_CASE ( "uninitialized VectorHash )
Test:
This checks that the uninitialized VectorHash compares unequal to the hash value of a vector.

Definition at line 104 of file hash_vector.cpp.

References dismec::HashVector::hash().