Skip to content

Commit

Permalink
Added unit-tests for FixedStringType::GetSize() method to columns_u…
Browse files Browse the repository at this point in the history
…t.cpp
  • Loading branch information
german3w1 authored Jan 28, 2024
1 parent e854748 commit 677ade6
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions ut/columns_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,16 @@ TEST(ColumnsCase, FixedString_Append_LargeString) {
EXPECT_ANY_THROW(col->Append("this is a long string"));
}

TEST(ColumnsCase, FixedString_Type_Size_Eq0) {
const auto col = std::make_shared<ColumnFixedString>(0);
ASSERT_EQ(col->FixedSize(), col->Type()->As<FixedStringType>()->GetSize());
}

TEST(ColumnsCase, FixedString_Type_Size_Eq10) {
const auto col = std::make_shared<ColumnFixedString>(10);
ASSERT_EQ(col->FixedSize(), col->Type()->As<FixedStringType>()->GetSize());
}

TEST(ColumnsCase, StringInit) {
auto values = MakeStrings();
auto col = std::make_shared<ColumnString>(values);
Expand Down Expand Up @@ -866,6 +876,12 @@ TEST(ColumnsCase, ColumnLowCardinalityString_WithEmptyString_3) {
}
}

TEST(ColumnsCase, ColumnLowCardinalityFixedString_Type_Size_Eq) {
const auto fixed_size = 10;
const auto col = std::make_shared<ColumnLowCardinalityT<ColumnFixedString>>(fixed_size);

ASSERT_EQ(fixed_size, col->GetNestedType()->As<FixedStringType>()->GetSize());
}

TEST(ColumnsCase, ColumnTupleT) {
using TestTuple = ColumnTupleT<ColumnUInt64, ColumnString, ColumnFixedString>;
Expand Down

0 comments on commit 677ade6

Please sign in to comment.