| 14167 | // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. |
| 14168 | template <typename RawType> |
| 14169 | AssertionResult CmpHelperFloatingPointEQ(const char* lhs_expression, |
| 14170 | const char* rhs_expression, |
| 14171 | RawType lhs_value, |
| 14172 | RawType rhs_value) { |
| 14173 | const FloatingPoint<RawType> lhs(lhs_value), rhs(rhs_value); |
| 14174 | |
| 14175 | if (lhs.AlmostEquals(rhs)) { |
| 14176 | return AssertionSuccess(); |
| 14177 | } |
| 14178 | |
| 14179 | ::std::stringstream lhs_ss; |
| 14180 | lhs_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2) |
| 14181 | << lhs_value; |
| 14182 | |
| 14183 | ::std::stringstream rhs_ss; |
| 14184 | rhs_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2) |
| 14185 | << rhs_value; |
| 14186 | |
| 14187 | return EqFailure(lhs_expression, |
| 14188 | rhs_expression, |
| 14189 | StringStreamToString(&lhs_ss), |
| 14190 | StringStreamToString(&rhs_ss), |
| 14191 | false); |
| 14192 | } |
| 14193 | |
| 14194 | // Helper function for implementing ASSERT_NEAR. |
| 14195 | // |
nothing calls this directly
no test coverage detected