Fix wrong order of linear enumeration 63/305563/3
authorEunki, Hong <eunkiki.hong@samsung.com>
Mon, 5 Feb 2024 04:48:16 +0000 (13:48 +0900)
committerEunki, Hong <eunkiki.hong@samsung.com>
Mon, 5 Feb 2024 05:16:32 +0000 (14:16 +0900)
Since Fitting mode have FIT_HEIGHT = 4 and FIT_WIDTH = 5, we need to follow up the order of enum

Change-Id: I63be4fdb114be28c20716fd3eaad01f061049f92
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
automated-tests/src/dali-toolkit/utc-Dali-ImageView.cpp
dali-toolkit/internal/visuals/visual-base-impl.cpp

index 60d1551..c92f4c3 100644 (file)
@@ -2220,6 +2220,10 @@ int UtcDaliImageViewFittingModesFitHeight01(void)
   DALI_TEST_CHECK(value);
   DALI_TEST_EQUALS(value->Get<Vector2>(), Vector2(0, 0), TEST_LOCATION); // OFFSET is zero
 
+  value = returnedMap.Find(DevelVisual::Property::VISUAL_FITTING_MODE);
+  DALI_TEST_CHECK(value);
+  DALI_TEST_EQUALS(value->Get<std::string>(), "FIT_HEIGHT", TEST_LOCATION); // OFFSET is zero
+
   END_TEST;
 }
 
@@ -2310,6 +2314,10 @@ int UtcDaliImageViewFittingModesFitWidth01(void)
   DALI_TEST_CHECK(value);
   DALI_TEST_EQUALS(value->Get<Vector2>(), Vector2(0, 50), TEST_LOCATION);
 
+  value = returnedMap.Find(DevelVisual::Property::VISUAL_FITTING_MODE);
+  DALI_TEST_CHECK(value);
+  DALI_TEST_EQUALS(value->Get<std::string>(), "FIT_WIDTH", TEST_LOCATION); // OFFSET is zero
+
   END_TEST;
 }
 
index 4710df4..3d8e79e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -62,8 +62,8 @@ DALI_ENUM_TO_STRING_TABLE_BEGIN(VISUAL_FITTING_MODE)
   DALI_ENUM_TO_STRING_WITH_SCOPE(Visual::FittingMode, FILL)
   DALI_ENUM_TO_STRING_WITH_SCOPE(Visual::FittingMode, OVER_FIT_KEEP_ASPECT_RATIO)
   DALI_ENUM_TO_STRING_WITH_SCOPE(Visual::FittingMode, CENTER)
-  DALI_ENUM_TO_STRING_WITH_SCOPE(Visual::FittingMode, FIT_WIDTH)
   DALI_ENUM_TO_STRING_WITH_SCOPE(Visual::FittingMode, FIT_HEIGHT)
+  DALI_ENUM_TO_STRING_WITH_SCOPE(Visual::FittingMode, FIT_WIDTH)
 DALI_ENUM_TO_STRING_TABLE_END(VISUAL_FITTING_MODE)
 
 /**
@@ -119,21 +119,21 @@ static bool IsTypeAvailableForBorderline(Toolkit::Visual::Type type)
 struct StringProperty
 {
   const char* const name;
-  Property::Index index;
+  Property::Index   index;
 };
-StringProperty PROPERTY_NAME_INDEX_TABLE[]=
-{
-  {CUSTOM_SHADER, Toolkit::Visual::Property::SHADER},
-  {TRANSFORM, Toolkit::Visual::Property::TRANSFORM},
-  {PREMULTIPLIED_ALPHA, Toolkit::Visual::Property::PREMULTIPLIED_ALPHA},
-  {MIX_COLOR, Toolkit::Visual::Property::MIX_COLOR},
-  {OPACITY, Toolkit::Visual::Property::OPACITY},
-  {VISUAL_FITTING_MODE, Toolkit::DevelVisual::Property::VISUAL_FITTING_MODE},
-  {BORDERLINE_WIDTH, Toolkit::DevelVisual::Property::BORDERLINE_WIDTH},
-  {BORDERLINE_COLOR, Toolkit::DevelVisual::Property::BORDERLINE_COLOR},
-  {BORDERLINE_OFFSET, Toolkit::DevelVisual::Property::BORDERLINE_OFFSET},
-  {CORNER_RADIUS, Toolkit::DevelVisual::Property::CORNER_RADIUS},
-  {CORNER_RADIUS_POLICY, Toolkit::DevelVisual::Property::CORNER_RADIUS_POLICY},
+StringProperty PROPERTY_NAME_INDEX_TABLE[] =
+  {
+    {CUSTOM_SHADER, Toolkit::Visual::Property::SHADER},
+    {TRANSFORM, Toolkit::Visual::Property::TRANSFORM},
+    {PREMULTIPLIED_ALPHA, Toolkit::Visual::Property::PREMULTIPLIED_ALPHA},
+    {MIX_COLOR, Toolkit::Visual::Property::MIX_COLOR},
+    {OPACITY, Toolkit::Visual::Property::OPACITY},
+    {VISUAL_FITTING_MODE, Toolkit::DevelVisual::Property::VISUAL_FITTING_MODE},
+    {BORDERLINE_WIDTH, Toolkit::DevelVisual::Property::BORDERLINE_WIDTH},
+    {BORDERLINE_COLOR, Toolkit::DevelVisual::Property::BORDERLINE_COLOR},
+    {BORDERLINE_OFFSET, Toolkit::DevelVisual::Property::BORDERLINE_OFFSET},
+    {CORNER_RADIUS, Toolkit::DevelVisual::Property::CORNER_RADIUS},
+    {CORNER_RADIUS_POLICY, Toolkit::DevelVisual::Property::CORNER_RADIUS_POLICY},
 };
 const uint16_t PROPERTY_NAME_INDEX_TABLE_COUNT = sizeof(PROPERTY_NAME_INDEX_TABLE) / sizeof(PROPERTY_NAME_INDEX_TABLE[0]);