summaryrefslogtreecommitdiff
path: root/TC
diff options
context:
space:
mode:
authorKim Kibum <kb0929.kim@samsung.com>2012-04-29 16:58:28 +0900
committerKim Kibum <kb0929.kim@samsung.com>2012-04-29 16:58:28 +0900
commit7393965421a6622d88bc8af45e574688711e115e (patch)
tree5a93f3419747df9f2f39f078513e93f84b07e3ea /TC
parenta04330477c975ccca2d402a46e5d10fa1d79abc3 (diff)
downloadmetadata-extractor-7393965421a6622d88bc8af45e574688711e115e.tar.gz
metadata-extractor-7393965421a6622d88bc8af45e574688711e115e.tar.bz2
metadata-extractor-7393965421a6622d88bc8af45e574688711e115e.zip
upload tizen1.0 source
Diffstat (limited to 'TC')
-rwxr-xr-xTC/_export_env.sh8
-rwxr-xr-xTC/_export_target_env.sh7
-rwxr-xr-xTC/build.sh16
-rwxr-xr-xTC/clean.sh11
-rwxr-xr-xTC/config3
-rwxr-xr-xTC/config.default3
-rwxr-xr-xTC/execute.sh15
-rwxr-xr-xTC/testcase/Makefile23
-rwxr-xr-xTC/testcase/tslist1
-rwxr-xr-xTC/testcase/utc_metadata_extractor.c275
-rwxr-xr-xTC/tet_scen7
-rwxr-xr-xTC/tet_xres21
-rwxr-xr-xTC/tetbuild.cfg5
-rwxr-xr-xTC/tetclean.cfg5
-rwxr-xr-xTC/tetexec.cfg5
15 files changed, 405 insertions, 0 deletions
diff --git a/TC/_export_env.sh b/TC/_export_env.sh
new file mode 100755
index 0000000..72a11ec
--- /dev/null
+++ b/TC/_export_env.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+. ./config
+export TET_INSTALL_PATH=$TET_INSTALL_HOST_PATH # tetware root path
+export TET_TARGET_PATH=$TET_INSTALL_PATH/tetware-target # tetware target path
+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
diff --git a/TC/_export_target_env.sh b/TC/_export_target_env.sh
new file mode 100755
index 0000000..5ddaa53
--- /dev/null
+++ b/TC/_export_target_env.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+. ./config
+export TET_INSTALL_PATH=$TET_INSTALL_TARGET_PATH # path to 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
diff --git a/TC/build.sh b/TC/build.sh
new file mode 100755
index 0000000..72aad6c
--- /dev/null
+++ b/TC/build.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+. ./_export_env.sh # setting environment variables
+
+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 7 -f chtml -o $HTML_RESULT $JOURNAL_RESULT
diff --git a/TC/clean.sh b/TC/clean.sh
new file mode 100755
index 0000000..29743e0
--- /dev/null
+++ b/TC/clean.sh
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+. ./_export_env.sh # setting environment variables
+
+export TET_SUITE_ROOT=`pwd`
+RESULT_DIR=results
+
+tcc -c -p ./ # executing tcc, with clean option (-c)
+rm -r $RESULT_DIR
+rm -r tet_tmp_dir
+rm testcase/tet_captured
diff --git a/TC/config b/TC/config
new file mode 100755
index 0000000..5567064
--- /dev/null
+++ b/TC/config
@@ -0,0 +1,3 @@
+TET_INSTALL_HOST_PATH=/home/backto.kim/workspace/TETware
+TET_INSTALL_TARGET_PATH=/mnt/nfs/workspace/TETware
+
diff --git a/TC/config.default b/TC/config.default
new file mode 100755
index 0000000..12ac1e2
--- /dev/null
+++ b/TC/config.default
@@ -0,0 +1,3 @@
+CAPI_PROJECT_ROOT=/home/abyss/capi
+TET_INSTALL_HOST_PATH=/home/abyss/TETware
+TET_INSTALL_TARGET_PATH=/mnt/nfs/TETware
diff --git a/TC/execute.sh b/TC/execute.sh
new file mode 100755
index 0000000..a4f6095
--- /dev/null
+++ b/TC/execute.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+. ./_export_target_env.sh # setting environment variables
+
+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/testcase/Makefile b/TC/testcase/Makefile
new file mode 100755
index 0000000..08ab7cd
--- /dev/null
+++ b/TC/testcase/Makefile
@@ -0,0 +1,23 @@
+CC ?= gcc
+
+C_FILES = $(shell ls *.c)
+
+PKGS = capi-media-metadata-extractor
+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
+
+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..d01002b
--- /dev/null
+++ b/TC/testcase/tslist
@@ -0,0 +1 @@
+/testcase/utc_metadata_extractor
diff --git a/TC/testcase/utc_metadata_extractor.c b/TC/testcase/utc_metadata_extractor.c
new file mode 100755
index 0000000..f157dab
--- /dev/null
+++ b/TC/testcase/utc_metadata_extractor.c
@@ -0,0 +1,275 @@
+/*
+* 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 <stdlib.h>
+#include <metadata_extractor.h>
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+
+#define MEDIA_PATH "/opt/media/Music/Over the horizon.mp3"
+
+metadata_extractor_h metadata = NULL;
+
+
+static void utc_metadata_extractor_create_n(void);
+static void utc_metadata_extractor_create_p(void);
+static void utc_metadata_extractor_set_path_n(void);
+static void utc_metadata_extractor_set_path_p(void);
+static void utc_metadata_extractor_destroy_n(void);
+static void utc_metadata_extractor_destroy_p(void);
+static void utc_metadata_extractor_get_metadata_n(void);
+static void utc_metadata_extractor_get_metadata_p(void);
+static void utc_metadata_extractor_get_artwork_n(void);
+static void utc_metadata_extractor_get_artwork_p(void);
+static void utc_metadata_extractor_get_frame_n(void);
+static void utc_metadata_extractor_get_frame_p(void);
+static void utc_metadata_extractor_get_synclyrics_n(void);
+static void utc_metadata_extractor_get_synclyrics_p(void);
+
+
+struct tet_testlist tet_testlist[] = {
+ { utc_metadata_extractor_create_n, 1 },
+ { utc_metadata_extractor_create_p, 1 },
+ { utc_metadata_extractor_set_path_n, 2 },
+ { utc_metadata_extractor_set_path_p, 2 },
+ { utc_metadata_extractor_get_metadata_n, 2 },
+ { utc_metadata_extractor_get_metadata_p, 2 },
+ { utc_metadata_extractor_get_artwork_n, 2 },
+ { utc_metadata_extractor_get_artwork_p, 2 },
+ { utc_metadata_extractor_get_frame_n, 2 },
+ { utc_metadata_extractor_get_frame_p, 2 },
+ { utc_metadata_extractor_get_synclyrics_n, 2 },
+ { utc_metadata_extractor_get_synclyrics_p, 2 },
+ { utc_metadata_extractor_destroy_n, 3 },
+ { utc_metadata_extractor_destroy_p, 3 },
+ { NULL, 0 },
+};
+
+
+static void startup(void)
+{
+ /* start of TC */
+}
+
+
+static void cleanup(void)
+{
+ /* end of TC */
+}
+
+
+/**
+ * @brief Negative test case of metadata_extractor_create()
+ */
+static void utc_metadata_extractor_create_n(void)
+{
+ int ret = METADATA_EXTRACTOR_ERROR_NONE;
+
+ ret = metadata_extractor_create(NULL);
+
+ dts_check_eq("utc_metadata_extractor_create_n", ret, METADATA_EXTRACTOR_ERROR_INVALID_PARAMETER, "Must return METADATA_EXTRACTOR_ERROR_INVALID_PARAMETER in case of invalid parameter");
+}
+
+/**
+ * @brief Positive test case of metadata_extractor_create()
+ */
+static void utc_metadata_extractor_create_p(void)
+{
+ int ret = METADATA_EXTRACTOR_ERROR_NONE;
+
+ ret = metadata_extractor_create(&metadata);
+
+ dts_check_eq("utc_metadata_extractor_create_p", ret, METADATA_EXTRACTOR_ERROR_NONE, "Failed to create handle");
+}
+
+/**
+ * @brief Negative test case of metadata_extractor_set_path()
+ */
+static void utc_metadata_extractor_set_path_n(void)
+{
+ int ret = METADATA_EXTRACTOR_ERROR_NONE;
+
+ ret = metadata_extractor_set_path(NULL, MEDIA_PATH);
+
+ dts_check_eq("utc_metadata_extractor_create_n", ret, METADATA_EXTRACTOR_ERROR_INVALID_PARAMETER, "Must return METADATA_EXTRACTOR_ERROR_INVALID_PARAMETER in case of invalid parameter");
+}
+
+/**
+ * @brief Positive test case of metadata_extractor_set_path()
+ */
+static void utc_metadata_extractor_set_path_p(void)
+{
+ int ret = METADATA_EXTRACTOR_ERROR_NONE;
+
+ ret = metadata_extractor_set_path(metadata, MEDIA_PATH);
+
+ dts_check_eq("utc_metadata_extractor_set_path_p", ret, METADATA_EXTRACTOR_ERROR_NONE, "Failed to set path");
+}
+
+/**
+ * @brief Negative test case of metadata_extractor_get_metadata()
+ */
+static void utc_metadata_extractor_get_metadata_n(void)
+{
+ int ret = METADATA_EXTRACTOR_ERROR_NONE;
+ char * value = NULL;
+
+ ret = metadata_extractor_get_metadata(metadata, -1, &value);
+
+ dts_check_eq("utc_metadata_extractor_get_metadata_n", ret, METADATA_EXTRACTOR_ERROR_INVALID_PARAMETER, "Must return METADATA_EXTRACTOR_ERROR_INVALID_PARAMETER in case of invalid parameter");
+}
+
+/**
+ * @brief Positive test case of metadata_extractor_get_metadata()
+ */
+static void utc_metadata_extractor_get_metadata_p(void)
+{
+ int ret = METADATA_EXTRACTOR_ERROR_NONE;
+ char * value = NULL;
+
+ ret = metadata_extractor_get_metadata(metadata, METADATA_TITLE, &value);
+ if(value)
+ free(value);
+
+ dts_check_eq("utc_metadata_extractor_get_metadata_p", ret, METADATA_EXTRACTOR_ERROR_NONE, "Failed to get metadata");
+}
+
+/**
+ * @brief Negative test case of metadata_extractor_get_artwork()
+ */
+static void utc_metadata_extractor_get_artwork_n(void)
+{
+ int ret = METADATA_EXTRACTOR_ERROR_NONE;
+ void * artwork = NULL;
+ char * artwork_mime = NULL;
+ int artwork_size = 0;
+
+ ret = metadata_extractor_get_artwork(NULL, &artwork, &artwork_size, &artwork_mime);
+
+ dts_check_eq("utc_metadata_extractor_get_artwork_n", ret, METADATA_EXTRACTOR_ERROR_INVALID_PARAMETER, "Must return METADATA_EXTRACTOR_ERROR_INVALID_PARAMETER in case of invalid parameter");
+}
+
+/**
+ * @brief Positive test case of metadata_extractor_get_artwork()
+ */
+static void utc_metadata_extractor_get_artwork_p(void)
+{
+ int ret = METADATA_EXTRACTOR_ERROR_NONE;
+ void * artwork = NULL;
+ char * artwork_mime = NULL;
+ int artwork_size = 0;
+
+ ret = metadata_extractor_get_artwork(metadata, &artwork, &artwork_size, &artwork_mime);
+ if(artwork)
+ free(artwork);
+ if(artwork_mime)
+ free(artwork_mime);
+
+ dts_check_eq("utc_metadata_extractor_get_artwork_p", ret, METADATA_EXTRACTOR_ERROR_NONE, "Failed to get artwork");
+}
+
+/**
+ * @brief Negative test case of metadata_extractor_get_frame()
+ */
+static void utc_metadata_extractor_get_frame_n(void)
+{
+ int ret = METADATA_EXTRACTOR_ERROR_NONE;
+ void * frame = NULL;
+ int frame_size = 0;
+
+ ret = metadata_extractor_get_frame(NULL, &frame, &frame_size);
+
+ dts_check_eq("utc_metadata_extractor_get_frame_n", ret, METADATA_EXTRACTOR_ERROR_INVALID_PARAMETER, "Must return METADATA_EXTRACTOR_ERROR_INVALID_PARAMETER in case of invalid parameter");
+}
+
+/**
+ * @brief Positive test case of metadata_extractor_get_frame()
+ */
+static void utc_metadata_extractor_get_frame_p(void)
+{
+ int ret = METADATA_EXTRACTOR_ERROR_NONE;
+ void * frame = NULL;
+ int frame_size = 0;
+
+ ret = metadata_extractor_get_frame(metadata, &frame, &frame_size);
+ if(frame)
+ free(frame);
+
+ dts_check_eq("utc_metadata_extractor_get_frame_p", ret, METADATA_EXTRACTOR_ERROR_NONE, "Failed to get frame");
+}
+
+/**
+ * @brief Negative test case of metadata_extractor_get_synclyrics()
+ */
+static void utc_metadata_extractor_get_synclyrics_n(void)
+{
+ int ret = METADATA_EXTRACTOR_ERROR_NONE;
+ unsigned long time_info = 0;
+ char * lyrics = NULL;
+
+ ret = metadata_extractor_get_synclyrics(NULL, 1, &time_info, &lyrics);
+
+ dts_check_eq("utc_metadata_extractor_get_synclyrics_n", ret, METADATA_EXTRACTOR_ERROR_INVALID_PARAMETER, "Must return METADATA_EXTRACTOR_ERROR_INVALID_PARAMETER in case of invalid parameter");
+}
+
+/**
+ * @brief Positive test case of metadata_extractor_get_synclyrics()
+ */
+static void utc_metadata_extractor_get_synclyrics_p(void)
+{
+ int ret = METADATA_EXTRACTOR_ERROR_NONE;
+ unsigned long time_info = 0;
+ char * lyrics = NULL;
+
+ ret = metadata_extractor_get_synclyrics(metadata, 1, &time_info, &lyrics);
+ if(lyrics)
+ free(lyrics);
+
+ dts_check_eq("utc_metadata_extractor_get_synclyrics_p", ret, METADATA_EXTRACTOR_ERROR_NONE, "Failed to get lyrics");
+}
+
+/**
+ * @brief Negative test case of metadata_extractor_destroy()
+ */
+static void utc_metadata_extractor_destroy_n(void)
+{
+ int ret = METADATA_EXTRACTOR_ERROR_NONE;
+
+ ret = metadata_extractor_destroy(NULL);
+
+ dts_check_eq("utc_metadata_extractor_destroy_n", ret, METADATA_EXTRACTOR_ERROR_INVALID_PARAMETER, "Must return METADATA_EXTRACTOR_ERROR_INVALID_PARAMETER in case of invalid parameter");
+}
+
+/**
+ * @brief Positive test case of metadata_extractor_destroy()
+ */
+
+static void utc_metadata_extractor_destroy_p(void)
+{
+ int ret = METADATA_EXTRACTOR_ERROR_NONE;
+
+ ret = metadata_extractor_destroy(metadata);
+
+ dts_check_eq("utc_metadata_extractor_destroy_p", ret, METADATA_EXTRACTOR_ERROR_NONE, "Failed to destroy handle");
+}
+
diff --git a/TC/tet_scen b/TC/tet_scen
new file mode 100755
index 0000000..03f029a
--- /dev/null
+++ b/TC/tet_scen
@@ -0,0 +1,7 @@
+all
+ ^TEST
+##### Scenarios for TEST #####
+
+# Test scenario
+TEST
+ :include:/testcase/tslist
diff --git a/TC/tet_xres b/TC/tet_xres
new file mode 100755
index 0000000..a2e94c2
--- /dev/null
+++ b/TC/tet_xres
@@ -0,0 +1,21 @@
+15|0 3.7-lite 4|TCM Start
+400|0 1 1 03:32:00|IC Start
+200|0 1 03:32:00|TP Start
+520|-1 1 00002484 1 1|20000207 03:32:00__[__type=CheckPass, api_name=utc_wav_player_start_p, file=(null)/utc_wav_player.c, func=utc_wav_player_start_p, line=48__]__
+220|0 1 0 03:32:00|PASS
+410|0 1 1 03:32:00|IC End
+400|0 2 1 03:32:00|IC Start
+200|0 2 03:32:00|TP Start
+520|-1 2 00002484 1 2|20000207 03:32:00__[__type=CheckPass, api_name=utc_wav_player_start_n, file=(null)/utc_wav_player.c, func=utc_wav_player_start_n, line=54__]__
+220|0 2 0 03:32:00|PASS
+410|0 2 1 03:32:00|IC End
+400|0 3 1 03:32:00|IC Start
+200|0 3 03:32:00|TP Start
+520|-1 3 00002484 1 3|20000207 03:32:00__[__type=CheckPass, api_name=utc_wav_player_stop_p, file=(null)/utc_wav_player.c, func=utc_wav_player_stop_p, line=62__]__
+220|0 3 0 03:32:00|PASS
+410|0 3 1 03:32:00|IC End
+400|0 4 1 03:32:00|IC Start
+200|0 4 03:32:00|TP Start
+520|-1 4 00002484 1 4|20000207 03:32:00__[__type=CheckPass, api_name=utc_wav_player_stop_n, file=(null)/utc_wav_player.c, func=utc_wav_player_stop_n, line=68__]__
+220|0 4 0 03:32:00|PASS
+410|0 4 1 03:32:00|IC End
diff --git a/TC/tetbuild.cfg b/TC/tetbuild.cfg
new file mode 100755
index 0000000..f7eda55
--- /dev/null
+++ b/TC/tetbuild.cfg
@@ -0,0 +1,5 @@
+TET_OUTPUT_CAPTURE=True # capture option for build operation checking
+TET_BUILD_TOOL=make # build with using make command
+TET_BUILD_FILE=-f Makefile # execution file (Makefile) for build
+TET_API_COMPLIANT=True # use TET API in Test Case ?
+TET_PASS_TC_NAME=True # report passed TC name in Journal file?
diff --git a/TC/tetclean.cfg b/TC/tetclean.cfg
new file mode 100755
index 0000000..02d7030
--- /dev/null
+++ b/TC/tetclean.cfg
@@ -0,0 +1,5 @@
+TET_OUTPUT_CAPTURE=True # capture option
+TET_CLEAN_TOOL= make clean # clean tool
+TET_CLEAN_FILE= Makefile # file for clean
+TET_API_COMPLIANT=True # TET API useage
+TET_PASS_TC_NAME=True # showing name , passed TC
diff --git a/TC/tetexec.cfg b/TC/tetexec.cfg
new file mode 100755
index 0000000..ef3e452
--- /dev/null
+++ b/TC/tetexec.cfg
@@ -0,0 +1,5 @@
+TET_OUTPUT_CAPTURE=True # capturing execution or not
+TET_EXEC_TOOL= # ex) exec : execution tool set up/ Optional
+TET_EXEC_FILE= # ex) exectool : execution file/ Optional
+TET_API_COMPLIANT=True # Test case or Tool usesTET API?
+TET_PASS_TC_NAME=True # showing Passed TC name ?