MCPcopy Create free account
hub / github.com/apache/impala / TEST

Function TEST

be/src/runtime/decimal-test.cc:102–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

100}
101
102TEST(DecimalTest, IntToDecimal) {
103 Decimal16Value d16;
104 bool overflow = false;
105
106 d16 = Decimal16Value::FromInt(27, 18, -25559, &overflow);
107 EXPECT_FALSE(overflow);
108 VerifyToString(d16, 27, 18, "-25559.000000000000000000");
109
110 d16 = Decimal16Value::FromInt(36, 29, 32130, &overflow);
111 EXPECT_FALSE(overflow);
112 VerifyToString(d16, 36, 29, "32130.00000000000000000000000000000");
113
114 d16 = Decimal16Value::FromInt(38, 38, 1, &overflow);
115 EXPECT_TRUE(overflow);
116
117 // Smaller decimal types can't overflow here since the FE should never generate
118 // that.
119}
120
121TEST(DecimalTest, DoubleToDecimal) {
122 Decimal4Value d4;

Callers

nothing calls this directly

Calls 14

VerifyToStringFunction · 0.85
StringToAllDecimalsFunction · 0.85
VerifyParseFunction · 0.85
PrintValueFunction · 0.85
GetResultTypeFunction · 0.85
VerifyFuzzyEqualsFunction · 0.85
timeFunction · 0.85
minFunction · 0.85
DoubleCompareFunction · 0.85
valueMethod · 0.45
strMethod · 0.45
ToDoubleMethod · 0.45

Tested by

no test coverage detected