Skip to content

Commit 4dd948b

Browse files
committed
Minor fixes: extra test case + remove excessive return.
1 parent b350409 commit 4dd948b

File tree

5 files changed

+15
-3
lines changed

5 files changed

+15
-3
lines changed

clickhouse/columns/decimal.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ Int128 ColumnDecimal::At(size_t i) const {
9191
return data_->As<ColumnInt128>()->At(i);
9292
default:
9393
throw std::runtime_error("Invalid data_ column type in ColumnDecimal");
94-
return 0;
9594
}
9695
}
9796

clickhouse/columns/numeric.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ ColumnVector<T>::ColumnVector(const std::vector<T> & data)
1919
template <typename T>
2020
ColumnVector<T>::ColumnVector(std::vector<T> && data)
2121
: Column(Type::CreateSimple<T>())
22-
, data_(data)
22+
, data_(std::move(data))
2323
{
2424
}
2525

ut/client_ut.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -767,10 +767,11 @@ TEST_P(ClientCase, DateTime64) {
767767
return;
768768
}
769769

770+
const auto offset = total_rows - block.GetRowCount();
770771
ASSERT_EQ(1U, block.GetColumnCount());
771772
if (auto col = block[0]->As<ColumnDateTime64>()) {
772773
for (size_t i = 0; i < col->Size(); ++i) {
773-
EXPECT_EQ(data[i], col->At(i)) << " at index: " << i;
774+
EXPECT_EQ(data[offset + i], col->At(i)) << " at index: " << i;
774775
}
775776
}
776777
}

ut/columns_ut.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,7 @@ TEST(ColumnsCase, DateTime64_Slice_OUTOFBAND) {
304304

305305
EXPECT_EQ(column->Slice(0, data.size() + 1)->Size(), data.size());
306306
EXPECT_EQ(column->Slice(data.size() + 1, 1)->Size(), 0u);
307+
EXPECT_EQ(column->Slice(data.size() / 2, data.size() / 2 + 2)->Size(), data.size() - data.size() / 2);
307308
}
308309

309310
TEST(ColumnsCase, DateTime64_Swap_EXCEPTION) {

ut/performance_tests.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,16 @@ class ColumnPerformanceTest : public ::testing::Test {
8080

8181
TYPED_TEST_CASE_P(ColumnPerformanceTest);
8282

83+
// Turns out this is the easiest way to skip test with current version of gtest
84+
#ifndef NDEBUG
85+
# define SKIP_IN_DEBUG_BUILDS() do { std::cerr << "Test skipped...\n"; return; } while(0)
86+
#else
87+
# define SKIP_IN_DEBUG_BUILDS() (void)(0)
88+
#endif
89+
8390
TYPED_TEST_P(ColumnPerformanceTest, SaveAndLoad) {
91+
SKIP_IN_DEBUG_BUILDS();
92+
8493
auto column = InstantiateColumn<TypeParam>();
8594
using Timer = Timer<std::chrono::microseconds>;
8695

@@ -155,6 +164,8 @@ TYPED_TEST_P(ColumnPerformanceTest, SaveAndLoad) {
155164
}
156165

157166
TYPED_TEST_P(ColumnPerformanceTest, InsertAndSelect) {
167+
SKIP_IN_DEBUG_BUILDS();
168+
158169
using ColumnType = TypeParam;
159170
using Timer = Timer<std::chrono::microseconds>;
160171

0 commit comments

Comments
 (0)