Fix testcase failure by explicit typecasting and avoiding macro usage

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

Branch: refs/heads/lip-refactor
Commit: e4de24178d085464af648d5914891ec548f09853
Parents: e845246
Author: Saket Saurabh <ssaur...@cs.wisc.edu>
Authored: Mon Oct 3 01:21:30 2016 -0500
Committer: Saket Saurabh <ssaur...@cs.wisc.edu>
Committed: Tue Oct 11 11:36:57 2016 -0500

----------------------------------------------------------------------
 ...kedRowStoreTupleStorageSubBlock_unittest.cpp | 38 ++++++++++----------
 1 file changed, 18 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/e4de2417/storage/tests/PackedRowStoreTupleStorageSubBlock_unittest.cpp
----------------------------------------------------------------------
diff --git a/storage/tests/PackedRowStoreTupleStorageSubBlock_unittest.cpp 
b/storage/tests/PackedRowStoreTupleStorageSubBlock_unittest.cpp
index 924f9b1..bf3c605 100644
--- a/storage/tests/PackedRowStoreTupleStorageSubBlock_unittest.cpp
+++ b/storage/tests/PackedRowStoreTupleStorageSubBlock_unittest.cpp
@@ -256,29 +256,27 @@ class PackedRowStoreTupleStorageSubBlockTest : public 
::testing::TestWithParam<b
     initializeNewBlock(kSubBlockSize);
     fillBlockWithSampleData();
     ASSERT_TRUE(tuple_store_->isPacked());
-    std::unique_ptr<ValueAccessor> 
accessor(tuple_store_->createValueAccessor());
+    std::unique_ptr<PackedRowStoreValueAccessor> accessor(
+      
static_cast<PackedRowStoreValueAccessor*>(tuple_store_->createValueAccessor()));
     attribute_id  value_accessor_id = 0;
     tuple_id tid = 0;
-    InvokeOnAnyValueAccessor(accessor.get(),
-                             [&](auto *accessor) -> void {  // 
NOLINT(build/c++11)
-      accessor->beginIteration();
-      ASSERT_TRUE(accessor->isColumnAccessorSupported());
-      std::unique_ptr<const ColumnAccessor<check_null>>
-      column_accessor(accessor->template 
getColumnAccessor<check_null>(value_accessor_id));
-      ASSERT_TRUE(column_accessor != nullptr);
-      while (accessor->next()) {
-        const void *va_value = column_accessor->getUntypedValue();
-        std::unique_ptr<Tuple> expected_tuple(createSampleTuple(tid));
-
-        if (expected_tuple->getAttributeValue(value_accessor_id).isNull()) {
-          ASSERT_TRUE(va_value == nullptr);
-        } else {
-          
ASSERT_TRUE(eq_comp_int_->compareDataPtrs(expected_tuple->getAttributeValue(value_accessor_id).getDataPtr(),
-                                                    va_value));
-        }
-        ++tid;
+    accessor->beginIteration();
+    ASSERT_TRUE(accessor->isColumnAccessorSupported());
+    std::unique_ptr<const ColumnAccessor<check_null>>
+    column_accessor(accessor->template 
getColumnAccessor<check_null>(value_accessor_id));
+    ASSERT_TRUE(column_accessor != nullptr);
+    while (accessor->next()) {
+      const void *va_value = column_accessor->getUntypedValue();
+      std::unique_ptr<Tuple> expected_tuple(createSampleTuple(tid));
+
+      if (expected_tuple->getAttributeValue(value_accessor_id).isNull()) {
+        ASSERT_TRUE(va_value == nullptr);
+      } else {
+        
ASSERT_TRUE(eq_comp_int_->compareDataPtrs(expected_tuple->getAttributeValue(value_accessor_id).getDataPtr(),
+                                                  va_value));
       }
-    });
+      ++tid;
+    }
   }
 
   std::unique_ptr<CatalogRelation> relation_;

Reply via email to