MCPcopy Create free account
hub / github.com/OpenDDS/OpenDDS / key_hash_test

Function key_hash_test

tests/DCPS/KeyTest/KeyMarshalling.cpp:35–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33
34template<typename Type>
35void key_hash_test(const Type& value, SerializedSizeBound expected_bound = SerializedSizeBound())
36{
37 const SerializedSizeBound actual_bound =
38 MarshalTraits<Type>::key_only_serialized_size_bound(encoding);
39 std::cout << " bound = " << actual_bound.to_string() << std::endl;
40 if (actual_bound != expected_bound) {
41 ACE_ERROR((LM_ERROR, "ERROR: expected bound to be %C, but it is %C\n",
42 expected_bound.to_string().c_str(), actual_bound.to_string().c_str()));
43 TEST_CHECK(false);
44 }
45
46 OpenDDS::RTPS::KeyHash_t hash;
47 OpenDDS::RTPS::marshal_key_hash(value, hash);
48 print_hex(hash.value);
49}
50
51void run_test(const Encoding& encoding)
52{

Callers 1

run_testFunction · 0.85

Calls 5

SerializedSizeBoundFunction · 0.85
marshal_key_hashFunction · 0.85
print_hexFunction · 0.70
to_stringMethod · 0.45

Tested by

no test coverage detected