summaryrefslogtreecommitdiff
path: root/TC/testcase
diff options
context:
space:
mode:
authorSeunghun Lee <shiin.lee@samsung.com>2012-08-21 21:18:29 +0900
committerSeunghun Lee <shiin.lee@samsung.com>2012-08-21 21:18:29 +0900
commitd130edf25d890a3fd6585f5c7649f1be34413740 (patch)
tree2f38e0ecf684b5ebc4af247b7440335d75962a13 /TC/testcase
parentdcf72b8eb11ba639b3617674dc098cfc264c5ce5 (diff)
downloadefl-util-master.tar.gz
efl-util-master.tar.bz2
efl-util-master.zip
Migrating the source code to RSA from private.HEADsubmit/master/20120920.1510232.0_alphamaster2.0alpha
Diffstat (limited to 'TC/testcase')
-rwxr-xr-xTC/testcase/Makefile26
-rwxr-xr-xTC/testcase/tslist1
-rwxr-xr-xTC/testcase/utc_efl_util_set_notification_window_level.c367
3 files changed, 394 insertions, 0 deletions
diff --git a/TC/testcase/Makefile b/TC/testcase/Makefile
new file mode 100755
index 0000000..0d15f65
--- /dev/null
+++ b/TC/testcase/Makefile
@@ -0,0 +1,26 @@
+CC = gcc
+
+C_FILES = $(shell ls *.c)
+
+PKGS = capi-ui-efl-util elementary ecore-x ecore evas x11 dlog glib-2.0
+
+LDFLAGS += $(TET_ROOT)/lib/tet3/tcm_s.o
+LDFLAGS += -L$(TET_ROOT)/lib/tet3 -ltcm_s
+LDFLAGS += -L$(TET_ROOT)/lib/tet3 -lapi_s
+LDFLAGS += `pkg-config --libs $(PKGS)`
+
+CFLAGS += `pkg-config --cflags $(PKGS)`
+CFLAGS += -I.
+CFLAGS += -I$(TET_ROOT)/inc/tet3
+CFLAGS += -Wall
+
+#TARGETS = $(C_FILES:%.c=tc-%)
+TCS := $(shell ls -1 *.c | cut -d. -f1)
+
+all: $(TCS)
+
+%: %.c
+ $(CC) -o $@ $< $(CFLAGS) $(LDFLAGS)
+
+clean:
+ rm -f $(TCS)
diff --git a/TC/testcase/tslist b/TC/testcase/tslist
new file mode 100755
index 0000000..48142ea
--- /dev/null
+++ b/TC/testcase/tslist
@@ -0,0 +1 @@
+/testcase/utc_efl_util_set_notification_window_level
diff --git a/TC/testcase/utc_efl_util_set_notification_window_level.c b/TC/testcase/utc_efl_util_set_notification_window_level.c
new file mode 100755
index 0000000..0c9ab66
--- /dev/null
+++ b/TC/testcase/utc_efl_util_set_notification_window_level.c
@@ -0,0 +1,367 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <tet_api.h>
+#include <efl_util.h>
+#include <Elementary.h>
+#include <Ecore_X.h>
+
+#define API_SET_NOTIFICATION_WINDOW_LEVEL "efl_util_set_notification_window_level"
+#define API_GET_NOTIFICATION_WINDOW_LEVEL "efl_util_get_notification_window_level"
+
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_efl_util_set_notification_window_level_negative_1(void);
+static void utc_efl_util_set_notification_window_level_negative_2(void);
+static void utc_efl_util_set_notification_window_level_negative_3(void);
+
+static void utc_efl_util_get_notification_window_level_negative_1(void);
+static void utc_efl_util_get_notification_window_level_negative_2(void);
+
+static void utc_efl_util_set_notification_window_level_positive_1(void);
+static void utc_efl_util_set_notification_window_level_positive_2(void);
+
+static void utc_efl_util_get_notification_window_level_positive_1(void);
+static void utc_efl_util_get_notification_window_level_positive_2(void);
+
+
+struct tet_testlist tet_testlist[] = {
+ { utc_efl_util_set_notification_window_level_negative_1, 1 },
+ { utc_efl_util_set_notification_window_level_negative_2, 1 },
+ { utc_efl_util_set_notification_window_level_negative_3, 1 },
+ { utc_efl_util_get_notification_window_level_negative_1, 1 },
+ { utc_efl_util_get_notification_window_level_negative_2, 1 },
+ { utc_efl_util_set_notification_window_level_positive_1, 1 },
+ { utc_efl_util_set_notification_window_level_positive_2, 1 },
+ { utc_efl_util_get_notification_window_level_positive_1, 1 },
+ { utc_efl_util_get_notification_window_level_positive_2, 1 },
+ { NULL, 0 },
+};
+
+
+static void startup(void)
+{
+ /* start of TC */
+ elm_init(0, NULL);
+}
+
+
+static void cleanup(void)
+{
+ /* end of TC */
+ elm_shutdown();
+}
+
+
+static void win_del(void *data, Evas_Object *obj, void *event)
+{
+ elm_exit();
+}
+
+
+static Evas_Object* create_normal_win(const char *name)
+{
+ Evas_Object *eo;
+
+ eo = elm_win_add(NULL, name, ELM_WIN_BASIC);
+ if (eo)
+ {
+ elm_win_title_set(eo, name);
+ elm_win_borderless_set(eo, EINA_TRUE);
+ evas_object_smart_callback_add(eo, "delete,request",
+ win_del, NULL);
+ elm_win_indicator_state_set(eo, EINA_TRUE);
+ }
+
+ return eo;
+}
+
+
+static Evas_Object* create_notification_win(const char *name)
+{
+ Evas_Object *eo;
+
+ eo = elm_win_add(NULL, name, ELM_WIN_NOTIFICATION);
+ if (eo)
+ {
+ elm_win_title_set(eo, name);
+ elm_win_borderless_set(eo, EINA_TRUE);
+ evas_object_smart_callback_add(eo, "delete,request",
+ win_del, NULL);
+ elm_win_indicator_state_set(eo, EINA_TRUE);
+ }
+
+ return eo;
+}
+
+
+/**
+ * @brief Negative test case of efl_util_set_notification_window_level()
+ */
+static void utc_efl_util_set_notification_window_level_negative_1(void)
+{
+ int ret;
+
+ ret = efl_util_set_notification_window_level(NULL, EFL_UTIL_NOTIFICATION_LEVEL_2);
+
+ if (ret == EFL_UTIL_ERROR_INVALID_PARAMETER)
+ {
+ dts_pass(API_SET_NOTIFICATION_WINDOW_LEVEL, "passed");
+ }
+ else
+ {
+ dts_fail(API_SET_NOTIFICATION_WINDOW_LEVEL, "failed");
+ }
+}
+
+
+/**
+ * @brief Negative test case of efl_util_set_notification_window_level()
+ */
+static void utc_efl_util_set_notification_window_level_negative_2(void)
+{
+ Evas_Object *win;
+ int ret;
+
+ win = create_normal_win("Normal window");
+ if (!win)
+ {
+ dts_fail(API_SET_NOTIFICATION_WINDOW_LEVEL, "failed to create window");
+ }
+
+ ret = efl_util_set_notification_window_level(win, EFL_UTIL_NOTIFICATION_LEVEL_2);
+
+ if (ret == EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE)
+ {
+ dts_pass(API_SET_NOTIFICATION_WINDOW_LEVEL, "passed");
+ }
+ else
+ {
+ dts_fail(API_SET_NOTIFICATION_WINDOW_LEVEL, "failed");
+ }
+}
+
+
+/**
+ * @brief Negative test case of efl_util_set_notification_window_level()
+ */
+static void utc_efl_util_set_notification_window_level_negative_3(void)
+{
+ Evas_Object *win;
+ int ret;
+
+ win = create_notification_win("Notification Type Window");
+ if (!win)
+ {
+ dts_fail(API_SET_NOTIFICATION_WINDOW_LEVEL, "failed to create window");
+ }
+
+ ret = efl_util_set_notification_window_level(win, 100);
+
+ if (ret == EFL_UTIL_ERROR_INVALID_PARAMETER)
+ {
+ dts_pass(API_SET_NOTIFICATION_WINDOW_LEVEL, "passed");
+ }
+ else
+ {
+ dts_fail(API_SET_NOTIFICATION_WINDOW_LEVEL, "failed");
+ }
+}
+
+
+/**
+ * @brief Negative test case of efl_util_set_notification_window_level()
+ */
+static void utc_efl_util_get_notification_window_level_negative_1(void)
+{
+ int ret;
+ int level;
+
+ ret = efl_util_get_notification_window_level(NULL, &level);
+
+ if (ret == EFL_UTIL_ERROR_INVALID_PARAMETER)
+ {
+ dts_pass(API_GET_NOTIFICATION_WINDOW_LEVEL, "passed");
+ }
+ else
+ {
+ dts_fail(API_GET_NOTIFICATION_WINDOW_LEVEL, "failed");
+ }
+}
+
+
+/**
+ * @brief Negative test case of efl_util_set_notification_window_level()
+ */
+static void utc_efl_util_get_notification_window_level_negative_2(void)
+{
+ Evas_Object *win;
+ int ret;
+ int level;
+
+ win = create_normal_win("Normal Type Window");
+ if (!win)
+ {
+ dts_fail(API_GET_NOTIFICATION_WINDOW_LEVEL, "failed to create window");
+ }
+
+ ret = efl_util_get_notification_window_level(win, &level);
+
+ if (ret == EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE)
+ {
+ dts_pass(API_GET_NOTIFICATION_WINDOW_LEVEL, "passed");
+ }
+ else
+ {
+ dts_fail(API_GET_NOTIFICATION_WINDOW_LEVEL, "failed");
+ }
+}
+
+
+/**
+ * @brief Positive test case of efl_util_set_notification_window_level()
+ */
+static void utc_efl_util_set_notification_window_level_positive_1(void)
+{
+ Evas_Object *win;
+ int ret;
+
+ win = create_notification_win("Notification Type Window");
+ if (!win)
+ {
+ dts_fail(API_SET_NOTIFICATION_WINDOW_LEVEL, "failed to create window");
+ }
+
+ ret = efl_util_set_notification_window_level(win, EFL_UTIL_NOTIFICATION_LEVEL_1);
+
+ if (ret == EFL_UTIL_ERROR_NONE)
+ {
+ dts_pass(API_SET_NOTIFICATION_WINDOW_LEVEL, "passed");
+ }
+ else
+ {
+ dts_fail(API_SET_NOTIFICATION_WINDOW_LEVEL, "failed");
+ }
+}
+
+
+/**
+ * @brief Positive test case of efl_util_set_notification_window_level()
+ */
+static void utc_efl_util_set_notification_window_level_positive_2(void)
+{
+ Evas_Object *win;
+ int ret1, ret2;
+
+ win = create_notification_win("Notification Type Window");
+ if (!win)
+ {
+ dts_fail(API_SET_NOTIFICATION_WINDOW_LEVEL, "failed to create window");
+ }
+
+ ret1 = efl_util_set_notification_window_level(win, EFL_UTIL_NOTIFICATION_LEVEL_1);
+ ret2 = efl_util_set_notification_window_level(win, EFL_UTIL_NOTIFICATION_LEVEL_2);
+
+ if (ret2 == EFL_UTIL_ERROR_NONE)
+ {
+ dts_pass(API_SET_NOTIFICATION_WINDOW_LEVEL, "passed");
+ }
+ else
+ {
+ dts_fail(API_SET_NOTIFICATION_WINDOW_LEVEL, "failed");
+ }
+}
+
+
+/**
+ * @brief Positive test case of efl_util_set_notification_window_level()
+ */
+static void utc_efl_util_get_notification_window_level_positive_1(void)
+{
+ Evas_Object *win;
+ int ret;
+ int level;
+
+ win = create_notification_win("Notification Type Window");
+ if (!win)
+ {
+ dts_fail(API_GET_NOTIFICATION_WINDOW_LEVEL, "failed to create window");
+ }
+ efl_util_set_notification_window_level(win, EFL_UTIL_NOTIFICATION_LEVEL_1);
+
+ level = -1;
+ ret = efl_util_get_notification_window_level(win, &level);
+
+ if (ret == EFL_UTIL_ERROR_NONE)
+ {
+ if (level == EFL_UTIL_NOTIFICATION_LEVEL_1)
+ {
+ dts_pass(API_GET_NOTIFICATION_WINDOW_LEVEL, "passed");
+ }
+ else
+ {
+ dts_fail(API_GET_NOTIFICATION_WINDOW_LEVEL, "failed - level is wrong");
+ }
+ }
+ else
+ {
+ dts_fail(API_GET_NOTIFICATION_WINDOW_LEVEL, "failed - return value is wrong");
+ }
+}
+
+
+/**
+ * @brief Positive test case of efl_util_set_notification_window_level()
+ */
+static void utc_efl_util_get_notification_window_level_positive_2(void)
+{
+ Evas_Object *win;
+ int ret;
+ int level;
+
+ win = create_notification_win("Notification Type Window");
+ if (!win)
+ {
+ dts_fail(API_GET_NOTIFICATION_WINDOW_LEVEL, "failed to create window");
+ }
+ efl_util_set_notification_window_level(win, EFL_UTIL_NOTIFICATION_LEVEL_1);
+ efl_util_set_notification_window_level(win, EFL_UTIL_NOTIFICATION_LEVEL_2);
+
+ level = -1;
+ ret = efl_util_get_notification_window_level(win, &level);
+
+ if (ret == EFL_UTIL_ERROR_NONE)
+ {
+ if (level == EFL_UTIL_NOTIFICATION_LEVEL_2)
+ {
+ dts_pass(API_GET_NOTIFICATION_WINDOW_LEVEL, "passed");
+ }
+ else
+ {
+ dts_fail(API_GET_NOTIFICATION_WINDOW_LEVEL, "failed - level is wrong");
+ }
+ }
+ else
+ {
+ dts_fail(API_GET_NOTIFICATION_WINDOW_LEVEL, "failed - return value is wrong");
+ }
+}
+