From 0bd502f2a63429f36ed63eca2282b69d24d3da2a Mon Sep 17 00:00:00 2001 From: Nikolai Kochetov Date: Mon, 23 Mar 2020 20:42:26 +0300 Subject: [PATCH] Update unit test. --- dbms/src/Columns/tests/gtest_weak_hash_32.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/dbms/src/Columns/tests/gtest_weak_hash_32.cpp b/dbms/src/Columns/tests/gtest_weak_hash_32.cpp index 37cb3026637..511651bb1b0 100644 --- a/dbms/src/Columns/tests/gtest_weak_hash_32.cpp +++ b/dbms/src/Columns/tests/gtest_weak_hash_32.cpp @@ -276,7 +276,10 @@ TEST(WeakHash32, ColumnString_2) WeakHash32 hash(col->size()); col->updateWeakHash32(hash); - checkColumn(hash.getData(), data, [&](size_t row) { return col->getDataAt(row).toString(); }); + /// Now there is single collision between 'k' * 544 and 'q' * 2512 (which is calculated twice) + size_t allowed_collisions = 4; + + checkColumn(hash.getData(), data, [&](size_t row) { return col->getDataAt(row).toString(); }, allowed_collisions); } TEST(WeakHash32, ColumnString_3) @@ -314,9 +317,7 @@ TEST(WeakHash32, ColumnString_3) WeakHash32 hash(col->size()); col->updateWeakHash32(hash); - /// Now there is single collision between 'k' * 544 and 'q' * 2512 (which is calculated twice) - size_t allowed_collisions = 4; - checkColumn(hash.getData(), data, [&](size_t row) { return col->getDataAt(row).toString(); }, allowed_collisions); + checkColumn(hash.getData(), data, [&](size_t row) { return col->getDataAt(row).toString(); }); } TEST(WeakHash32, ColumnFixedString) @@ -404,7 +405,7 @@ TEST(WeakHash32, ColumnArray) TEST(WeakHash32, ColumnArrayArray) { - size_t max_size = 1000; + size_t max_size = 3000; auto val = ColumnUInt32::create(); auto off = ColumnUInt64::create(); auto off2 = ColumnUInt64::create(); @@ -428,7 +429,7 @@ TEST(WeakHash32, ColumnArrayArray) for (int _i [[maybe_unused]] : {1, 2}) { UInt32 cur = 1; - for (int64_t i = 0; i < 1000; ++i) + for (int64_t i = 0; i < 3000; ++i) { eq_data.push_back(i); size_t s = (i % max_size) + 1;