diff --git a/test/language/expressions/cpp/LengthOfOperatorTest.cpp b/test/language/expressions/cpp/LengthOfOperatorTest.cpp index f32e094..76d603f 100644 --- a/test/language/expressions/cpp/LengthOfOperatorTest.cpp +++ b/test/language/expressions/cpp/LengthOfOperatorTest.cpp @@ -67,7 +67,7 @@ TEST(LengthOfOperatorTest, getLengthOfVariableArray) TEST(LengthOfOperatorTest, getLengthOfFirstStrInArray) { - auto strArray = VectorType{{StringType("€"), StringType("$")}}; + auto strArray = VectorType{"€", "$"}; LengthOfFunctions data; data.strArray = strArray; ASSERT_EQ(3, strArray.at(0).size()); // check that it's length in bytes (UTF-8) @@ -76,7 +76,7 @@ TEST(LengthOfOperatorTest, getLengthOfFirstStrInArray) TEST(LengthOfOperatorTest, getLengthOfFirstBytesInArray) { - auto bytesArray = VectorType{{{{0x00, 0x01}}, {{}}}}; + auto bytesArray = VectorType{{0x00, 0x01}, {}}; LengthOfFunctions data; data.bytesArray = bytesArray; ASSERT_EQ(bytesArray.at(0).size(), zserio::View(data).getLengthOfFirstBytesInArray()); @@ -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(); - data.bytesArray = VectorType(); + data.strArray = VectorType{"text1", "text2", "text3", "text4"}; + data.bytesArray = VectorType{{0x01, 0x02}, {0x03, 0x04}}; test_utils::writeReadTest(data); }