summaryrefslogtreecommitdiff
path: root/TC
diff options
context:
space:
mode:
authorJinkun Jang <jinkun.jang@samsung.com>2013-03-13 01:46:29 +0900
committerJinkun Jang <jinkun.jang@samsung.com>2013-03-13 01:46:29 +0900
commit3d00818bdd3f9a27fea80dbad85f54bb6af27384 (patch)
treebf34cb9b15f5b1006eb705a717e95cfdbe94cf02 /TC
parent09a91ebbf08ff9675054268269a53777a2c065ac (diff)
downloadapp-core-3d00818bdd3f9a27fea80dbad85f54bb6af27384.tar.gz
app-core-3d00818bdd3f9a27fea80dbad85f54bb6af27384.tar.bz2
app-core-3d00818bdd3f9a27fea80dbad85f54bb6af27384.zip
Tizen 2.1 base
Diffstat (limited to 'TC')
-rwxr-xr-xTC/build.sh20
-rwxr-xr-xTC/execute.sh20
-rw-r--r--TC/tet_code12
-rw-r--r--TC/tet_scen7
-rw-r--r--TC/tetbuild.cfg3
-rw-r--r--TC/tetclean.cfg2
-rw-r--r--TC/tetexec.cfg1
-rw-r--r--TC/unit/Makefile33
-rwxr-xr-xTC/unit/tc_gen.sh28
-rw-r--r--TC/unit/tslist11
-rw-r--r--TC/unit/utc_ApplicationFW_appcore_efl_main_func.c132
-rw-r--r--TC/unit/utc_ApplicationFW_appcore_exit_func.c58
-rw-r--r--TC/unit/utc_ApplicationFW_appcore_get_rotation_state_func.c83
-rw-r--r--TC/unit/utc_ApplicationFW_appcore_init_func.c131
-rw-r--r--TC/unit/utc_ApplicationFW_appcore_measure_start_func.c58
-rw-r--r--TC/unit/utc_ApplicationFW_appcore_measure_time_from_func.c87
-rw-r--r--TC/unit/utc_ApplicationFW_appcore_measure_time_func.c66
-rw-r--r--TC/unit/utc_ApplicationFW_appcore_set_event_callback_func.c97
-rw-r--r--TC/unit/utc_ApplicationFW_appcore_set_i18n_func.c83
-rw-r--r--TC/unit/utc_ApplicationFW_appcore_set_rotation_cb_func.c88
-rw-r--r--TC/unit/utc_ApplicationFW_appcore_unset_rotation_cb_func.c65
-rw-r--r--TC/unit/utc_MODULE_API_func.c.in76
22 files changed, 1161 insertions, 0 deletions
diff --git a/TC/build.sh b/TC/build.sh
new file mode 100755
index 0000000..98ebeff
--- /dev/null
+++ b/TC/build.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+export TET_INSTALL_PATH=/scratchbox/tetware # local tetware path
+export TET_TARGET_PATH=$TET_INSTALL_PATH/tetware-target
+export PATH=$TET_TARGET_PATH/bin:$PATH
+export LD_LIBRARY_PATH=$TET_TARGET_PATH/lib/tet3:$LD_LIBRARY_PATH
+export TET_ROOT=$TET_TARGET_PATH
+
+export TET_SUITE_ROOT=`pwd`
+FILE_NAME_EXTENSION=`date +%s`
+
+RESULT_DIR=results
+HTML_RESULT=$RESULT_DIR/build-tar-result-$FILE_NAME_EXTENSION.html
+JOURNAL_RESULT=$RESULT_DIR/build-tar-result-$FILE_NAME_EXTENSION.journal
+
+mkdir -p $RESULT_DIR
+
+tcc -c -p ./
+tcc -b -j $JOURNAL_RESULT -p ./
+grw -c 3 -f chtml -o $HTML_RESULT $JOURNAL_RESULT
diff --git a/TC/execute.sh b/TC/execute.sh
new file mode 100755
index 0000000..2d9df79
--- /dev/null
+++ b/TC/execute.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+#export TET_INSTALL_PATH=/mnt/nfs/tetware
+export TET_INSTALL_PATH=/scratchbox/tetware
+export TET_TARGET_PATH=$TET_INSTALL_PATH/tetware-target
+export PATH=$TET_TARGET_PATH/bin:$PATH
+export LD_LIBRARY_PATH=$TET_TARGET_PATH/lib/tet3:$LD_LIBRARY_PATH
+
+export TET_ROOT=$TET_TARGET_PATH
+
+export TET_SUITE_ROOT=`pwd`
+FILE_NAME_EXTENSION=`date +%s`
+
+RESULT_DIR=results
+HTML_RESULT=$RESULT_DIR/exec-tar-result-$FILE_NAME_EXTENSION.html
+JOURNAL_RESULT=$RESULT_DIR/exec-tar-result-$FILE_NAME_EXTENSION.journal
+
+mkdir -p $RESULT_DIR
+
+tcc -e -j $JOURNAL_RESULT -p ./
+grw -c 3 -f chtml -o $HTML_RESULT $JOURNAL_RESULT
diff --git a/TC/tet_code b/TC/tet_code
new file mode 100644
index 0000000..a2cf6c1
--- /dev/null
+++ b/TC/tet_code
@@ -0,0 +1,12 @@
+# TET reserved codes
+0 "PASS"
+1 "FAIL"
+2 "UNRESOLVED"
+3 "NOTINUSE"
+4 "UNSUPPORTED"
+5 "UNTESTED"
+6 "UNINITIATED"
+7 "NORESULT"
+
+# Test suite additional codes
+33 "INSPECT"
diff --git a/TC/tet_scen b/TC/tet_scen
new file mode 100644
index 0000000..43cbc9b
--- /dev/null
+++ b/TC/tet_scen
@@ -0,0 +1,7 @@
+all
+ ^TEST
+##### Scenarios for TEST #####
+
+# Test scenario
+TEST
+ :include:/unit/tslist
diff --git a/TC/tetbuild.cfg b/TC/tetbuild.cfg
new file mode 100644
index 0000000..6192c78
--- /dev/null
+++ b/TC/tetbuild.cfg
@@ -0,0 +1,3 @@
+TET_OUTPUT_CAPTURE=False
+TET_BUILD_TOOL=make
+TET_PASS_TC_NAME=True
diff --git a/TC/tetclean.cfg b/TC/tetclean.cfg
new file mode 100644
index 0000000..c66eda4
--- /dev/null
+++ b/TC/tetclean.cfg
@@ -0,0 +1,2 @@
+TET_OUTPUT_CAPTURE=False
+TET_CLEAN_TOOL=make clean
diff --git a/TC/tetexec.cfg b/TC/tetexec.cfg
new file mode 100644
index 0000000..0d9d39a
--- /dev/null
+++ b/TC/tetexec.cfg
@@ -0,0 +1 @@
+TET_OUTPUT_CAPTURE=False
diff --git a/TC/unit/Makefile b/TC/unit/Makefile
new file mode 100644
index 0000000..f967994
--- /dev/null
+++ b/TC/unit/Makefile
@@ -0,0 +1,33 @@
+CC ?= gcc
+
+TARGETS = \
+ utc_ApplicationFW_appcore_efl_main_func \
+ utc_ApplicationFW_appcore_init_func \
+ utc_ApplicationFW_appcore_exit_func \
+ utc_ApplicationFW_appcore_set_rotation_cb_func \
+ utc_ApplicationFW_appcore_unset_rotation_cb_func \
+ utc_ApplicationFW_appcore_get_rotation_state_func \
+ utc_ApplicationFW_appcore_set_i18n_func \
+ utc_ApplicationFW_appcore_measure_start_func \
+ utc_ApplicationFW_appcore_measure_time_func \
+ utc_ApplicationFW_appcore_measure_time_from_func \
+ utc_ApplicationFW_appcore_set_event_callback_func
+
+PKGS = appcore-efl
+
+LDFLAGS = `pkg-config --libs $(PKGS)`
+LDFLAGS += $(TET_ROOT)/lib/tet3/tcm_s.o
+LDFLAGS += -L$(TET_ROOT)/lib/tet3 -ltcm_s
+LDFLAGS += -L$(TET_ROOT)/lib/tet3 -lapi_s
+
+CFLAGS = -I. `pkg-config --cflags $(PKGS)`
+CFLAGS += -I$(TET_ROOT)/inc/tet3
+CFLAGS += -Wall
+
+all: $(TARGETS)
+
+$(TARGETS): %: %.c
+ $(CC) -o $@ $< $(CFLAGS) $(LDFLAGS)
+
+clean:
+ rm -f $(TARGETS)
diff --git a/TC/unit/tc_gen.sh b/TC/unit/tc_gen.sh
new file mode 100755
index 0000000..54f482d
--- /dev/null
+++ b/TC/unit/tc_gen.sh
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+TMPSTR=$0
+SCRIPT=${TMPSTR##*/}
+
+if [ $# -lt 2 ]; then
+ echo "Usage) $SCRIPT module_name api_name"
+ exit 1
+fi
+
+MODULE=$1
+API=$2
+TEMPLATE=utc_MODULE_API_func.c.in
+TESTCASE=utc_${MODULE}_${API}_func
+
+sed -e '
+ s^@API@^'"$API"'^g
+ s^@MODULE@^'"$MODULE"'^g
+ ' $TEMPLATE > $TESTCASE.c
+
+if [ ! -e "$TESTCASE.c" ]; then
+ echo "Failed"
+ exit 1
+fi
+echo "Testcase file is $TESTCASE.c"
+echo "Done"
+echo "please put \"$TESTCASE\" as Target in Makefile"
+echo "please put \"/unit/$TESTCASE\" in tslist"
diff --git a/TC/unit/tslist b/TC/unit/tslist
new file mode 100644
index 0000000..91c8d1a
--- /dev/null
+++ b/TC/unit/tslist
@@ -0,0 +1,11 @@
+/unit/utc_ApplicationFW_appcore_efl_main_func
+/unit/utc_ApplicationFW_appcore_init_func
+/unit/utc_ApplicationFW_appcore_exit_func
+/unit/utc_ApplicationFW_appcore_set_rotation_cb_func
+/unit/utc_ApplicationFW_appcore_unset_rotation_cb_func
+/unit/utc_ApplicationFW_appcore_get_rotation_state_func
+/unit/utc_ApplicationFW_appcore_set_i18n_func
+/unit/utc_ApplicationFW_appcore_measure_start_func
+/unit/utc_ApplicationFW_appcore_measure_time_func
+/unit/utc_ApplicationFW_appcore_measure_time_from_func
+/unit/utc_ApplicationFW_appcore_set_event_callback_func
diff --git a/TC/unit/utc_ApplicationFW_appcore_efl_main_func.c b/TC/unit/utc_ApplicationFW_appcore_efl_main_func.c
new file mode 100644
index 0000000..eacd09e
--- /dev/null
+++ b/TC/unit/utc_ApplicationFW_appcore_efl_main_func.c
@@ -0,0 +1,132 @@
+/*
+ * app-core
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>, Jaeho Lee <jaeho81.lee@samsung.com>
+ *
+ * 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 <Elementary.h>
+#include <appcore-efl.h>
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_ApplicationFW_appcore_efl_main_func_01(void);
+static void utc_ApplicationFW_appcore_efl_main_func_02(void);
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+struct tet_testlist tet_testlist[] = {
+ { utc_ApplicationFW_appcore_efl_main_func_01, POSITIVE_TC_IDX },
+ { utc_ApplicationFW_appcore_efl_main_func_02, NEGATIVE_TC_IDX },
+ { NULL, 0},
+};
+
+static void startup(void)
+{
+}
+
+static void cleanup(void)
+{
+}
+
+static int app_reset(bundle *b, void *data)
+{
+ elm_exit();
+ return 0;
+}
+
+/**
+ * @brief Positive test case of appcore_efl_main()
+ */
+static void utc_ApplicationFW_appcore_efl_main_func_01(void)
+{
+ int r = 0;
+ int argc = 1;
+ char *_argv[] = {
+ "Testcase",
+ NULL,
+ };
+ char **argv;
+ struct appcore_ops ops = {
+ .reset = app_reset,
+ };
+
+ argv = _argv;
+ r = appcore_efl_main("Testcase", &argc, &argv, &ops);
+ printf("Return %d\n", r);
+ if (r) {
+ tet_infoline("appcore_efl_main() failed in positive test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
+
+/**
+ * @brief Negative test case of ug_init appcore_efl_main()
+ */
+static void utc_ApplicationFW_appcore_efl_main_func_02(void)
+{
+ int r = 0;
+ int argc = 1;
+ char *_argv[] = {
+ "Testcase",
+ NULL,
+ };
+ char **argv;
+ struct appcore_ops ops = {
+ .reset = app_reset,
+ };
+
+ argv = _argv;
+ r = appcore_efl_main("Testcase", &argc, &argv, NULL);
+ if (!r) {
+ tet_infoline("appcore_efl_main() failed in negative test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+
+ r = appcore_efl_main(NULL, &argc, &argv, &ops);
+ if (!r) {
+ tet_infoline("appcore_efl_main() failed in negative test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+
+ r = appcore_efl_main("Testcase", NULL, &argv, &ops);
+ if (!r) {
+ tet_infoline("appcore_efl_main() failed in negative test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+
+ r = appcore_efl_main("Testcase", &argc, NULL, &ops);
+ if (!r) {
+ tet_infoline("appcore_efl_main() failed in negative test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+
+ tet_result(TET_PASS);
+}
diff --git a/TC/unit/utc_ApplicationFW_appcore_exit_func.c b/TC/unit/utc_ApplicationFW_appcore_exit_func.c
new file mode 100644
index 0000000..b74e9a6
--- /dev/null
+++ b/TC/unit/utc_ApplicationFW_appcore_exit_func.c
@@ -0,0 +1,58 @@
+/*
+ * app-core
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>, Jaeho Lee <jaeho81.lee@samsung.com>
+ *
+ * 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 <appcore-common.h>
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_ApplicationFW_appcore_exit_func_01(void);
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+struct tet_testlist tet_testlist[] = {
+ { utc_ApplicationFW_appcore_exit_func_01, POSITIVE_TC_IDX },
+ { NULL, 0},
+};
+
+static void startup(void)
+{
+}
+
+static void cleanup(void)
+{
+}
+
+/**
+ * @brief Positive test case of appcore_exit()
+ */
+static void utc_ApplicationFW_appcore_exit_func_01(void)
+{
+ appcore_exit();
+ tet_result(TET_PASS);
+}
+
diff --git a/TC/unit/utc_ApplicationFW_appcore_get_rotation_state_func.c b/TC/unit/utc_ApplicationFW_appcore_get_rotation_state_func.c
new file mode 100644
index 0000000..45c0226
--- /dev/null
+++ b/TC/unit/utc_ApplicationFW_appcore_get_rotation_state_func.c
@@ -0,0 +1,83 @@
+/*
+ * app-core
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>, Jaeho Lee <jaeho81.lee@samsung.com>
+ *
+ * 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 <appcore-common.h>
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_ApplicationFW_appcore_get_rotation_state_func_01(void);
+static void utc_ApplicationFW_appcore_get_rotation_state_func_02(void);
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+struct tet_testlist tet_testlist[] = {
+ { utc_ApplicationFW_appcore_get_rotation_state_func_01, POSITIVE_TC_IDX },
+ { utc_ApplicationFW_appcore_get_rotation_state_func_02, NEGATIVE_TC_IDX },
+ { NULL, 0},
+};
+
+static void startup(void)
+{
+}
+
+static void cleanup(void)
+{
+}
+
+/**
+ * @brief Positive test case of appcore_get_rotation_state()
+ */
+static void utc_ApplicationFW_appcore_get_rotation_state_func_01(void)
+{
+ int r = 0;
+ enum appcore_rm curr;
+
+ r = appcore_get_rotation_state(&curr);
+ if (r) {
+ tet_infoline("appcore_get_rotation_state() failed in positive test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
+
+/**
+ * @brief Negative test case of ug_init appcore_get_rotation_state()
+ */
+static void utc_ApplicationFW_appcore_get_rotation_state_func_02(void)
+{
+ int r = 0;
+
+ r = appcore_get_rotation_state(NULL);
+ if (!r) {
+ tet_infoline("appcore_get_rotation_state() failed in negative test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
diff --git a/TC/unit/utc_ApplicationFW_appcore_init_func.c b/TC/unit/utc_ApplicationFW_appcore_init_func.c
new file mode 100644
index 0000000..3c0e283
--- /dev/null
+++ b/TC/unit/utc_ApplicationFW_appcore_init_func.c
@@ -0,0 +1,131 @@
+/*
+ * app-core
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>, Jaeho Lee <jaeho81.lee@samsung.com>
+ *
+ * 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 <appcore-common.h>
+
+struct ui_ops {
+ void *data;
+ void (*cb_app)(int, void *, bundle *);
+};
+
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_ApplicationFW_appcore_init_func_01(void);
+static void utc_ApplicationFW_appcore_init_func_02(void);
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+struct tet_testlist tet_testlist[] = {
+ { utc_ApplicationFW_appcore_init_func_01, POSITIVE_TC_IDX },
+ { utc_ApplicationFW_appcore_init_func_02, NEGATIVE_TC_IDX },
+ { NULL, 0},
+};
+
+static void startup(void)
+{
+}
+
+static void cleanup(void)
+{
+ appcore_exit();
+}
+
+static void ui_cb(int evt, void *data, bundle *b)
+{
+}
+
+/**
+ * @brief Positive test case of appcore_init()
+ */
+static void utc_ApplicationFW_appcore_init_func_01(void)
+{
+ int r = 0;
+ int argc = 1;
+ char *argv[] = {
+ "Testcase",
+ NULL,
+ };
+ const struct ui_ops ops = {
+ .cb_app = ui_cb,
+ };
+
+ r = appcore_init("Testcase", &ops, argc, argv);
+ if (r) {
+ tet_infoline("appcore_init() failed in positive test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
+
+/**
+ * @brief Negative test case of ug_init appcore_init()
+ */
+static void utc_ApplicationFW_appcore_init_func_02(void)
+{
+ int r = 0;
+ int argc = 1;
+ char *argv[] = {
+ "Testcase",
+ NULL,
+ };
+ const struct ui_ops ops = {
+ .cb_app = ui_cb,
+ };
+
+ r = appcore_init(NULL, &ops, argc, argv);
+ if (!r) {
+ tet_infoline("appcore_init() failed in negative test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+
+ r = appcore_init("Testcase", NULL, argc, argv);
+ if (!r) {
+ tet_infoline("appcore_init() failed in negative test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+
+ r = appcore_init("Testcase", &ops, -1, argv);
+ if (!r) {
+ tet_infoline("appcore_init() failed in negative test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+
+ r = appcore_init("Testcase", &ops, argc, NULL);
+ if (!r) {
+ tet_infoline("appcore_init() failed in negative test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+
+ tet_result(TET_PASS);
+}
diff --git a/TC/unit/utc_ApplicationFW_appcore_measure_start_func.c b/TC/unit/utc_ApplicationFW_appcore_measure_start_func.c
new file mode 100644
index 0000000..30eb144
--- /dev/null
+++ b/TC/unit/utc_ApplicationFW_appcore_measure_start_func.c
@@ -0,0 +1,58 @@
+/*
+ * app-core
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>, Jaeho Lee <jaeho81.lee@samsung.com>
+ *
+ * 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 <appcore-common.h>
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_ApplicationFW_appcore_measure_start_func_01(void);
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+struct tet_testlist tet_testlist[] = {
+ { utc_ApplicationFW_appcore_measure_start_func_01, POSITIVE_TC_IDX },
+ { NULL, 0},
+};
+
+static void startup(void)
+{
+}
+
+static void cleanup(void)
+{
+}
+
+/**
+ * @brief Positive test case of appcore_measure_start()
+ */
+static void utc_ApplicationFW_appcore_measure_start_func_01(void)
+{
+ appcore_measure_start();
+ tet_result(TET_PASS);
+}
+
diff --git a/TC/unit/utc_ApplicationFW_appcore_measure_time_from_func.c b/TC/unit/utc_ApplicationFW_appcore_measure_time_from_func.c
new file mode 100644
index 0000000..8af350b
--- /dev/null
+++ b/TC/unit/utc_ApplicationFW_appcore_measure_time_from_func.c
@@ -0,0 +1,87 @@
+/*
+ * app-core
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>, Jaeho Lee <jaeho81.lee@samsung.com>
+ *
+ * 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 <appcore-common.h>
+#include <stdlib.h>
+#include <sys/time.h>
+#include <stdio.h>
+
+#define APPCORE_TESTCASE "APPCORE_TESTCASE"
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_ApplicationFW_appcore_measure_time_from_func_01(void);
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+struct tet_testlist tet_testlist[] = {
+ { utc_ApplicationFW_appcore_measure_time_from_func_01, POSITIVE_TC_IDX },
+ { NULL, 0},
+};
+
+static void startup(void)
+{
+ struct timeval tv;
+ char buf[1024];
+
+ gettimeofday(&tv, NULL);
+
+ snprintf(buf, sizeof(buf), "%d %d", (int)tv.tv_sec, (int)tv.tv_usec);
+ setenv(APPCORE_TESTCASE, buf, 1);
+}
+
+static void cleanup(void)
+{
+}
+
+/**
+ * @brief Positive test case of appcore_measure_time_from()
+ */
+static void utc_ApplicationFW_appcore_measure_time_from_func_01(void)
+{
+ int r = 0;
+
+ r = appcore_measure_time_from(APPCORE_TESTCASE);
+ if (!r) {
+ tet_infoline("appcore_measure_time_from() failed in positive test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+
+ unsetenv(APPCORE_TESTCASE);
+
+ r = appcore_measure_time_from(APPCORE_TESTCASE);
+ if (r) {
+ tet_infoline("appcore_measure_time_from() failed in positive test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+
+ tet_result(TET_PASS);
+}
+
diff --git a/TC/unit/utc_ApplicationFW_appcore_measure_time_func.c b/TC/unit/utc_ApplicationFW_appcore_measure_time_func.c
new file mode 100644
index 0000000..245cd9f
--- /dev/null
+++ b/TC/unit/utc_ApplicationFW_appcore_measure_time_func.c
@@ -0,0 +1,66 @@
+/*
+ * app-core
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>, Jaeho Lee <jaeho81.lee@samsung.com>
+ *
+ * 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 <appcore-common.h>
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_ApplicationFW_appcore_measure_time_func_01(void);
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+struct tet_testlist tet_testlist[] = {
+ { utc_ApplicationFW_appcore_measure_time_func_01, POSITIVE_TC_IDX },
+ { NULL, 0},
+};
+
+static void startup(void)
+{
+ appcore_measure_start();
+}
+
+static void cleanup(void)
+{
+}
+
+/**
+ * @brief Positive test case of appcore_measure_time()
+ */
+static void utc_ApplicationFW_appcore_measure_time_func_01(void)
+{
+ int r = 0;
+
+ r = appcore_measure_time();
+ if (r == 0) {
+ tet_infoline("appcore_measure_time() failed in positive test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
+
diff --git a/TC/unit/utc_ApplicationFW_appcore_set_event_callback_func.c b/TC/unit/utc_ApplicationFW_appcore_set_event_callback_func.c
new file mode 100644
index 0000000..6cb792c
--- /dev/null
+++ b/TC/unit/utc_ApplicationFW_appcore_set_event_callback_func.c
@@ -0,0 +1,97 @@
+/*
+ * app-core
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>, Jaeho Lee <jaeho81.lee@samsung.com>
+ *
+ * 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 <appcore-common.h>
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_ApplicationFW_appcore_set_event_callback_func_01(void);
+static void utc_ApplicationFW_appcore_set_event_callback_func_02(void);
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+struct tet_testlist tet_testlist[] = {
+ { utc_ApplicationFW_appcore_set_event_callback_func_01, POSITIVE_TC_IDX },
+ { utc_ApplicationFW_appcore_set_event_callback_func_02, NEGATIVE_TC_IDX },
+ { NULL, 0},
+};
+
+static void startup(void)
+{
+}
+
+static void cleanup(void)
+{
+}
+
+static int cb(void *data)
+{
+
+ return 0;
+}
+
+
+/**
+ * @brief Positive test case of appcore_set_event_callback()
+ */
+static void utc_ApplicationFW_appcore_set_event_callback_func_01(void)
+{
+ int r = 0;
+
+ r = appcore_set_event_callback(APPCORE_EVENT_LOW_MEMORY, cb, NULL);
+ if (r) {
+ tet_infoline("appcore_set_event_callback() failed in positive test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+
+ r = appcore_set_event_callback(APPCORE_EVENT_LOW_MEMORY, NULL, NULL);
+ if (r) {
+ tet_infoline("appcore_set_event_callback() failed in positive test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+
+ tet_result(TET_PASS);
+}
+
+/**
+ * @brief Negative test case of ug_init appcore_set_event_callback()
+ */
+static void utc_ApplicationFW_appcore_set_event_callback_func_02(void)
+{
+ int r = 0;
+
+ r = appcore_set_event_callback(-1, cb, NULL);
+ if (!r) {
+ tet_infoline("appcore_set_event_callback() failed in negative test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
diff --git a/TC/unit/utc_ApplicationFW_appcore_set_i18n_func.c b/TC/unit/utc_ApplicationFW_appcore_set_i18n_func.c
new file mode 100644
index 0000000..6ec6522
--- /dev/null
+++ b/TC/unit/utc_ApplicationFW_appcore_set_i18n_func.c
@@ -0,0 +1,83 @@
+/*
+ * app-core
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>, Jaeho Lee <jaeho81.lee@samsung.com>
+ *
+ * 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 <appcore-common.h>
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_ApplicationFW_appcore_set_i18n_func_01(void);
+static void utc_ApplicationFW_appcore_set_i18n_func_02(void);
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+struct tet_testlist tet_testlist[] = {
+ { utc_ApplicationFW_appcore_set_i18n_func_01, POSITIVE_TC_IDX },
+ { utc_ApplicationFW_appcore_set_i18n_func_02, NEGATIVE_TC_IDX },
+ { NULL, 0},
+};
+
+static void startup(void)
+{
+}
+
+static void cleanup(void)
+{
+}
+
+/**
+ * @brief Positive test case of appcore_set_i18n()
+ */
+static void utc_ApplicationFW_appcore_set_i18n_func_01(void)
+{
+ int r = 0;
+
+ r = appcore_set_i18n("Testcase", NULL);
+ if (r) {
+ tet_infoline("appcore_set_i18n() failed in positive test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
+
+/**
+ * @brief Negative test case of ug_init appcore_set_i18n()
+ */
+static void utc_ApplicationFW_appcore_set_i18n_func_02(void)
+{
+ int r = 0;
+
+ r = appcore_set_i18n(NULL, NULL);
+ if (!r) {
+ tet_infoline("appcore_set_i18n() failed in negative test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+
+ tet_result(TET_PASS);
+}
diff --git a/TC/unit/utc_ApplicationFW_appcore_set_rotation_cb_func.c b/TC/unit/utc_ApplicationFW_appcore_set_rotation_cb_func.c
new file mode 100644
index 0000000..79a3738
--- /dev/null
+++ b/TC/unit/utc_ApplicationFW_appcore_set_rotation_cb_func.c
@@ -0,0 +1,88 @@
+/*
+ * app-core
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>, Jaeho Lee <jaeho81.lee@samsung.com>
+ *
+ * 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 <appcore-common.h>
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_ApplicationFW_appcore_set_rotation_cb_func_01(void);
+static void utc_ApplicationFW_appcore_set_rotation_cb_func_02(void);
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+struct tet_testlist tet_testlist[] = {
+ { utc_ApplicationFW_appcore_set_rotation_cb_func_01, POSITIVE_TC_IDX },
+ { utc_ApplicationFW_appcore_set_rotation_cb_func_02, NEGATIVE_TC_IDX },
+ { NULL, 0},
+};
+
+static void startup(void)
+{
+}
+
+static void cleanup(void)
+{
+}
+
+static int rot_cb(enum appcore_rm rm, void *data)
+{
+
+ return 0;
+}
+
+/**
+ * @brief Positive test case of appcore_set_rotation_cb()
+ */
+static void utc_ApplicationFW_appcore_set_rotation_cb_func_01(void)
+{
+ int r = 0;
+
+ r = appcore_set_rotation_cb(rot_cb, NULL);
+ if (r) {
+ tet_infoline("appcore_set_rotation_cb() failed in positive test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
+
+/**
+ * @brief Negative test case of ug_init appcore_set_rotation_cb()
+ */
+static void utc_ApplicationFW_appcore_set_rotation_cb_func_02(void)
+{
+ int r = 0;
+
+ r = appcore_set_rotation_cb(NULL, NULL);
+ if (!r) {
+ tet_infoline("appcore_set_rotation_cb() failed in negative test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
diff --git a/TC/unit/utc_ApplicationFW_appcore_unset_rotation_cb_func.c b/TC/unit/utc_ApplicationFW_appcore_unset_rotation_cb_func.c
new file mode 100644
index 0000000..493315c
--- /dev/null
+++ b/TC/unit/utc_ApplicationFW_appcore_unset_rotation_cb_func.c
@@ -0,0 +1,65 @@
+/*
+ * app-core
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>, Jaeho Lee <jaeho81.lee@samsung.com>
+ *
+ * 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 <appcore-common.h>
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_ApplicationFW_appcore_unset_rotation_cb_func_01(void);
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+struct tet_testlist tet_testlist[] = {
+ { utc_ApplicationFW_appcore_unset_rotation_cb_func_01, POSITIVE_TC_IDX },
+ { NULL, 0},
+};
+
+static void startup(void)
+{
+}
+
+static void cleanup(void)
+{
+}
+
+/**
+ * @brief Positive test case of appcore_unset_rotation_cb()
+ */
+static void utc_ApplicationFW_appcore_unset_rotation_cb_func_01(void)
+{
+ int r = 0;
+
+ r = appcore_unset_rotation_cb();
+ if (r) {
+ tet_infoline("appcore_unset_rotation_cb() failed in positive test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
+
diff --git a/TC/unit/utc_MODULE_API_func.c.in b/TC/unit/utc_MODULE_API_func.c.in
new file mode 100644
index 0000000..bf9f90c
--- /dev/null
+++ b/TC/unit/utc_MODULE_API_func.c.in
@@ -0,0 +1,76 @@
+#include <tet_api.h>
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_@MODULE@_@API@_func_01(void);
+static void utc_@MODULE@_@API@_func_02(void);
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+struct tet_testlist tet_testlist[] = {
+ { utc_@MODULE@_@API@_func_01, POSITIVE_TC_IDX },
+ { utc_@MODULE@_@API@_func_02, NEGATIVE_TC_IDX },
+};
+
+static void startup(void)
+{
+ int r;
+/*
+ char *err;
+ r = initailze...;
+ if (r) {
+ err = "Error message.......";
+ tet_infoline(err);
+ tet_delete(POSITIVE_TC_IDX, err);
+ tet_delete(NEGATIVE_TC_IDX, err);
+ }
+*/
+
+}
+
+static void cleanup(void)
+{
+}
+
+/**
+ * @brief Positive test case of @API@()
+ */
+static void utc_@MODULE@_@API@_func_01(void)
+{
+ int r = 0;
+
+/*
+ r = @API@(...);
+*/
+ if (r) {
+ tet_infoline("@API@() failed in positive test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
+
+/**
+ * @brief Negative test case of ug_init @API@()
+ */
+static void utc_@MODULE@_@API@_func_02(void)
+{
+ int r = 0;
+
+/*
+ r = @API@(...);
+*/
+ if (!r) {
+ tet_infoline("@API@() failed in negative test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}