Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mikir committed Dec 13, 2024
1 parent 37c4ee9 commit 0aacd3d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/language/expressions/cpp/LengthOfOperatorTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ TEST(LengthOfOperatorTest, getLengthOfVariableArray)

TEST(LengthOfOperatorTest, getLengthOfFirstStrInArray)
{
auto strArray = VectorType<StringType>{{StringType(""), StringType("$")}};
auto strArray = VectorType<StringType>{"", "$"};
LengthOfFunctions data;
data.strArray = strArray;
ASSERT_EQ(3, strArray.at(0).size()); // check that it's length in bytes (UTF-8)
Expand All @@ -76,7 +76,7 @@ TEST(LengthOfOperatorTest, getLengthOfFirstStrInArray)

TEST(LengthOfOperatorTest, getLengthOfFirstBytesInArray)
{
auto bytesArray = VectorType<BytesType>{{{{0x00, 0x01}}, {{}}}};
auto bytesArray = VectorType<BytesType>{{0x00, 0x01}, {}};
LengthOfFunctions data;
data.bytesArray = bytesArray;
ASSERT_EQ(bytesArray.at(0).size(), zserio::View(data).getLengthOfFirstBytesInArray());
Expand All @@ -92,13 +92,13 @@ TEST(LengthOfOperatorTest, literalLengthFieldDefault)
TEST(LengthOfOperatorTest, writeRead)
{
LengthOfFunctions data;
data.fixedArray = VectorType<::zserio::UInt8>{{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09}};
data.fixedArray = VectorType<::zserio::UInt8>{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09};
data.numElements = 3;
data.variableArray = VectorType<::zserio::UInt8>{{0x03, 0x02, 0x01}};
data.variableArray = VectorType<::zserio::UInt8>{0x03, 0x02, 0x01};
data.strField = "longer than constant";
data.bytesField = BytesType{{0x00, 0x01, 0x02}};
data.strArray = VectorType<StringType>();
data.bytesArray = VectorType<BytesType>();
data.strArray = VectorType<StringType>{"text1", "text2", "text3", "text4"};
data.bytesArray = VectorType<BytesType>{{0x01, 0x02}, {0x03, 0x04}};

test_utils::writeReadTest(data);
}
Expand Down

0 comments on commit 0aacd3d

Please sign in to comment.