This is an automated email from the ASF dual-hosted git repository. kxiao pushed a commit to branch branch-2.0 in repository https://gitbox.apache.org/repos/asf/doris.git
commit 13fdeb99d50ad840ec4572d6644fdc0c1e5e3208 Author: Jerry Hu <[email protected]> AuthorDate: Mon Aug 28 14:02:05 2023 +0800 [fix](be-ut) fix ColumnFixedLenghtObjectTest on 32 bits system (#23519) --- be/test/vec/columns/column_fixed_length_object_test.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/be/test/vec/columns/column_fixed_length_object_test.cpp b/be/test/vec/columns/column_fixed_length_object_test.cpp index 1f4b2d6d7f..fd0a3687d6 100644 --- a/be/test/vec/columns/column_fixed_length_object_test.cpp +++ b/be/test/vec/columns/column_fixed_length_object_test.cpp @@ -57,18 +57,20 @@ TEST(ColumnFixedLenghtObjectTest, InsertRangeFrom) { } TEST(ColumnFixedLenghtObjectTest, UpdateHashWithValue) { - auto column1 = ColumnFixedLengthObject::create(sizeof(size_t)); - EXPECT_EQ(sizeof(size_t), column1->item_size()); + auto column1 = ColumnFixedLengthObject::create(sizeof(int64_t)); + EXPECT_EQ(sizeof(int64_t), column1->item_size()); const size_t count = 1000; column1->resize(count); auto& data = column1->get_data(); - for (size_t i = 0; i < count; ++i) { - *((size_t*)&data[i * sizeof(size_t)]) = i; + for (size_t i = 0; i != count; ++i) { + *((int64_t*)&data[i * column1->item_size()]) = i; } SipHash hash1; - column1->update_hash_with_value(count, hash1); + for (size_t i = 0; i != count; ++i) { + column1->update_hash_with_value(i, hash1); + } auto column2 = ColumnVector<int64_t>::create(); column2->resize(count); @@ -77,7 +79,9 @@ TEST(ColumnFixedLenghtObjectTest, UpdateHashWithValue) { } SipHash hash2; - column2->update_hash_with_value(count, hash2); + for (size_t i = 0; i != count; ++i) { + column2->update_hash_with_value(i, hash2); + } EXPECT_EQ(hash1.get64(), hash2.get64()); } --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
