You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@quickstep.apache.org by ha...@apache.org on 2016/09/23 20:55:17 UTC

incubator-quickstep git commit: Check the tuples are added.

Repository: incubator-quickstep
Updated Branches:
  refs/heads/regression c6a0cb25c -> 3bfa8122c


Check the tuples are added.


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

Branch: refs/heads/regression
Commit: 3bfa8122c1938eddb113076be6a4570736f81b02
Parents: c6a0cb2
Author: Hakan Memisoglu <ha...@gmail.com>
Authored: Fri Sep 23 15:29:55 2016 -0500
Committer: Hakan Memisoglu <ha...@gmail.com>
Committed: Fri Sep 23 15:29:55 2016 -0500

----------------------------------------------------------------------
 storage/tests/SplitRowStoreRegression.cpp | 28 +++++++++++++++++++++-----
 1 file changed, 23 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/3bfa8122/storage/tests/SplitRowStoreRegression.cpp
----------------------------------------------------------------------
diff --git a/storage/tests/SplitRowStoreRegression.cpp b/storage/tests/SplitRowStoreRegression.cpp
index 2fbe9c3..9f0f491 100644
--- a/storage/tests/SplitRowStoreRegression.cpp
+++ b/storage/tests/SplitRowStoreRegression.cpp
@@ -1,4 +1,5 @@
 #include <cstddef>
+#include <cstdint>
 #include <memory>
 
 #include "catalog/CatalogAttribute.hpp"
@@ -29,9 +30,19 @@ class SplitRowStoreRegression : public ::testing::TestWithParam<std::size_t> {
       ASSERT_EQ(i, relation_->addAttribute(double_attr));
     }
 
-    tuple_store_description_.reset();
-    tuple_store_.reset();
-    tuple_store_memory_.reset();
+    tuple_store_description_.reset(new TupleStorageSubBlockDescription());
+    tuple_store_description_->set_sub_block_type(TupleStorageSubBlockDescription::SPLIT_ROW_STORE);
+
+
+    tuple_store_memory_.reset(kSubBlockSize);
+    std::memset(tuple_store_memory_.get(), 0x0, kSubBlockSize);
+
+    tuple_store_.reset(new SplitRowStoreTupleStorageSubBlock(*relation_,
+                                                             *tuple_store_description_,
+                                                             true,
+                                                             tuple_store_memory_.get(),
+                                                             kSubBlockSize));
+
   }
 
   std::unique_ptr<CatalogRelation> relation_;
@@ -41,8 +52,15 @@ class SplitRowStoreRegression : public ::testing::TestWithParam<std::size_t> {
 };
 
 TEST_P(SplitRowStoreRegression, StrideAccess) {
-  std::size_t param = GetParam();
-  ASSERT_LT(param, 10);
+  std::size_t bytes_for_value = sizeof(double);
+  std::size_t step = GetParam();
+  std::size_t bytes_for_step = sizeof(double) * step;
+  ASSERT_NE(tuple_store_->numTuples(), 0);
+  double sum = 0;
+
+  for (std::size_t i = 0; i < 1; i += bytes_for_step) {
+    sum += i + bytes_for_value;
+  }
 }
 
 INSTANTIATE_TEST_CASE_P(SplitRowStoreRegressionStrideTest,