diff options
author | Jinkun Jang <jinkun.jang@samsung.com> | 2013-03-13 01:51:43 +0900 |
---|---|---|
committer | Jinkun Jang <jinkun.jang@samsung.com> | 2013-03-13 01:51:43 +0900 |
commit | eca9de431ed507c959c0a431dd58a562e5fbb24b (patch) | |
tree | 95d878a12ff4b95b149fb00c12dfbc6e9753c0b7 /TC/unit/utc_SensorFW_sf_start_func.c | |
parent | a1587a945a0ed4e72ad4fffd3de37ed6e6ccc2d6 (diff) | |
download | libslp-sensor-eca9de431ed507c959c0a431dd58a562e5fbb24b.tar.gz libslp-sensor-eca9de431ed507c959c0a431dd58a562e5fbb24b.tar.bz2 libslp-sensor-eca9de431ed507c959c0a431dd58a562e5fbb24b.zip |
Tizen 2.1 base
Diffstat (limited to 'TC/unit/utc_SensorFW_sf_start_func.c')
-rwxr-xr-x | TC/unit/utc_SensorFW_sf_start_func.c | 69 |
1 files changed, 69 insertions, 0 deletions
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); +} |