quickstep-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hakanmemiso...@apache.org
Subject incubator-quickstep git commit: Use constructor instead of builder in unit test.
Date Thu, 23 Jun 2016 19:52:10 GMT
Repository: incubator-quickstep
Updated Branches:
  refs/heads/decimal-type 0a3e43f29 -> 21e912c93


Use constructor instead of builder in unit test.


Project: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/commit/21e912c9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/tree/21e912c9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/diff/21e912c9

Branch: refs/heads/decimal-type
Commit: 21e912c931aa110d3289b7a40e8d8a4ea6499751
Parents: 0a3e43f
Author: Hakan Memisoglu <hakanmemisoglu@apache.org>
Authored: Thu Jun 23 14:51:51 2016 -0500
Committer: Hakan Memisoglu <hakanmemisoglu@apache.org>
Committed: Thu Jun 23 14:51:51 2016 -0500

----------------------------------------------------------------------
 types/tests/DecimalType_unittest.cpp | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/21e912c9/types/tests/DecimalType_unittest.cpp
----------------------------------------------------------------------
diff --git a/types/tests/DecimalType_unittest.cpp b/types/tests/DecimalType_unittest.cpp
index 78a79ab..e0e76af 100644
--- a/types/tests/DecimalType_unittest.cpp
+++ b/types/tests/DecimalType_unittest.cpp
@@ -31,26 +31,26 @@ TEST(DecimalTypeTest, PrintValueTest) {
   const Type &decimal_type = TypeFactory::GetType(kDecimal);
 
   // Try integer version.
-  DecimalLit integer_decimal = DecimalLit::fromInt(36509);
+  DecimalLit integer_decimal = DecimalLit(36509);
   TypedValue value_for_integer_decimal(integer_decimal);
   EXPECT_EQ(std::string("36509.00"),
             decimal_type.printValueToString(value_for_integer_decimal));
 
   // Try double version.
-  DecimalLit double_decimal = DecimalLit::fromDouble(36509.65);
+  DecimalLit double_decimal = DecimalLit(36509.65);
   TypedValue value_for_double_decimal(double_decimal);
   EXPECT_EQ(std::string("36509.65"),
             decimal_type.printValueToString(value_for_double_decimal));
 
   // Try truncation of double version.
-  DecimalLit double_decimal_truncated = DecimalLit::fromDouble(36509.6526762);
+  DecimalLit double_decimal_truncated = DecimalLit(36509.6526762);
   TypedValue value_for_double_decimal_truncated(double_decimal_truncated);
   EXPECT_EQ(std::string("36509.65"),
             decimal_type.printValueToString(
                 value_for_double_decimal_truncated));
 
   // Test that number is truncated, not rounded.
-  double_decimal_truncated = DecimalLit::fromDouble(36509.6599999);
+  double_decimal_truncated = DecimalLit(36509.6599999);
   TypedValue value_for_double_decimal_truncated_other(double_decimal_truncated);
   EXPECT_EQ(std::string("36509.65"),
             decimal_type.printValueToString(
@@ -60,8 +60,8 @@ TEST(DecimalTypeTest, PrintValueTest) {
 TEST(DecimalTypeTest, DecimalLitOperationsTest) {
   const Type &decimal_type = TypeFactory::GetType(kDecimal);
 
-  DecimalLit decimal_a = DecimalLit::fromDouble(560.35);
-  DecimalLit decimal_b = DecimalLit::fromDouble(439.65);
+  DecimalLit decimal_a(560.35);
+  DecimalLit decimal_b(439.65);
 
   EXPECT_EQ(std::string("1000.00"),
             decimal_type.printValueToString(TypedValue(decimal_a + decimal_b)));


Mime
View raw message