diff options
Diffstat (limited to 'TC/utc')
-rwxr-xr-x | TC/utc/Makefile | 45 | ||||
-rw-r--r-- | TC/utc/tet_captured | 1 | ||||
-rw-r--r-- | TC/utc/tet_scen | 0 | ||||
-rwxr-xr-x | TC/utc/tslist | 4 | ||||
-rw-r--r-- | TC/utc/utc_mm_session_common.h | 66 | ||||
-rw-r--r-- | TC/utc/utc_mm_session_finish_func.c | 115 | ||||
-rw-r--r-- | TC/utc/utc_mm_session_init_ex_func.c | 123 | ||||
-rw-r--r-- | TC/utc/utc_mm_session_init_func.c | 145 |
8 files changed, 499 insertions, 0 deletions
diff --git a/TC/utc/Makefile b/TC/utc/Makefile new file mode 100755 index 0000000..5cd41ae --- /dev/null +++ b/TC/utc/Makefile @@ -0,0 +1,45 @@ +ifeq ($(ARCH),target)
+ PKG_CONFIG_PATH=/usr/lib/pkgconfig
+ export PKG_CONFIG_PATH
+ CC=arm-linux-gcc -Wall
+ CXX=arm-linux-g++ -Wall
+else
+ PKG_CONFIG_PATH=/usr/lib/pkgconfig
+ export PKG_CONFIG_PATH
+ CC=gcc -Wall
+ CXX=gcc -Wall
+endif
+
+TS1=utc_mm_session_init_func
+TS2=utc_mm_session_init_ex_func
+TS3=utc_mm_session_finish_func
+
+LIBS = `pkg-config --libs mm-session`
+LIBS +=-L/usr/lib/:/usr/lib/pkgconfig
+LIBS +=$(TET_ROOT)/lib/tet3/tcm_s.o
+LIBS +=-L$(TET_ROOT)/lib/tet3 -ltcm_s
+LIBS +=-L$(TET_ROOT)/lib/tet3/ -lapi_s
+
+INCS = -I. `pkg-config --cflags mm-session `
+INCS += -I$(TET_ROOT)/inc/tet3
+INCS += -I/usr/include/mmf
+
+CFLAGS = $(INCS)
+CC += $(CFLAGS)
+LDFLAGS = $(LIBS)
+
+all : $(TS1) $(TS2)
+
+$(TS1): $(TS1).c
+ $(CC) -o $(TS1) $(TS1).c $(LDFLAGS)
+
+$(TS2): $(TS2).c
+ $(CC) -o $(TS2) $(TS2).c $(LDFLAGS)
+
+$(TS3): $(TS3).c
+ $(CC) -o $(TS3) $(TS3).c $(LDFLAGS)
+clean:
+ rm -rf *~ *.o $(TS1) $(TS2) $(TS3)
+
+
+
diff --git a/TC/utc/tet_captured b/TC/utc/tet_captured new file mode 100644 index 0000000..d9c7e4a --- /dev/null +++ b/TC/utc/tet_captured @@ -0,0 +1 @@ +make: `utc_mm_session_finish_func' is up to date. diff --git a/TC/utc/tet_scen b/TC/utc/tet_scen new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/TC/utc/tet_scen diff --git a/TC/utc/tslist b/TC/utc/tslist new file mode 100755 index 0000000..603acde --- /dev/null +++ b/TC/utc/tslist @@ -0,0 +1,4 @@ +./utc_mm_session_init_func +./utc_mm_session_init_ex_func +./utc_mm_session_finish_func + diff --git a/TC/utc/utc_mm_session_common.h b/TC/utc/utc_mm_session_common.h new file mode 100644 index 0000000..b35d59b --- /dev/null +++ b/TC/utc/utc_mm_session_common.h @@ -0,0 +1,66 @@ +/*
+ * libmm-session
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Seungbae Shin <seungbae.shin@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.
+ *
+ */
+
+
+/**
+* @file uts_mmf_session_common.h
+* @brief This is a suite of unit test cases for Session APIs.
+* @version Initial Creation V0.1
+* @date 2010.07.06
+*/
+
+
+#ifndef UTS_MM_FRAMEWORK_SESSION_COMMON_H
+#define UTS_MM_FRAMEWORK_SESSION_COMMON_H
+
+
+#include <mm_session.h>
+#include <mm_message.h>
+#include <mm_error.h>
+#include <mm_types.h>
+#include <stdio.h>
+#include <string.h>
+#include <tet_api.h>
+#include <unistd.h>
+#include <glib.h>
+
+
+void startup();
+void cleanup();
+
+void (*tet_startup)() = startup;
+void (*tet_cleanup)() = cleanup;
+
+
+void utc_mm_session_init_func_01 ();
+void utc_mm_session_init_func_02 ();
+void utc_mm_session_init_func_03 ();
+void utc_mm_session_init_func_04 ();
+
+void utc_mm_session_finish_func_01 ();
+void utc_mm_session_finish_func_02 ();
+
+
+void utc_mm_session_init_ex_func_01();
+void utc_mm_session_init_ex_func_02();
+
+
+#endif /* UTS_MM_FRAMEWORK_SESSION_COMMON_H */
diff --git a/TC/utc/utc_mm_session_finish_func.c b/TC/utc/utc_mm_session_finish_func.c new file mode 100644 index 0000000..5d94242 --- /dev/null +++ b/TC/utc/utc_mm_session_finish_func.c @@ -0,0 +1,115 @@ +/*
+ * libmm-session
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Seungbae Shin <seungbae.shin@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.
+ *
+ */
+
+/**
+* @ingroup MMF_SESSION_API
+* @addtogroup SESSION
+*/
+
+/**
+* @ingroup SESSION
+* @addtogroup UTS_MMF_SESSION Unit
+*/
+
+/**
+* @ingroup UTS_MMF_SESSION Unit
+* @addtogroup UTS_MMF_SESSION_FINISH Uts_Mmf_Session_Finish
+* @{
+*/
+
+/**
+* @file uts_mmf_session_finish.c
+* @brief This is a suit of unit test cases to test mm_session_finish API
+* @version Initial Creation Version 0.1
+* @date 2010.07.06
+*/
+
+
+#include "utc_mm_session_common.h"
+
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+//-------------------------------------------------------------------------------------------------
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// Declare the global variables and registers and Internal Funntions
+//-------------------------------------------------------------------------------------------------
+#define API_NAME "mm_session_finish"
+
+struct tet_testlist tet_testlist[] = {
+ {utc_mm_session_finish_func_01, 1},
+ {utc_mm_session_finish_func_02, 2},
+ {NULL, 0}
+};
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+/* Initialize TCM data structures */
+
+/* Start up function for each test purpose */
+void
+startup ()
+{
+}
+
+/* Clean up function for each test purpose */
+void
+cleanup ()
+{
+}
+
+void utc_mm_session_finish_func_01()
+{
+ int ret = 0;
+
+ /* Define the Multimedia Session Policy*/
+ ret = mm_session_init(MM_SESSION_TYPE_SHARE);
+
+ dts_check_eq(API_NAME, ret, MM_ERROR_NONE,"err=0x%x",ret);
+
+ /* Finish the Multimedia Session */
+ ret = mm_session_finish();
+
+ dts_check_eq(API_NAME, ret, MM_ERROR_NONE,"err=0x%x",ret);
+
+ return;
+}
+
+
+void utc_mm_session_finish_func_02()
+{
+ int ret = 0;
+
+ /* forced cleanup previous session */
+ mm_session_finish();
+
+ /* Finish the Multimedia Session */
+ ret = mm_session_finish();
+
+ dts_check_ne(API_NAME, ret, MM_ERROR_NONE,"err=0x%x",ret);
+
+ return;
+}
+
+
+/** @} */
+
+
+
+
diff --git a/TC/utc/utc_mm_session_init_ex_func.c b/TC/utc/utc_mm_session_init_ex_func.c new file mode 100644 index 0000000..77793d7 --- /dev/null +++ b/TC/utc/utc_mm_session_init_ex_func.c @@ -0,0 +1,123 @@ +/*
+ * libmm-session
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Seungbae Shin <seungbae.shin@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.
+ *
+ */
+
+/**
+* @ingroup MMF_SESSION_API
+* @addtogroup SESSION
+*/
+
+/**
+* @ingroup SESSION
+* @addtogroup UTS_MMF_SESSION Unit
+*/
+
+/**
+* @ingroup UTS_MMF_SESSION Unit
+* @addtogroup UTS_MMF_SESSION_INIT Uts_Mmf_Session_Init
+* @{
+*/
+
+/**
+* @file uts_mmf_session_init.c
+* @brief This is a suit of unit test cases to test mm_session_init API
+* @version Initial Creation Version 0.1
+* @date 2010.07.06
+*/
+
+
+#include "utc_mm_session_common.h"
+
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+//-------------------------------------------------------------------------------------------------
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// Declare the global variables and registers and Internal Funntions
+//-------------------------------------------------------------------------------------------------
+#define API_NAME "mm_session_init_ex"
+
+struct tet_testlist tet_testlist[] = {
+ {utc_mm_session_init_ex_func_01, 1},
+ {utc_mm_session_init_ex_func_02, 2},
+ {NULL, 0}
+};
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+/* Initialize TCM data structures */
+
+/* Start up function for each test purpose */
+void
+startup ()
+{
+}
+
+/* Clean up function for each test purpose */
+void
+cleanup ()
+{
+}
+
+void test_callback(session_msg_t msg, void *user_param)
+{
+ switch(msg)
+ {
+ case MM_SESSION_MSG_STOP:
+ tet_infoline("Message stop called");
+ break;
+ case MM_SESSION_MSG_RESUME:
+ tet_infoline("Message resume called");
+ break;
+ default:
+ break;
+ }
+}
+
+void utc_mm_session_init_ex_func_01()
+{
+ int ret = 0;
+
+ /* Define the Multimedia Session Policy*/
+ ret = mm_session_init_ex(MM_SESSION_TYPE_SHARE, test_callback, NULL);
+
+ dts_check_eq(API_NAME, ret, MM_ERROR_NONE,"err=0x%x",ret);
+
+ mm_session_finish();
+
+ return;
+}
+
+
+void utc_mm_session_init_ex_func_02()
+{
+ int ret = 0;
+
+ /* Define the Multimedia Session Policy*/
+ ret = mm_session_init_ex(100, test_callback, NULL);
+
+ dts_check_ne(API_NAME, ret, MM_ERROR_NONE,"err=0x%x",ret);
+
+ return;
+}
+
+/** @} */
+
+
+
+
diff --git a/TC/utc/utc_mm_session_init_func.c b/TC/utc/utc_mm_session_init_func.c new file mode 100644 index 0000000..b8a6f4d --- /dev/null +++ b/TC/utc/utc_mm_session_init_func.c @@ -0,0 +1,145 @@ +/*
+ * libmm-session
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Seungbae Shin <seungbae.shin@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.
+ *
+ */
+
+/**
+* @ingroup MMF_SESSION_API
+* @addtogroup SESSION
+*/
+
+/**
+* @ingroup SESSION
+* @addtogroup UTS_MMF_SESSION Unit
+*/
+
+/**
+* @ingroup UTS_MMF_SESSION Unit
+* @addtogroup UTS_MMF_SESSION_INIT Uts_Mmf_Session_Init
+* @{
+*/
+
+/**
+* @file uts_mmf_session_init.c
+* @brief This is a suit of unit test cases to test mm_session_init API
+* @version Initial Creation Version 0.1
+* @date 2010.07.06
+*/
+
+
+#include "utc_mm_session_common.h"
+
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+//-------------------------------------------------------------------------------------------------
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// Declare the global variables and registers and Internal Funntions
+//-------------------------------------------------------------------------------------------------
+#define API_NAME "mm_session_init"
+
+struct tet_testlist tet_testlist[] = {
+ {utc_mm_session_init_func_01, 1},
+ {utc_mm_session_init_func_02, 2},
+ {utc_mm_session_init_func_03, 3},
+ {utc_mm_session_init_func_04, 4},
+ {NULL, 0}
+};
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+/* Initialize TCM data structures */
+
+/* Start up function for each test purpose */
+void
+startup ()
+{
+}
+
+/* Clean up function for each test purpose */
+void
+cleanup ()
+{
+}
+
+void utc_mm_session_init_func_01()
+{
+ int ret = 0;
+
+ /* Define the Multimedia Session Policy*/
+ ret = mm_session_init(MM_SESSION_TYPE_SHARE);
+
+ dts_check_eq(API_NAME, ret, MM_ERROR_NONE,"err=0x%x", ret);
+
+ mm_session_finish();
+
+ return;
+}
+
+
+void utc_mm_session_init_func_02()
+{
+ int ret = 0;
+
+ /* forced cleanup previous session */
+ mm_session_finish();
+
+ /* Define the Multimedia Session Policy*/
+ ret = mm_session_init(MM_SESSION_TYPE_EXCLUSIVE);
+
+ dts_check_eq(API_NAME, ret, MM_ERROR_NONE,"err=0x%x",ret);
+
+ mm_session_finish();
+
+ return;
+}
+
+
+void utc_mm_session_init_func_03()
+{
+ int ret = 0;
+
+ tet_infoline( "[[ TET_MSG ]]:: Define the Multimedia Session Policy" );
+
+ /* Define the Multimedia Session Policy*/
+ ret = mm_session_init(-1);
+
+ dts_check_ne(API_NAME, ret, MM_ERROR_NONE,"err=0x%x",ret);
+
+ return;
+}
+
+
+void utc_mm_session_init_func_04()
+{
+ int ret = 0;
+
+ tet_infoline( "[[ TET_MSG ]]:: Define the Multimedia Session Policy" );
+
+ /* Define the Multimedia Session Policy*/
+ ret = mm_session_init(100);
+
+ dts_check_ne(API_NAME, ret, MM_ERROR_NONE,"err=0x%x",ret);
+
+ return;
+}
+
+/** @} */
+
+
+
+
|