--- /dev/null
+/*
+* 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 <wav_player.h>
+#include <pthread.h>
+
+#define TESTFILE "./test.wav"
+
+
+#define API_NAME_WAVPL_START "wav_player_start_playing"
+#define API_NAME_WAVPL_STOP "wav_player_stop_playing"
+#define API_NAME_WAVPL_CALLBACK "wav_player_stop_callback"
+
+
+#define MY_ASSERT( fun , test , msg ) \
+{\
+ if( !test ) \
+ dts_fail(fun , msg ); \
+}
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+
+
+struct
+{
+ int proc_result;
+ int proc_id;
+} glob;
+
+
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+// basic tests for start and stop of play
+static void utc_wav_player_start_p(void);
+static void utc_wav_player_start_n(void);
+static void utc_wav_player_stop_p(void);
+static void utc_wav_player_stop_n(void);
+
+static void utc_wav_player_callback_p(void);
+static void utc_wav_player_callback2_p(void);
+
+
+// more sophisticated tests for input parameters
+static void utc_wav_player_wrong_param_n(void);
+static void utc_wav_player_wrong_param2_n(void);
+static void utc_wav_player_wrong_param3_n(void);
+
+
+struct tet_testlist tet_testlist[] = {
+ { utc_wav_player_start_p , 1 },
+ { utc_wav_player_start_n , 2 },
+ { utc_wav_player_stop_p, 3 },
+ { utc_wav_player_stop_n, 4 },
+ { utc_wav_player_callback_p, 5 },
+ { utc_wav_player_callback2_p, 6 },
+ { utc_wav_player_wrong_param_n, 7 },
+ { utc_wav_player_wrong_param2_n, 8 },
+ { utc_wav_player_wrong_param3_n, 9 },
+ { NULL, 0 },
+};
+
+
+static void startup(void)
+{
+ /* start of TC */
+}
+
+static void cleanup(void)
+{
+ /* end of TC */
+}
+
+
+
+//**********************************************************************/
+
+
+/**
+ * @brief all parameters fine, play music
+ */
+static void utc_wav_player_start_p(void)
+{
+ int ret;
+ ret = wav_player_start(TESTFILE, SOUND_TYPE_MEDIA, NULL, NULL, NULL);
+ dts_check_eq( API_NAME_WAVPL_START, ret, WAV_PLAYER_ERROR_NONE );
+}
+
+
+
+//**********************************************************************/
+
+
+
+/**
+ * @brief lack of sound file path
+ */
+static void utc_wav_player_start_n(void)
+{
+ int ret;
+ ret = wav_player_start(NULL, SOUND_TYPE_MEDIA, NULL, NULL, NULL);
+ dts_check_ne( API_NAME_WAVPL_START, ret, WAV_PLAYER_ERROR_NONE );
+}
+
+
+
+//**********************************************************************/
+
+
+
+/**
+ * @brief stop playing, all parameters fine
+ */
+static void utc_wav_player_stop_p(void)
+{
+ int ret;
+ int id;
+ ret = wav_player_start(TESTFILE, SOUND_TYPE_MEDIA, NULL, NULL, &id);
+ ret = wav_player_stop(id);
+ dts_check_eq( API_NAME_WAVPL_STOP, ret, WAV_PLAYER_ERROR_NONE );
+}
+
+
+
+//**********************************************************************/
+
+
+
+/**
+ * @brief stop playing, wrong id of playing process
+ */
+static void utc_wav_player_stop_n(void)
+{
+ int ret;
+ ret = wav_player_stop(-1);
+ dts_check_ne( API_NAME_WAVPL_STOP, ret, WAV_PLAYER_ERROR_NONE );
+}
+
+
+
+//**********************************************************************/
+
+
+//**********************************************************************/
+
+
+
+/**
+ * @brief wrong parameter: wrong file name
+ */
+static void utc_wav_player_wrong_param_n(void)
+{
+ int ret;
+ char file_name[100] = { '\0' };
+ snprintf( file_name, 100 , "%s", TESTFILE );
+ snprintf( file_name, 100 , "%s", "something" );
+
+ ret = wav_player_start( file_name, SOUND_TYPE_MEDIA, NULL, NULL, NULL );
+ dts_check_ne( API_NAME_WAVPL_START, ret, WAV_PLAYER_ERROR_NONE );
+}
+
+
+
+
+//**********************************************************************/
+
+
+
+/**
+ * @brief wrong parameter: wrong media file type
+ */
+static void utc_wav_player_wrong_param2_n(void)
+{
+ int ret;
+
+ ret = wav_player_start( TESTFILE, SOUND_TYPE_CALL + 1, NULL, NULL, NULL );
+ dts_check_ne( API_NAME_WAVPL_START, ret, WAV_PLAYER_ERROR_NONE );
+}
+
+
+
+//**********************************************************************/
+
+
+
+/**
+ * @brief wrong parameter: wrong media file type
+ */
+static void utc_wav_player_wrong_param3_n(void)
+{
+ int ret;
+
+ ret = wav_player_start( TESTFILE, -1, NULL, NULL, NULL );
+ dts_check_ne( API_NAME_WAVPL_START, ret, WAV_PLAYER_ERROR_NONE );
+}
+
+
+//************************************************************************/
+
+void _playback_completed_cb(int id, void *user_data){
+ int *result = (int*)user_data;
+ *result = 1;
+}
+
+static void utc_wav_player_callback_p(void)
+{
+ int ret ;
+ int result = 0;
+
+ ret = wav_player_start( TESTFILE, SOUND_TYPE_MEDIA, _playback_completed_cb, &result, NULL );
+ sleep(6);
+ dts_check_eq( API_NAME_WAVPL_CALLBACK, result , 1 );
+
+}
+
+//************************************************************************/
+
+void _playback_completed_cb2(int id, void *user_data){
+ int *result = (int*)user_data;
+ *result = id;
+}
+
+
+static void utc_wav_player_callback2_p(void){
+
+ int ret ;
+ int callback_id = 0;
+ int id;
+
+ ret = wav_player_start( TESTFILE, SOUND_TYPE_MEDIA, _playback_completed_cb2, &callback_id, &id );
+
+ sleep(6);
+ dts_check_eq( API_NAME_WAVPL_CALLBACK, callback_id , id );
+
+
+}
capi-media-wav-player (0.1.0-7) unstable; urgency=low
* update parameter check code
- * Git: api/wav-player
+ * Git: slp/api/wav-player
* Tag: capi-media-wav-player_0.1.0-7
- -- Seungkeun Lee <sngn.lee@samsung.com> Wed, 21 Dec 2011 20:08:50 +0900
+ -- Seungkeun Lee <sngn.lee@samsung.com> Wed, 21 Dec 2011 20:04:57 +0900
capi-media-wav-player (0.1.0-6) unstable; urgency=low
- * update version
+ * Update error none value
+ * Git: slp-source.sec.samsung.net:slp/api/wav-player
+ * Tag: capi-media-wav-player_0.1.0-6
+
+ -- Seungkeun Lee <sngn.lee@samsung.com> Mon, 05 Dec 2011 11:11:04 +0900
+
+capi-media-wav-player (0.1.0-5) unstable; urgency=low
+
+ * Update log formatting
+ * Git: slp-source.sec.samsung.net:slp/api/wav-player
+ * Tag: capi-media-wav-player_0.1.0-5
+
+ -- Seungkeun Lee <sngn.lee@samsung.com> Sun, 27 Nov 2011 14:24:24 +0900
+
+capi-media-wav-player (0.1.0-4) unstable; urgency=low
+
+ * Static analysis bug fix
+ * Git: slp-source.sec.samsung.net:slp/api/wav-player
+ * Tag: capi-media-wav-player_0.1.0-4
+
+ -- Seungkeun Lee <sngn.lee@samsung.com> Fri, 25 Nov 2011 09:57:34 +0900
+
+capi-media-wav-player (0.1.0-3) unstable; urgency=low
+
+ * update namespace
+ * Git: slp-source.sec.samsung.net:slp/api/wav-player
+ * Tag: capi-media-wav-player_0.1.0-3
+
+ -- Seungkeun Lee <sngn.lee@samsung.com> Wed, 23 Nov 2011 13:08:19 +0900
+
+capi-media-wav-player (0.1.0-2) unstable; urgency=low
+
+ * update complete callback signature
+ * Git: slp-source.sec.samsung.net:slp/api/wav-player
+ * Tag: capi-media-wav-player_0.1.0-2
+
+ -- Seungkeun Lee <sngn.lee@samsung.com> Tue, 22 Nov 2011 08:50:29 +0900
+
+capi-media-wav-player (0.1.0-1) unstable; urgency=low
+
+ * SDK API Baseline
+ * Git: slp-source.sec.samsung.net:slp/api/wav-player
+ * Tag: capi-media-wav-player_0.1.0-1
+
+ -- Seungkeun Lee <sngn.lee@samsung.com> Tue, 27 Sep 2011 17:48:47 +0900
+
+capi-media-wav-player (0.0.1-4) unstable; urgency=low
+
+ * update wav_player_playback_completed_cb
+ * Git: slp-source.sec.samsung.net:slp/api/wav-player
+ * Tag: capi-media-wav-player_0.0.1-4
+
+ -- Seungkeun Lee <sngn.lee@samsung.com> Thu, 22 Sep 2011 09:46:11 +0900
+
+capi-media-wav-player (0.0.1-3) unstable; urgency=low
+
+ * Update dependancy
+ * Git: slp-source.sec.samsung.net:slp/api/wav-player
+ * Tag: capi-media-wav-player_0.0.1-3
+
+ -- Seungkeun Lee <sngn.lee@samsung.com> Mon, 29 Aug 2011 17:32:48 +0900
+
+capi-media-wav-player (0.0.1-2) unstable; urgency=low
+
+ * Update dependancy
+ * Git: slp-source.sec.samsung.net:slp/api/wav-player
+ * Tag: capi-media-wav-player_0.0.1-2
- -- Seungkeun Lee <sngn.lee@samsung.com> Thu, 15 Dec 2011 12:56:57 +0900
+ -- Seungkeun Lee <sngn.lee@samsung.com> Mon, 29 Aug 2011 14:58:29 +0900
capi-media-wav-player (0.0.1-1) unstable; urgency=low
- * Initial release.
+ * Initial Upload
+ * Git: slp-source.sec.samsung.net:slp/api/wav-player
+ * Tag: capi-media-wav-player_0.0.1-1
- -- Seungkeun Lee <sngn.lee@samsung.com> Wed, 07 Dec 2011 12:54:34 +0900
+ -- Seungkeun Lee <sngn.lee@samsung.com> Thu, 04 Aug 2011 17:32:41 +0900