edje_external: Update edje_external_param_type_str test
authorse.osadchy <se.osadchy@samsung.com>
Tue, 11 Apr 2017 14:35:13 +0000 (17:35 +0300)
committerse.osadchy <se.osadchy@samsung.com>
Tue, 11 Apr 2017 14:35:49 +0000 (17:35 +0300)
Change-Id: Ifed19b3d4a436a10af8fa20d020f1c87ae2c4393
Signed-off-by: Sergey Osadchy <se.osadchy@samsung.com>
TC/edje/edje_external/utc_edje_external_param_type_str.c

index 898db328e044ce3c43162a5bfb7e0e223dedabba..0e125af399a75c7eeac93908cf68280310e71a76 100644 (file)
@@ -42,8 +42,21 @@ teardown(void)
  * @n Input data:
  * @li Edje_External_Param_Type the identifier to convert.
  * @procedure
- * @step 1 Create a variable of type Edje_External_Param_Type and assign a valid value.
- * @step 2 Pass the variable to edje_external_param_type_str function
+ * @step 1 Create a variable of type Edje_External_Param_Type.
+ * @step 2 Pass the variable to edje_external_param_type_str function.
+ * @step 3 Compare result with EDJE_EXTERNAL_PARAM_TYPE_STRING.
+ * @step 4 Create a variable of type Edje_External_Param_Type.
+ * @step 5 Pass the variable to edje_external_param_type_str function.
+ * @step 6 Compare result with EDJE_EXTERNAL_PARAM_TYPE_BOOL.
+ * @step 7 Create a variable of type Edje_External_Param_Type.
+ * @step 8 Pass the variable to edje_external_param_type_str function.
+ * @step 9 Compare result with EDJE_EXTERNAL_PARAM_TYPE_INT.
+ * @step 10 Create a variable of type Edje_External_Param_Type.
+ * @step 11 Pass the variable to edje_external_param_type_str function.
+ * @step 12 Compare result with EDJE_EXTERNAL_PARAM_TYPE_CHOICE.
+ * @step 13 Create a variable of type Edje_External_Param_Type.
+ * @step 14 Pass the variable to edje_external_param_type_str function.
+ * @step 15 Compare result with EDJE_EXTERNAL_PARAM_TYPE_DOUBLE.
  *
  * @passcondition  :   Returns corresponding string.
  * @}
@@ -51,13 +64,46 @@ teardown(void)
 START_TEST(utc_edje_external_param_type_str_p)
 {
    const char *type_str = NULL;
-   Edje_External_Param_Type type = EDJE_EXTERNAL_PARAM_TYPE_INT;
+   const char *type_bool = NULL;
+   const char *type_int = NULL;
+   const char *type_choice = NULL;
+   const char *type_double = NULL;
+   Edje_External_Param_Type type;
 
+   type = EDJE_EXTERNAL_PARAM_TYPE_STRING;
    type_str = edje_external_param_type_str(type);
-   if (!type_str)
+   if (strcmp(type_str, "STRING"))
      {
         ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
      }
+
+   type = EDJE_EXTERNAL_PARAM_TYPE_BOOL;
+   type_bool = edje_external_param_type_str(type);
+   if (strcmp(type_bool, "BOOL"))
+     {
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
+     }
+
+   type = EDJE_EXTERNAL_PARAM_TYPE_INT;
+   type_int = edje_external_param_type_str(type);
+   if (strcmp(type_int, "INT"))
+     {
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
+     }
+
+   type = EDJE_EXTERNAL_PARAM_TYPE_CHOICE;
+   type_choice = edje_external_param_type_str(type);
+   if (strcmp(type_choice, "CHOICE"))
+     {
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
+     }
+
+  type = EDJE_EXTERNAL_PARAM_TYPE_DOUBLE;
+  type_double = edje_external_param_type_str(type);
+  if (strcmp(type_double, "DOUBLE"))
+     {
+       ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
+     }
    printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
 }
 END_TEST
@@ -78,7 +124,7 @@ START_TEST(utc_edje_external_param_type_str_n)
 {
    const char *type_str = NULL;
    type_str = edje_external_param_type_str(-1);
-   if (!type_str)
+   if (!type_str || strcmp(type_str, "(unknown)"))
      {
         ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
      }