summaryrefslogtreecommitdiff
path: root/TC/unit
diff options
context:
space:
mode:
authorJinkun Jang <jinkun.jang@samsung.com>2013-03-13 01:51:43 +0900
committerJinkun Jang <jinkun.jang@samsung.com>2013-03-13 01:51:43 +0900
commiteca9de431ed507c959c0a431dd58a562e5fbb24b (patch)
tree95d878a12ff4b95b149fb00c12dfbc6e9753c0b7 /TC/unit
parenta1587a945a0ed4e72ad4fffd3de37ed6e6ccc2d6 (diff)
downloadlibslp-sensor-eca9de431ed507c959c0a431dd58a562e5fbb24b.tar.gz
libslp-sensor-eca9de431ed507c959c0a431dd58a562e5fbb24b.tar.bz2
libslp-sensor-eca9de431ed507c959c0a431dd58a562e5fbb24b.zip
Tizen 2.1 base
Diffstat (limited to 'TC/unit')
-rwxr-xr-xTC/unit/Makefile31
-rwxr-xr-xTC/unit/tc_gen.sh28
-rwxr-xr-xTC/unit/tslist10
-rwxr-xr-xTC/unit/utc_MODULE_API_func.c.in64
-rwxr-xr-xTC/unit/utc_SensorFW_sf_check_rotation_func.c67
-rwxr-xr-xTC/unit/utc_SensorFW_sf_connect_func.c66
-rwxr-xr-xTC/unit/utc_SensorFW_sf_disconnect_func.c73
-rwxr-xr-xTC/unit/utc_SensorFW_sf_get_data_func.c79
-rwxr-xr-xTC/unit/utc_SensorFW_sf_get_properties_func.c67
-rwxr-xr-xTC/unit/utc_SensorFW_sf_is_sensor_event_available_func.c66
-rwxr-xr-xTC/unit/utc_SensorFW_sf_read_raw_data_func.c73
-rwxr-xr-xTC/unit/utc_SensorFW_sf_register_event_func.c75
-rwxr-xr-xTC/unit/utc_SensorFW_sf_start_func.c69
-rwxr-xr-xTC/unit/utc_SensorFW_sf_stop_func.c72
-rwxr-xr-xTC/unit/utc_SensorFW_sf_unregister_event_func.c74
15 files changed, 914 insertions, 0 deletions
diff --git a/TC/unit/Makefile b/TC/unit/Makefile
new file mode 100755
index 0000000..a1176cb
--- /dev/null
+++ b/TC/unit/Makefile
@@ -0,0 +1,31 @@
+CC ?= gcc
+
+TARGETS = utc_SensorFW_sf_get_properties_func \
+ utc_SensorFW_sf_is_sensor_event_available_func \
+ utc_SensorFW_sf_connect_func \
+ utc_SensorFW_sf_disconnect_func \
+ utc_SensorFW_sf_start_func \
+ utc_SensorFW_sf_stop_func \
+ utc_SensorFW_sf_register_event_func \
+ utc_SensorFW_sf_unregister_event_func \
+ utc_SensorFW_sf_get_data_func \
+ utc_SensorFW_sf_check_rotation_func
+
+PKGS = sf_common sensor
+
+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 100755
index 0000000..8f2ef26
--- /dev/null
+++ b/TC/unit/tslist
@@ -0,0 +1,10 @@
+/unit/utc_SensorFW_sf_is_sensor_event_available_func
+/unit/utc_SensorFW_sf_get_properties_func
+/unit/utc_SensorFW_sf_connect_func
+/unit/utc_SensorFW_sf_disconnect_func
+/unit/utc_SensorFW_sf_start_func
+/unit/utc_SensorFW_sf_stop_func
+/unit/utc_SensorFW_sf_register_event_func
+/unit/utc_SensorFW_sf_unregister_event_func
+/unit/utc_SensorFW_sf_get_data_func
+/unit/utc_SensorFW_sf_check_rotation_func
diff --git a/TC/unit/utc_MODULE_API_func.c.in b/TC/unit/utc_MODULE_API_func.c.in
new file mode 100755
index 0000000..b235fa3
--- /dev/null
+++ b/TC/unit/utc_MODULE_API_func.c.in
@@ -0,0 +1,64 @@
+#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)
+{
+}
+
+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);
+}
diff --git a/TC/unit/utc_SensorFW_sf_check_rotation_func.c b/TC/unit/utc_SensorFW_sf_check_rotation_func.c
new file mode 100755
index 0000000..512b087
--- /dev/null
+++ b/TC/unit/utc_SensorFW_sf_check_rotation_func.c
@@ -0,0 +1,67 @@
+#include <tet_api.h>
+#include <sensor.h>
+
+int handle = 0;
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_SensorFW_sf_check_rotation_func_01(void);
+static void utc_SensorFW_sf_check_rotation_func_02(void);
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+struct tet_testlist tet_testlist[] = {
+ { utc_SensorFW_sf_check_rotation_func_01, POSITIVE_TC_IDX },
+ { utc_SensorFW_sf_check_rotation_func_02, NEGATIVE_TC_IDX },
+ { NULL, 0},
+};
+
+static void startup(void)
+{
+}
+
+static void cleanup(void)
+{
+}
+
+/**
+ * @brief Positive test case of sf_check_rotation()
+ */
+static void utc_SensorFW_sf_check_rotation_func_01(void)
+{
+ int r = 0;
+ unsigned long event;
+
+ r = sf_check_rotation(&event);
+
+ if (r < 0) {
+ tet_infoline("sf_check_rotation() failed in positive test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
+
+/**
+ * @brief Negative test case of ug_init sf_check_rotation()
+ */
+static void utc_SensorFW_sf_check_rotation_func_02(void)
+{
+ int r = 0;
+
+ r = sf_check_rotation(NULL);
+
+ if (r > 0) {
+ tet_infoline("sf_check_rotation() failed in negative test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
diff --git a/TC/unit/utc_SensorFW_sf_connect_func.c b/TC/unit/utc_SensorFW_sf_connect_func.c
new file mode 100755
index 0000000..746880c
--- /dev/null
+++ b/TC/unit/utc_SensorFW_sf_connect_func.c
@@ -0,0 +1,66 @@
+#include <tet_api.h>
+#include <sensor.h>
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_SensorFW_sf_connect_func_01(void);
+static void utc_SensorFW_sf_connect_func_02(void);
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+struct tet_testlist tet_testlist[] = {
+ { utc_SensorFW_sf_connect_func_01, POSITIVE_TC_IDX },
+ { utc_SensorFW_sf_connect_func_02, NEGATIVE_TC_IDX },
+ { NULL, 0},
+};
+
+static void startup(void)
+{
+}
+
+static void cleanup(void)
+{
+}
+
+/**
+ * @brief Positive test case of sf_connect()
+ */
+static void utc_SensorFW_sf_connect_func_01(void)
+{
+ int r = 0;
+
+
+ r = sf_connect(ACCELEROMETER_SENSOR);
+
+ if (r < 0) {
+ tet_infoline("sf_connect() failed in positive test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
+
+/**
+ * @brief Negative test case of ug_init sf_connect()
+ */
+static void utc_SensorFW_sf_connect_func_02(void)
+{
+ int r = 0;
+
+
+ r = sf_connect(100);
+
+ if (r > 0 ) {
+ tet_infoline("sf_connect() failed in negative test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
diff --git a/TC/unit/utc_SensorFW_sf_disconnect_func.c b/TC/unit/utc_SensorFW_sf_disconnect_func.c
new file mode 100755
index 0000000..85d13f2
--- /dev/null
+++ b/TC/unit/utc_SensorFW_sf_disconnect_func.c
@@ -0,0 +1,73 @@
+#include <tet_api.h>
+#include <sensor.h>
+
+
+int handle;
+
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_SensorFW_sf_disconnect_func_01(void);
+static void utc_SensorFW_sf_disconnect_func_02(void);
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+struct tet_testlist tet_testlist[] = {
+ { utc_SensorFW_sf_disconnect_func_01, POSITIVE_TC_IDX },
+ { utc_SensorFW_sf_disconnect_func_02, NEGATIVE_TC_IDX },
+ { NULL, 0},
+};
+
+static void startup(void)
+{
+ handle = sf_connect(ACCELEROMETER_SENSOR);
+}
+
+static void cleanup(void)
+{
+ sf_disconnect(handle);
+}
+
+
+/**
+ * @brief Positive test case of sf_disconnect()
+ */
+static void utc_SensorFW_sf_disconnect_func_01(void)
+{
+ int r = 0;
+
+
+ r = sf_disconnect(handle);
+
+ if (r != 0) {
+ tet_infoline("sf_disconnect() failed in positive test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
+
+/**
+ * @brief Negative test case of ug_init sf_disconnect()
+ */
+static void utc_SensorFW_sf_disconnect_func_02(void)
+{
+ int r = 0;
+
+
+ r = sf_disconnect(100);
+
+ if (r == 0) {
+ tet_infoline("sf_disconnect() failed in negative test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
diff --git a/TC/unit/utc_SensorFW_sf_get_data_func.c b/TC/unit/utc_SensorFW_sf_get_data_func.c
new file mode 100755
index 0000000..e1f5a12
--- /dev/null
+++ b/TC/unit/utc_SensorFW_sf_get_data_func.c
@@ -0,0 +1,79 @@
+#include <tet_api.h>
+#include <sensor.h>
+#include <stdlib.h>
+
+int handle = 0;
+sensor_data_t* values;
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_SensorFW_sf_get_data_func_01(void);
+static void utc_SensorFW_sf_get_data_func_02(void);
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+struct tet_testlist tet_testlist[] = {
+ { utc_SensorFW_sf_get_data_func_01, POSITIVE_TC_IDX },
+ { utc_SensorFW_sf_get_data_func_02, NEGATIVE_TC_IDX },
+ { NULL, 0},
+};
+
+static void startup(void)
+{
+ handle = sf_connect(ACCELEROMETER_SENSOR);
+ sf_start(handle,0);
+
+}
+
+static void cleanup(void)
+{
+ sf_stop(handle);
+ sf_disconnect(handle);
+}
+
+/**
+ * @brief Positive test case of sf_get_data()
+ */
+static void utc_SensorFW_sf_get_data_func_01(void)
+{
+ int r = 0;
+
+ values = (sensor_data_t*)malloc(sizeof(sensor_data_t));
+
+ r = sf_get_data(handle, ACCELEROMETER_BASE_DATA_SET, values);
+
+ if (r < 0) {
+ tet_infoline("sf_get_data() failed in positive test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
+
+/**
+ * @brief Negative test case of ug_init sf_get_data()
+ */
+static void utc_SensorFW_sf_get_data_func_02(void)
+{
+ int r = 0;
+
+// values = (sensor_data_t*)malloc(sizeof(sensor_data_t));
+
+ r = sf_get_data(300, NULL, values);
+
+ printf("n r = %d\n", r);
+
+ if (r > 0) {
+ tet_infoline("sf_get_data() failed in negative test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
diff --git a/TC/unit/utc_SensorFW_sf_get_properties_func.c b/TC/unit/utc_SensorFW_sf_get_properties_func.c
new file mode 100755
index 0000000..1a1c857
--- /dev/null
+++ b/TC/unit/utc_SensorFW_sf_get_properties_func.c
@@ -0,0 +1,67 @@
+#include <tet_api.h>
+#include <sensor.h>
+
+sensor_properties_t accel_property;
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_SensorFW_sf_get_properties_func_01(void);
+static void utc_SensorFW_sf_get_properties_func_02(void);
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+struct tet_testlist tet_testlist[] = {
+ { utc_SensorFW_sf_get_properties_func_01, POSITIVE_TC_IDX },
+ { utc_SensorFW_sf_get_properties_func_02, NEGATIVE_TC_IDX },
+ { NULL, 0},
+};
+
+static void startup(void)
+{
+}
+
+static void cleanup(void)
+{
+}
+
+/**
+ * @brief Positive test case of sf_get_properties()
+ */
+static void utc_SensorFW_sf_get_properties_func_01(void)
+{
+ int r = 0;
+
+
+ r = sf_get_properties(ACCELEROMETER_SENSOR, &accel_property);
+
+ if (r < 0) {
+ tet_infoline("sf_get_properties() failed in positive test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
+
+/**
+ * @brief Negative test case of ug_init sf_get_properties()
+ */
+static void utc_SensorFW_sf_get_properties_func_02(void)
+{
+ int r = 0;
+
+ r = sf_get_properties(ACCELEROMETER_SENSOR, NULL);
+
+ if (r > 0) {
+ tet_infoline("sf_get_properties() failed in negative test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
diff --git a/TC/unit/utc_SensorFW_sf_is_sensor_event_available_func.c b/TC/unit/utc_SensorFW_sf_is_sensor_event_available_func.c
new file mode 100755
index 0000000..02804f9
--- /dev/null
+++ b/TC/unit/utc_SensorFW_sf_is_sensor_event_available_func.c
@@ -0,0 +1,66 @@
+#include <tet_api.h>
+#include <sensor.h>
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_SensorFW_sf_is_sensor_event_available_func_01(void);
+static void utc_SensorFW_sf_is_sensor_event_available_func_02(void);
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+struct tet_testlist tet_testlist[] = {
+ { utc_SensorFW_sf_is_sensor_event_available_func_01, POSITIVE_TC_IDX },
+ { utc_SensorFW_sf_is_sensor_event_available_func_02, NEGATIVE_TC_IDX },
+ { NULL, 0},
+};
+
+static void startup(void)
+{
+}
+
+static void cleanup(void)
+{
+}
+
+/**
+ * @brief Positive test case of sf_is_sensor_event_available()
+ */
+static void utc_SensorFW_sf_is_sensor_event_available_func_01(void)
+{
+ int r = 0;
+
+
+ r = sf_is_sensor_event_available(ACCELEROMETER_SENSOR, 0);
+
+ if (r < 0) {
+ tet_infoline("sf_is_sensor_event_available() failed in positive test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
+
+/**
+ * @brief Negative test case of ug_init sf_is_sensor_event_available()
+ */
+static void utc_SensorFW_sf_is_sensor_event_available_func_02(void)
+{
+ int r = 0;
+
+
+ r = sf_is_sensor_event_available(UNKNOWN_SENSOR, 0);
+
+ if (r > 0) {
+ tet_infoline("sf_is_sensor_event_available() failed in negative test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
diff --git a/TC/unit/utc_SensorFW_sf_read_raw_data_func.c b/TC/unit/utc_SensorFW_sf_read_raw_data_func.c
new file mode 100755
index 0000000..924a288
--- /dev/null
+++ b/TC/unit/utc_SensorFW_sf_read_raw_data_func.c
@@ -0,0 +1,73 @@
+#include <tet_api.h>
+#include <sensor.h>
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_SensorFW_sf_read_raw_data_func_01(void);
+static void utc_SensorFW_sf_read_raw_data_func_02(void);
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+struct tet_testlist tet_testlist[] = {
+ { utc_SensorFW_sf_read_raw_data_func_01, POSITIVE_TC_IDX },
+ { utc_SensorFW_sf_read_raw_data_func_02, NEGATIVE_TC_IDX },
+ { NULL, 0},
+};
+
+static void startup(void)
+{
+}
+
+static void cleanup(void)
+{
+}
+
+/**
+ * @brief Positive test case of sf_read_raw_data()
+ */
+static void utc_SensorFW_sf_read_raw_data_func_01(void)
+{
+ int r = 0;
+
+ float values[3];
+ size_t values_size;
+
+ values_size = sizeof(values);
+
+ r = sf_read_raw_data(ACCELEROMETER_SENSOR , values, &values_size);
+
+ if (r < 0) {
+ tet_infoline("sf_read_raw_data() failed in positive test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
+
+/**
+ * @brief Negative test case of ug_init sf_read_raw_data()
+ */
+static void utc_SensorFW_sf_read_raw_data_func_02(void)
+{
+ int r = 0;
+
+ float values[3];
+ size_t values_size;
+ values_size = sizeof(values);;
+
+ r = sf_read_raw_data(UNKNOWN_SENSOR , values, &values_size);
+
+ if (r > 0) {
+ tet_infoline("sf_read_raw_data() failed in negative test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
diff --git a/TC/unit/utc_SensorFW_sf_register_event_func.c b/TC/unit/utc_SensorFW_sf_register_event_func.c
new file mode 100755
index 0000000..dc7548e
--- /dev/null
+++ b/TC/unit/utc_SensorFW_sf_register_event_func.c
@@ -0,0 +1,75 @@
+#include <tet_api.h>
+#include <sensor.h>
+
+int handle = 0;
+
+void my_callback_func(unsigned int event_type, sensor_event_data_t *event , void *data)
+{
+}
+
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_SensorFW_sf_register_event_func_01(void);
+static void utc_SensorFW_sf_register_event_func_02(void);
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+struct tet_testlist tet_testlist[] = {
+ { utc_SensorFW_sf_register_event_func_01, POSITIVE_TC_IDX },
+ { utc_SensorFW_sf_register_event_func_02, NEGATIVE_TC_IDX },
+ { NULL, 0},
+};
+
+static void startup(void)
+{
+ handle = sf_connect(ACCELEROMETER_SENSOR);
+
+}
+
+static void cleanup(void)
+{
+ sf_disconnect(handle);
+}
+
+/**
+ * @brief Positive test case of sf_register_event()
+ */
+static void utc_SensorFW_sf_register_event_func_01(void)
+{
+ int r = 0;
+
+
+ r = sf_register_event(handle, ACCELEROMETER_EVENT_ROTATION_CHECK, NULL, my_callback_func,NULL);
+
+ if (r < 0) {
+ tet_infoline("sf_register_event() failed in positive test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
+
+/**
+ * @brief Negative test case of ug_init sf_register_event()
+ */
+static void utc_SensorFW_sf_register_event_func_02(void)
+{
+ int r = 0;
+
+ r = sf_register_event(400, ACCELEROMETER_EVENT_ROTATION_CHECK, NULL, my_callback_func,NULL);
+
+ if (r > 0) {
+ tet_infoline("sf_register_event() failed in negative test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
diff --git a/TC/unit/utc_SensorFW_sf_start_func.c b/TC/unit/utc_SensorFW_sf_start_func.c
new file mode 100755
index 0000000..c35871f
--- /dev/null
+++ b/TC/unit/utc_SensorFW_sf_start_func.c
@@ -0,0 +1,69 @@
+#include <tet_api.h>
+#include <sensor.h>
+
+int handle = 0;
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_SensorFW_sf_start_func_01(void);
+static void utc_SensorFW_sf_start_func_02(void);
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+struct tet_testlist tet_testlist[] = {
+ { utc_SensorFW_sf_start_func_01, POSITIVE_TC_IDX },
+ { utc_SensorFW_sf_start_func_02, NEGATIVE_TC_IDX },
+ { NULL, 0},
+};
+
+static void startup(void)
+{
+ handle = sf_connect(ACCELEROMETER_SENSOR);
+}
+
+static void cleanup(void)
+{
+ sf_disconnect(handle);
+}
+
+/**
+ * @brief Positive test case of sf_start()
+ */
+static void utc_SensorFW_sf_start_func_01(void)
+{
+ int r = 0;
+
+
+ r = sf_start(handle, 0);
+
+ if (r < 0) {
+ tet_infoline("sf_start() failed in positive test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
+
+/**
+ * @brief Negative test case of ug_init sf_start()
+ */
+static void utc_SensorFW_sf_start_func_02(void)
+{
+ int r = 0;
+
+ r = sf_start(-1, 0);
+
+ if (r > 0) {
+ tet_infoline("sf_start() failed in negative test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
diff --git a/TC/unit/utc_SensorFW_sf_stop_func.c b/TC/unit/utc_SensorFW_sf_stop_func.c
new file mode 100755
index 0000000..d8aee0b
--- /dev/null
+++ b/TC/unit/utc_SensorFW_sf_stop_func.c
@@ -0,0 +1,72 @@
+#include <tet_api.h>
+#include <sensor.h>
+
+int handle = 0;
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_SensorFW_sf_stop_func_01(void);
+static void utc_SensorFW_sf_stop_func_02(void);
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+struct tet_testlist tet_testlist[] = {
+ { utc_SensorFW_sf_stop_func_01, POSITIVE_TC_IDX },
+ { utc_SensorFW_sf_stop_func_02, NEGATIVE_TC_IDX },
+ { NULL, 0},
+};
+
+static void startup(void)
+{
+ handle = sf_connect(ACCELEROMETER_SENSOR);
+ sf_start(handle, 0);
+}
+
+static void cleanup(void)
+{
+ sf_stop(handle);
+ sf_disconnect(handle);
+}
+
+/**
+ * @brief Positive test case of sf_stop()
+ */
+static void utc_SensorFW_sf_stop_func_01(void)
+{
+ int r = 0;
+
+
+ r = sf_stop(handle);
+
+ if (r < 0) {
+ tet_infoline("sf_stop() failed in positive test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
+
+/**
+ * @brief Negative test case of ug_init sf_stop()
+ */
+static void utc_SensorFW_sf_stop_func_02(void)
+{
+ int r = 0;
+
+
+ r = sf_stop(-1);
+
+ if (r > 0) {
+ tet_infoline("sf_stop() failed in negative test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
diff --git a/TC/unit/utc_SensorFW_sf_unregister_event_func.c b/TC/unit/utc_SensorFW_sf_unregister_event_func.c
new file mode 100755
index 0000000..bbe9437
--- /dev/null
+++ b/TC/unit/utc_SensorFW_sf_unregister_event_func.c
@@ -0,0 +1,74 @@
+#include <tet_api.h>
+#include <sensor.h>
+
+int handle = 0;
+
+void my_callback_func(unsigned int event_type, sensor_event_data_t *event , void *data)
+{
+}
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_SensorFW_sf_unregister_event_func_01(void);
+static void utc_SensorFW_sf_unregister_event_func_02(void);
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+struct tet_testlist tet_testlist[] = {
+ { utc_SensorFW_sf_unregister_event_func_01, POSITIVE_TC_IDX },
+ { utc_SensorFW_sf_unregister_event_func_02, NEGATIVE_TC_IDX },
+ { NULL, 0},
+};
+
+static void startup(void)
+{
+ handle = sf_connect(ACCELEROMETER_SENSOR);
+ sf_register_event(handle, ACCELEROMETER_EVENT_ROTATION_CHECK, NULL, my_callback_func,NULL);
+
+}
+
+static void cleanup(void)
+{
+ sf_disconnect(handle);
+}
+/**
+ * @brief Positive test case of sf_unregister_event()
+ */
+static void utc_SensorFW_sf_unregister_event_func_01(void)
+{
+ int r = 0;
+
+
+ r = sf_unregister_event(handle, ACCELEROMETER_EVENT_ROTATION_CHECK);
+
+ if (r < 0) {
+ tet_infoline("sf_unregister_event() failed in positive test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
+
+/**
+ * @brief Negative test case of ug_init sf_unregister_event()
+ */
+static void utc_SensorFW_sf_unregister_event_func_02(void)
+{
+ int r = 0;
+
+ r = sf_unregister_event(handle, NULL);
+
+ if (r > 0) {
+ tet_infoline("sf_unregister_event() failed in negative test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}