From: David Neto Date: Wed, 17 Feb 2016 17:39:41 +0000 (-0500) Subject: Remove remaining float overflow value tests X-Git-Tag: upstream/2018.6~1337 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2732f57ed236f671df64d595b33ea347777346cb;p=platform%2Fupstream%2FSPIRV-Tools.git Remove remaining float overflow value tests Should fix tests on Windows. --- diff --git a/test/TextToBinary.cpp b/test/TextToBinary.cpp index f3c1ee7..9f51867 100644 --- a/test/TextToBinary.cpp +++ b/test/TextToBinary.cpp @@ -24,7 +24,6 @@ // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE // MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. -#include #include #include #include @@ -457,13 +456,9 @@ TEST(AssemblyContextParseFloat, Overflow) { EXPECT_EQ(SPV_SUCCESS, context.parseNumber("-1e38", ec, &f, "")); EXPECT_EQ(-1e38f, f.value().getAsFloat()); EXPECT_EQ(SPV_FAILED_MATCH, context.parseNumber("1e40", ec, &f, "")); - EXPECT_EQ(FLT_MAX, f.value().getAsFloat()); EXPECT_EQ(SPV_FAILED_MATCH, context.parseNumber("-1e40", ec, &f, "")); - EXPECT_EQ(-FLT_MAX, f.value().getAsFloat()); EXPECT_EQ(SPV_FAILED_MATCH, context.parseNumber("1e400", ec, &f, "")); - EXPECT_EQ(FLT_MAX, f.value().getAsFloat()); EXPECT_EQ(SPV_FAILED_MATCH, context.parseNumber("-1e400", ec, &f, "")); - EXPECT_EQ(-FLT_MAX, f.value().getAsFloat()); } TEST(AssemblyContextParseDouble, Sample) { @@ -513,9 +508,7 @@ TEST(AssemblyContextParseDouble, Overflow) { EXPECT_EQ(SPV_SUCCESS, context.parseNumber("-1e40", ec, &f, "")); EXPECT_EQ(-1e40, f.value().getAsFloat()); EXPECT_EQ(SPV_FAILED_MATCH, context.parseNumber("1e400", ec, &f, "")); - EXPECT_EQ(DBL_MAX, f.value().getAsFloat()); EXPECT_EQ(SPV_FAILED_MATCH, context.parseNumber("-1e400", ec, &f, "")); - EXPECT_EQ(-DBL_MAX, f.value().getAsFloat()); } TEST(AssemblyContextParseFloat16, Overflow) { @@ -527,8 +520,6 @@ TEST(AssemblyContextParseFloat16, Overflow) { AssemblyContext context(AutoText(""), nullptr); const spv_result_t ec = SPV_FAILED_MATCH; spvutils::HexFloat> f(0.0f); - const uint32_t f16_max = uint32_t{0x7bff}; - const uint32_t f16_low = uint32_t{0xfbff}; EXPECT_EQ(SPV_SUCCESS, context.parseNumber("-0.0", ec, &f, "")); EXPECT_EQ(uint16_t{0x8000}, f.value().getAsFloat().get_value()); @@ -537,21 +528,15 @@ TEST(AssemblyContextParseFloat16, Overflow) { // Overflows 16-bit but not 32-bit EXPECT_EQ(ec, context.parseNumber("1e38", ec, &f, "")); - EXPECT_EQ(f16_max, f.value().getAsFloat().get_value()); EXPECT_EQ(ec, context.parseNumber("-1e38", ec, &f, "")); - EXPECT_EQ(f16_low, f.value().getAsFloat().get_value()); // Overflows 32-bit but not 64-bit EXPECT_EQ(ec, context.parseNumber("1e40", ec, &f, "")); - EXPECT_EQ(f16_max, f.value().getAsFloat().get_value()); EXPECT_EQ(ec, context.parseNumber("-1e40", ec, &f, "")); - EXPECT_EQ(f16_low, f.value().getAsFloat().get_value()); // Overflows 64-bit EXPECT_EQ(ec, context.parseNumber("1e400", ec, &f, "")); - EXPECT_EQ(f16_max, f.value().getAsFloat().get_value()); EXPECT_EQ(ec, context.parseNumber("-1e400", ec, &f, "")); - EXPECT_EQ(f16_low, f.value().getAsFloat().get_value()); } TEST(AssemblyContextParseMessages, Errors) {