Skip to content

Commit

Permalink
ci
Browse files Browse the repository at this point in the history
  • Loading branch information
JinheLin committed Dec 27, 2024
1 parent 1a7da3f commit 423fc5b
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions dbms/src/TiDB/tests/gtest_row_v2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,14 @@ TEST(RowV2Suite, FloatValue)
ASSERT_FLOAT_VALUE(std::numeric_limits<Float64>::max());
}

#define ASSERT_STRING_VALUE_LENGTH(b, s) ASSERT_EQ(getValueLengthByRowV2<b>(s), std::make_tuple(s, (s).length()))

TEST(RowV2Suite, StringValueLength)
{
auto assert_string_value_length = [](bool b, String s) {
ASSERT_EQ(getValueLengthByRowV2<b>(s), std::make_tuple(s, s.length()));
};
assert_string_value_length(false, String(""));
assert_string_value_length(false, String("aaa"));
assert_string_value_length(false, String(std::numeric_limits<UInt16>::max(), 'a'));
assert_string_value_length(true, String(std::numeric_limits<UInt16>::max() + 1, 'a'));
ASSERT_STRING_VALUE_LENGTH(false, String(""));
ASSERT_STRING_VALUE_LENGTH(false, String("aaa"));
ASSERT_STRING_VALUE_LENGTH(false, String(std::numeric_limits<UInt16>::max(), 'a'));
ASSERT_STRING_VALUE_LENGTH(true, String(std::numeric_limits<UInt16>::max() + 1, 'a'));
}

#define ASSERT_DECIMAL_VALUE(d) ASSERT_EQ(std::get<0>(getValueLengthByRowV2<false>(d)), d)
Expand Down

0 comments on commit 423fc5b

Please sign in to comment.