From 66c78e025c883dec0373e4febd0fc7917be31c53 Mon Sep 17 00:00:00 2001 From: ssabah Date: Wed, 9 Nov 2022 15:51:47 +0300 Subject: [PATCH] Fix UtcDaliToolkitTextLabelSetSpannedText We cannot guarantee the order of adding the attached colors for runs Fixed TC to check logic of Set Spanned Text only Used one color instead of two colors Change-Id: Ie88b778f223be75d15add0db2410161c09d183bd --- .../src/dali-toolkit-internal/utc-Dali-Text-TextSpannable.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-TextSpannable.cpp b/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-TextSpannable.cpp index ebc4041..12d1613 100644 --- a/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-TextSpannable.cpp +++ b/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-TextSpannable.cpp @@ -41,11 +41,6 @@ Text::SpannableString CreateSpannableStringForForegroundColorSpan() Text::Range::New(5u, 7u)); DALI_TEST_CHECK(isAddedGreen); - auto isAddedBlue = spannableString.AttachSpan( - Text::ForegroundColorSpan::New(Color::BLUE), - Text::Range::New(1u, 2u)); - DALI_TEST_CHECK(isAddedBlue); - return spannableString; } @@ -81,7 +76,7 @@ int UtcDaliToolkitTextLabelSetSpannedText(void) Toolkit::Internal::TextLabel& labelImpl = GetImpl(textLabel); const Text::ColorIndex* const colorIndicesBuffer = labelImpl.GetTextController()->GetTextModel()->GetColorIndices(); - CheckColorIndices(colorIndicesBuffer, 6u, {0u, 1u, 2u, 5u, 7u, 10u}, {0u, 2u, 2u, 1u, 1u, 0u}); + CheckColorIndices(colorIndicesBuffer, 4u, {0u, 5u, 7u, 10u}, {0u, 1u, 1u, 0u}); END_TEST; } @@ -105,7 +100,7 @@ int UtcDaliToolkitTextEditorSetSpannedText(void) Toolkit::Internal::TextEditor& labelImpl = GetImpl(textEditor); const Text::ColorIndex* const colorIndicesBuffer = labelImpl.GetTextController()->GetTextModel()->GetColorIndices(); - CheckColorIndices(colorIndicesBuffer, 6u, {0u, 1u, 2u, 5u, 7u, 10u}, {0u, 2u, 2u, 1u, 1u, 0u}); + CheckColorIndices(colorIndicesBuffer, 4u, {0u, 5u, 7u, 10u}, {0u, 1u, 1u, 0u}); END_TEST; } @@ -129,7 +124,7 @@ int UtcDaliToolkitTextFieldSetSpannedText(void) Toolkit::Internal::TextField& labelImpl = GetImpl(textField); const Text::ColorIndex* const colorIndicesBuffer = labelImpl.GetTextController()->GetTextModel()->GetColorIndices(); - CheckColorIndices(colorIndicesBuffer, 6u, {0u, 1u, 2u, 5u, 7u, 10u}, {0u, 2u, 2u, 1u, 1u, 0u}); + CheckColorIndices(colorIndicesBuffer, 4u, {0u, 5u, 7u, 10u}, {0u, 1u, 1u, 0u}); END_TEST; } -- 2.7.4