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.
| 480 | // compressed or kept. |
| 481 | // |
| 482 | std::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 | |
| 496 | void checkFloatsAreEqual(const float ref, const bool compressDenorms, const float a) |
| 497 | { |
no test coverage detected