| 64 | // Decodes a hex-float string. |
| 65 | template <typename T> |
| 66 | FloatProxy<T> Decode(const std::string& str) { |
| 67 | spvutils::HexFloat<FloatProxy<T>> decoded(0.f); |
| 68 | EXPECT_TRUE((std::stringstream(str) >> decoded).eof()); |
| 69 | return decoded.value(); |
| 70 | } |
| 71 | |
| 72 | TEST_P(HexFloatTest, DecodeCorrectly) { |
| 73 | EXPECT_THAT(Decode<float>(GetParam().second), Eq(GetParam().first)); |