Update unit test.

This commit is contained in:
Nikolai Kochetov 2020-03-23 20:39:34 +03:00
parent 7582f6628c
commit 2e2272785a

View File

@ -314,7 +314,9 @@ TEST(WeakHash32, ColumnString_3)
WeakHash32 hash(col->size()); WeakHash32 hash(col->size());
col->updateWeakHash32(hash); 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, ColumnFixedString) TEST(WeakHash32, ColumnFixedString)
@ -402,7 +404,7 @@ TEST(WeakHash32, ColumnArray)
TEST(WeakHash32, ColumnArrayArray) TEST(WeakHash32, ColumnArrayArray)
{ {
size_t max_size = 3000; size_t max_size = 1000;
auto val = ColumnUInt32::create(); auto val = ColumnUInt32::create();
auto off = ColumnUInt64::create(); auto off = ColumnUInt64::create();
auto off2 = ColumnUInt64::create(); auto off2 = ColumnUInt64::create();
@ -426,7 +428,7 @@ TEST(WeakHash32, ColumnArrayArray)
for (int _i [[maybe_unused]] : {1, 2}) for (int _i [[maybe_unused]] : {1, 2})
{ {
UInt32 cur = 1; UInt32 cur = 1;
for (int64_t i = 0; i < 65536; ++i) for (int64_t i = 0; i < 1000; ++i)
{ {
eq_data.push_back(i); eq_data.push_back(i);
size_t s = (i % max_size) + 1; size_t s = (i % max_size) + 1;