MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/OpenColorIO / getErrorMessageEqual

Function getErrorMessageEqual

tests/cpu/MathUtils_tests.cpp:482–494  ·  view source on GitHub ↗

Helper functions to validate if 1 or 2 floating-point values are EQUAL to a reference value, considering that denormalized values are being compressed or kept.

Source from the content-addressed store, hash-verified

480// compressed or kept.
481//
482std::string getErrorMessageEqual(const float a, const float b, const bool compressDenorms)
483{
484 std::ostringstream oss;
485 oss << "The values " << a << " "
486 << "(" << std::hex << std::showbase << OCIO::FloatAsInt(a) << std::dec << ") "
487 << "and " << b << " "
488 << "(" << std::hex << std::showbase << OCIO::FloatAsInt(b) << std::dec << ") "
489 << "are expected to be EQUAL "
490 << ( compressDenorms ? "(when compressing denormalized numbers)."
491 : "(when keeping denormalized numbers)." );
492
493 return oss.str();
494}
495
496void checkFloatsAreEqual(const float ref, const bool compressDenorms, const float a)
497{

Callers 1

checkFloatsAreEqualFunction · 0.85

Calls 1

FloatAsIntFunction · 0.85

Tested by

no test coverage detected