Fix UtcDaliToolkitTextLabelSetSpannedText 93/284093/1
authorssabah <s.sabah@samsung.com>
Wed, 9 Nov 2022 12:51:47 +0000 (15:51 +0300)
committerssabah <s.sabah@samsung.com>
Wed, 9 Nov 2022 12:51:47 +0000 (15:51 +0300)
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

automated-tests/src/dali-toolkit-internal/utc-Dali-Text-TextSpannable.cpp

index ebc4041..12d1613 100644 (file)
@@ -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;
 }