Fix decimal test. Overflow was not initialized.

Change-Id: Ib4e3a3ae12c39a15ba85a231a2d5d81d1fd0ff4e
Reviewed-on: http://gerrit.ent.cloudera.com:8080/2907
Reviewed-by: Nong Li <nong@cloudera.com>
Tested-by: jenkins
This commit is contained in:
Nong Li
2014-06-08 14:06:50 -07:00
committed by jenkins
parent 4f804f9a34
commit 6c779b9173

View File

@@ -64,7 +64,7 @@ void StringToAllDecimals(const string& s, const ColumnType& t, int32_t val,
TEST(IntToDecimal, Basic) {
Decimal16Value d16;
bool overflow;
bool overflow = false;
d16 = Decimal16Value::FromInt(ColumnType::CreateDecimalType(27, 18), -25559, &overflow);
EXPECT_FALSE(overflow);
@@ -430,7 +430,7 @@ TEST(DecimalTest, Overflow) {
// Add/Subtract/Mod cannot overflow the scale. With division, we always handle the case
// where the result scale needs to be adjusted.
TEST(DecimalTest, MultiplyScaleOverflow) {
bool overflow;
bool overflow = false;
Decimal16Value x(1);
Decimal16Value y(3);
ColumnType max_scale = ColumnType::CreateDecimalType(38, 38);
@@ -509,7 +509,7 @@ TEST(DecimalArithmetic, Basic) {
double d2_double = d2.ToDouble(t2);
double d3_double = d3.ToDouble(t2);
bool overflow;
bool overflow = false;
// TODO: what's the best way to author a bunch of tests like this?
VerifyFuzzyEquals(d1.Add<int64_t>(t1, d2, t2, t1_plus_2.scale, &overflow),
t1_plus_2, d1_double + d2_double, overflow);