pkg_check_modules(${fw_name} REQUIRED ${dependents})
FOREACH(flag ${${fw_name}_CFLAGS})
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ SET(EXTRA_CXXFLAGS "${EXTRA_CXXFLAGS} ${flag}")
ENDFOREACH(flag)
IF(BUILD_GCOV)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Werror -fprofile-arcs -ftest-coverage")
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CXXFLAGS} -fPIC -Wall -Werror -fprofile-arcs -ftest-coverage")
ELSE(BUILD_GCOV)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Werror")
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CXXFLAGS} -fPIC -Wall -Werror")
ENDIF(BUILD_GCOV)
SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
+SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
ADD_DEFINITIONS("-DTIZEN_DEBUG")
ADD_SUBDIRECTORY(test)
+IF(BUILD_GCOV)
+ ADD_SUBDIRECTORY(unittest)
+ENDIF(BUILD_GCOV)
BuildRequires: python
Buildrequires: python-xml
+%if 0%{?gcov:1}
+BuildRequires: gtest-devel
+BuildRequires: lcov
+%endif
+
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj
%endif
+%check
+%if 0%{?gcov:1}
+pushd unittest
+./run_coverage.sh
+popd
+%endif
+
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
CHECK_INIT();
CHECK_ACTIVATED();
cond_expr_ret(mtp_devices == NULL, MTP_ERROR_INVALID_PARAMETER);
-
- /* LCOV_EXCL_START */
cond_expr_ret(device_count == NULL, MTP_ERROR_INVALID_PARAMETER);
/* precondition check end */
_END();
return ret;
- /* LCOV_EXCL_STOP */
}
int mtp_get_storages(int mtp_device, int **mtp_storages, int* storage_count)
CHECK_ACTIVATED();
cond_expr_ret(mtp_device == 0, MTP_ERROR_INVALID_PARAMETER);
- /* LCOV_EXCL_START */
cond_expr_ret(mtp_storages == NULL, MTP_ERROR_INVALID_PARAMETER);
cond_expr_ret(storage_count == NULL, MTP_ERROR_INVALID_PARAMETER);
_END();
return ret;
- /* LCOV_EXCL_STOP */
}
int mtp_get_object_handles(int mtp_device, int mtp_storage, mtp_filetype_e file_type,
CHECK_INIT();
CHECK_ACTIVATED();
cond_expr_ret(mtp_device == 0, MTP_ERROR_INVALID_PARAMETER);
-
- /* LCOV_EXCL_START */
cond_expr_ret(mtp_storage == 0, MTP_ERROR_INVALID_PARAMETER);
cond_expr_ret(object_handles == NULL, MTP_ERROR_INVALID_PARAMETER);
cond_expr_ret(object_count == NULL, MTP_ERROR_INVALID_PARAMETER);
_END();
return ret;
- /* LCOV_EXCL_STOP */
}
-/* LCOV_EXCL_START */
int mtp_delete_object(int mtp_device, int object_handle)
{
int ret = MTP_ERROR_NONE;
return ret;
}
-/* LCOV_EXCL_STOP */
int mtp_get_object(int mtp_device, int object_handle, char *dest_path)
{
CHECK_INIT();
CHECK_ACTIVATED();
cond_expr_ret(mtp_device == 0, MTP_ERROR_INVALID_PARAMETER);
-
- /* LCOV_EXCL_START */
cond_expr_ret(dest_path == NULL, MTP_ERROR_INVALID_PARAMETER);
/* precondition check end */
_END();
return ret;
- /* LCOV_EXCL_STOP */
}
int mtp_get_partial_object(int mtp_device, int object_handle, char *dest_path, int offset, int max_bytes, int *actual_written)
cond_expr_ret(mtp_device == 0, MTP_ERROR_INVALID_PARAMETER);
cond_expr_ret(offset < 0, MTP_ERROR_INVALID_PARAMETER);
cond_expr_ret(max_bytes < 0, MTP_ERROR_INVALID_PARAMETER);
-
- /* LCOV_EXCL_START */
cond_expr_ret(dest_path == NULL, MTP_ERROR_INVALID_PARAMETER);
/* precondition check end */
_END();
return ret;
- /* LCOV_EXCL_STOP */
}
int mtp_get_thumbnail(int mtp_device, int object_handle, char *dest_path)
CHECK_INIT();
CHECK_ACTIVATED();
cond_expr_ret(mtp_device == 0, MTP_ERROR_INVALID_PARAMETER);
-
- /* LCOV_EXCL_START */
cond_expr_ret(dest_path == NULL, MTP_ERROR_INVALID_PARAMETER);
/* precondition check end */
_END();
return ret;
- /* LCOV_EXCL_STOP */
}
int mtp_add_mtp_event_cb(mtp_event_cb callback, void *user_data)
/* precondition check end */
- /* LCOV_EXCL_START */
ret = mtp_gdbus_deviceinfo_get_manufacturer_name(mtp_device, manufacturer_name);
TC_PRT("manufacturername %s", *manufacturer_name);
_END();
return ret;
- /* LCOV_EXCL_STOP */
}
int mtp_deviceinfo_get_model_name(int mtp_device, char **model_name)
/* precondition check end */
- /* LCOV_EXCL_START */
ret = mtp_gdbus_deviceinfo_get_model_name(mtp_device, model_name);
TC_PRT("modelname %s", *model_name);
_END();
return ret;
- /* LCOV_EXCL_STOP */
}
int mtp_deviceinfo_get_serial_number(int mtp_device, char **serial_number)
/* precondition check end */
- /* LCOV_EXCL_START */
ret = mtp_gdbus_deviceinfo_get_serial_number(mtp_device, serial_number);
TC_PRT("serial number %s", *serial_number);
_END();
return ret;
- /* LCOV_EXCL_STOP */
}
int mtp_deviceinfo_get_device_version(int mtp_device, char **device_version)
/* precondition check end */
- /* LCOV_EXCL_START */
ret = mtp_gdbus_deviceinfo_get_device_version(mtp_device, device_version);
TC_PRT("device version %s", *device_version);
_END();
return ret;
- /* LCOV_EXCL_STOP */
}
-/* LCOV_EXCL_START */
int mtp_deviceinfo_get_bus_location(int mtp_device, int *bus_location)
{
int ret = MTP_ERROR_NONE;
return ret;
}
-/* LCOV_EXCL_STOP */
/* Storage Info */
int mtp_storageinfo_get_description(int mtp_device, int mtp_storage, char **description)
CHECK_INIT();
CHECK_ACTIVATED();
cond_expr_ret(mtp_device == 0, MTP_ERROR_INVALID_PARAMETER);
-
- /* LCOV_EXCL_START */
cond_expr_ret(mtp_storage == 0, MTP_ERROR_INVALID_PARAMETER);
/* precondition check end */
_END();
return ret;
- /* LCOV_EXCL_STOP */
}
int mtp_storageinfo_get_free_space(int mtp_device, int mtp_storage, unsigned long long *free_space)
CHECK_INIT();
CHECK_ACTIVATED();
cond_expr_ret(mtp_device == 0, MTP_ERROR_INVALID_PARAMETER);
-
- /* LCOV_EXCL_START */
cond_expr_ret(mtp_storage == 0, MTP_ERROR_INVALID_PARAMETER);
/* precondition check end */
_END();
return ret;
- /* LCOV_EXCL_STOP */
}
int mtp_storageinfo_get_max_capacity(int mtp_device, int mtp_storage, unsigned long long *max_capacity)
CHECK_INIT();
CHECK_ACTIVATED();
cond_expr_ret(mtp_device == 0, MTP_ERROR_INVALID_PARAMETER);
-
- /* LCOV_EXCL_START */
cond_expr_ret(mtp_storage == 0, MTP_ERROR_INVALID_PARAMETER);
/* precondition check end */
_END();
return ret;
- /* LCOV_EXCL_STOP */
}
int mtp_storageinfo_get_storage_type(int mtp_device, int mtp_storage, mtp_storage_type_e *storage_type)
CHECK_INIT();
CHECK_ACTIVATED();
cond_expr_ret(mtp_device == 0, MTP_ERROR_INVALID_PARAMETER);
-
- /* LCOV_EXCL_START */
cond_expr_ret(mtp_storage == 0, MTP_ERROR_INVALID_PARAMETER);
/* precondition check end */
_END();
return ret;
- /* LCOV_EXCL_STOP */
}
int mtp_storageinfo_get_volume_identifier(int mtp_device, int mtp_storage, char **volume_identifier)
CHECK_INIT();
CHECK_ACTIVATED();
cond_expr_ret(mtp_device == 0, MTP_ERROR_INVALID_PARAMETER);
-
- /* LCOV_EXCL_START */
cond_expr_ret(mtp_storage == 0, MTP_ERROR_INVALID_PARAMETER);
/* precondition check end */
_END();
return ret;
- /* LCOV_EXCL_STOP */
}
/* Object Info */
/* precondition check end */
- /* LCOV_EXCL_START */
ret = mtp_gdbus_objectinfo_get_property(mtp_device,
object_handle, MTP_PROPERTY_PARENT_OBJECT_HANDLE, parent_object_handle);
_END();
return ret;
- /* LCOV_EXCL_STOP */
}
int mtp_objectinfo_get_storage(int mtp_device, int object_handle,
/* precondition check end */
- /* LCOV_EXCL_START */
ret = mtp_gdbus_objectinfo_get_property(mtp_device,
object_handle, MTP_PROPERTY_STORAGE, mtp_storage);
_END();
return ret;
- /* LCOV_EXCL_STOP */
}
int mtp_objectinfo_get_association_desc(int mtp_device,
/* precondition check end */
- /* LCOV_EXCL_START */
ret = mtp_gdbus_objectinfo_get_property(mtp_device,
object_handle, MTP_PROPERTY_ASSOCIATION_DESC, asso_desc);
_END();
return ret;
- /* LCOV_EXCL_STOP */
}
int mtp_objectinfo_get_association_type(int mtp_device,
/* precondition check end */
- /* LCOV_EXCL_START */
ret = mtp_gdbus_objectinfo_get_property(mtp_device,
object_handle, MTP_PROPERTY_ASSOCIATION_TYPE, asso_type);
_END();
return ret;
- /* LCOV_EXCL_STOP */
}
int mtp_objectinfo_get_size(int mtp_device, int object_handle, int *size)
/* precondition check end */
- /* LCOV_EXCL_START */
ret = mtp_gdbus_objectinfo_get_property(mtp_device,
object_handle, MTP_PROPERTY_SIZE, size);
_END();
return ret;
- /* LCOV_EXCL_STOP */
}
int mtp_objectinfo_get_date_created(int mtp_device,
/* precondition check end */
- /* LCOV_EXCL_START */
ret = mtp_gdbus_objectinfo_get_property(mtp_device,
object_handle, MTP_PROPERTY_DATE_CREATED, data_created);
_END();
return ret;
- /* LCOV_EXCL_STOP */
}
int mtp_objectinfo_get_date_modified(int mtp_device,
/* precondition check end */
- /* LCOV_EXCL_START */
ret = mtp_gdbus_objectinfo_get_property(mtp_device,
object_handle, MTP_PROPERTY_DATE_MODIFIED, data_modified);
_END();
return ret;
- /* LCOV_EXCL_STOP */
}
int mtp_objectinfo_get_file_type(int mtp_device, int object_handle, mtp_filetype_e *file_type)
/* precondition check end */
- /* LCOV_EXCL_START */
ret = mtp_gdbus_objectinfo_get_property(mtp_device,
object_handle, MTP_PROPERTY_FILE_TYPE, (int*)file_type);
_END();
return ret;
- /* LCOV_EXCL_STOP */
}
int mtp_objectinfo_get_image_bit_depth(int mtp_device,
/* precondition check end */
- /* LCOV_EXCL_START */
ret = mtp_gdbus_objectinfo_get_property(mtp_device,
object_handle, MTP_PROPERTY_IMAGE_BIT_DEPTH, depth);
_END();
return ret;
- /* LCOV_EXCL_STOP */
}
int mtp_objectinfo_get_image_pix_width(int mtp_device,
/* precondition check end */
- /* LCOV_EXCL_START */
ret = mtp_gdbus_objectinfo_get_property(mtp_device,
object_handle, MTP_PROPERTY_IMAGE_PIX_WIDTH, width);
_END();
return ret;
- /* LCOV_EXCL_STOP */
}
int mtp_objectinfo_get_image_pix_height(int mtp_device,
/* precondition check end */
- /* LCOV_EXCL_START */
ret = mtp_gdbus_objectinfo_get_property(mtp_device,
object_handle, MTP_PROPERTY_IMAGE_PIX_HEIGHT, height);
_END();
return ret;
- /* LCOV_EXCL_STOP */
}
int mtp_objectinfo_get_thumbnail_size(int mtp_device,
/* precondition check end */
- /* LCOV_EXCL_START */
ret = mtp_gdbus_objectinfo_get_property(mtp_device,
object_handle, MTP_PROPERTY_THUMBNAIL_SIZE, size);
_END();
return ret;
- /* LCOV_EXCL_STOP */
}
int mtp_objectinfo_get_thumbnail_file_type(int mtp_device,
/* precondition check end */
- /* LCOV_EXCL_START */
ret = mtp_gdbus_objectinfo_get_property(mtp_device,
object_handle, MTP_PROPERTY_THUMBNAIL_FILE_TYPE, (int*)file_type);
_END();
return ret;
- /* LCOV_EXCL_STOP */
}
int mtp_objectinfo_get_thumbnail_pix_height(int mtp_device,
/* precondition check end */
- /* LCOV_EXCL_START */
ret = mtp_gdbus_objectinfo_get_property(mtp_device,
object_handle, MTP_PROPERTY_THUMBNAIL_HEIGHT, height);
_END();
return ret;
- /* LCOV_EXCL_STOP */
}
int mtp_objectinfo_get_thumbnail_pix_width(int mtp_device,
/* precondition check end */
- /* LCOV_EXCL_START */
ret = mtp_gdbus_objectinfo_get_property(mtp_device,
object_handle, MTP_PROPERTY_THUMBNAIL_WIDTH, width);
_END();
return ret;
- /* LCOV_EXCL_STOP */
}
int mtp_objectinfo_get_file_name(int mtp_device,
/* precondition check end */
- /* LCOV_EXCL_START */
ret = mtp_gdbus_objectinfo_get_property_string(mtp_device,
object_handle, MTP_PROPERTY_FILENAME, filename);
_END();
return ret;
- /* LCOV_EXCL_STOP */
}
int mtp_objectinfo_get_keywords(int mtp_device,
/* precondition check end */
- /* LCOV_EXCL_START */
ret = mtp_gdbus_objectinfo_get_property_string(mtp_device,
object_handle, MTP_PROPERTY_KEYWORDS, keywords);
_END();
return ret;
- /* LCOV_EXCL_STOP */
}
-/* LCOV_EXCL_START */
int mtp_objectinfo_get_object_info(int mtp_device,
int object_handle, mtp_object_info **object_info)
{
return ret;
}
-/* LCOV_EXCL_STOP */
static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
static sqlite3 *db;
-/* LCOV_EXCL_START */
mtp_error_e mtp_db_init()
{
int ret = MTP_ERROR_NONE;
SQLITE_OPEN_FULLMUTEX | SQLITE_OPEN_READWRITE, NULL);
if (sql_ret != SQLITE_OK)
- ret = MTP_ERROR_DB;
+ ret = MTP_ERROR_DB; /* LCOV_EXCL_LINE */
}
MTP_DB_UNLOCK;
MTP_DB_LOCK;
if (db == NULL) {
- MTP_DB_UNLOCK;
- return MTP_ERROR_DB;
+ MTP_DB_UNLOCK; /* LCOV_EXCL_LINE */
+ return MTP_ERROR_DB; /* LCOV_EXCL_LINE */
}
*object_info = (mtp_object_info *)malloc(sizeof(mtp_object_info));
sql_ret = sqlite3_close(db);
if (sql_ret != SQLITE_OK)
- ret = MTP_ERROR_DB;
+ ret = MTP_ERROR_DB; /* LCOV_EXCL_LINE */
db = NULL;
}
MTP_DB_UNLOCK;
return ret;
-}
-/* LCOV_EXCL_STOP */
\ No newline at end of file
+}
\ No newline at end of file
deviceinfo_proxy = NULL;
}
-/* LCOV_EXCL_START */
mtp_error_e mtp_gdbus_deviceinfo_get_manufacturer_name(int mtp_device, char **manufacturer_name)
{
mtp_error_e result = MTP_ERROR_NONE;
return result;
}
-
-/* LCOV_EXCL_STOP */
-
return result;
}
-/* LCOV_EXCL_START */
mtp_error_e mtp_gdbus_manager_get_devices(int **mtp_devices, int *device_num)
{
GVariant *va = NULL;
return result;
}
-/* LCOV_EXCL_STOP */
mtp_error_e mtp_gdbus_manager_deinitialize(void)
{
objectinfo_proxy = NULL;
}
-/* LCOV_EXCL_START */
int mtp_gdbus_objectinfo_get_property(int mtp_device,
int object_handle, int property, int *property_value)
{
return result;
}
-/* LCOV_EXCL_STOP */
storageinfo_proxy = NULL;
}
-/* LCOV_EXCL_START */
mtp_error_e mtp_gdbus_storageinfo_get_description(int mtp_device,
int mtp_storage, char **description)
{
return result;
}
-/* LCOV_EXCL_STOP */
--- /dev/null
+SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=/usr/lib")
+
+SET(UNITTEST_NAME "tct-mtp-core")
+
+SET(CAPI_LIB "capi-network-mtp")
+SET(TC_SOURCES
+ utc-mtp.c
+ utc-mtp-deviceinfo.c
+ utc-mtp-manager.c
+ utc-mtp-objectinfo.c
+ utc-mtp-storageinfo.c
+)
+
+PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED
+ capi-base-common
+ dlog
+ capi-system-info
+ glib-2.0
+ gio-unix-2.0
+)
+
+INCLUDE_DIRECTORIES(
+ ${${CAPI_LIB}_INCLUDE_DIRS}
+ ${CMAKE_SOURCE_DIR}/src/include
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+)
+
+ADD_DEFINITIONS( -DMOBILE )
+
+SET(MTP_MOCK "mtp-mock")
+SET(MTP_MOCK_SRCS
+ mock/mtp-mock.c
+ mock/mtp-mock-sqlite3.c
+ mock/mtp-mock-deviceinfo.c
+ mock/mtp-mock-manager.c
+ mock/mtp-mock-objectinfo.c
+ mock/mtp-mock-storageinfo.c
+)
+
+SET(MTP_MOCK_CFLAGS "${CMAKE_C_FLAGS}" )
+ADD_LIBRARY(${MTP_MOCK} SHARED ${MTP_MOCK_SRCS})
+SET_TARGET_PROPERTIES(${MTP_MOCK} PROPERTIES
+ COMPILE_FLAGS ${MTP_MOCK_CFLAGS}
+)
+
+ADD_EXECUTABLE(${UNITTEST_NAME} ${UNITTEST_NAME}.cpp ${TC_SOURCES} )
+TARGET_LINK_LIBRARIES(${UNITTEST_NAME}
+ ${${CAPI_LIB}_LIBRARIES}
+ ${LIB_NAME}
+ gtest
+ pthread
+ capi-network-mtp
+)
+
+# INSTALL(PROGRAMS ${UNITTEST_NAME} DESTINATION ${BIN_INSTALL_DIR})
--- /dev/null
+//
+// Copyright (c) 2020 Samsung Electronics Co., Ltd.
+//
+// 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.
+//
+#ifndef _ASSERT_H_
+#define _ASSERT_H_
+#include <stdio.h>
+#include <stdlib.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define assert(exp) \
+ do { \
+ if (!(exp)) { \
+ fprintf(stderr, \
+ "\n[TCT][%s][Line : %d] Assert Fail; Following expression is not true: %s\n", \
+ __FILE__, __LINE__, #exp); \
+ return 1; \
+ } \
+ } while (0)
+
+#define assert_eq(var, ref) \
+ do { \
+ if (var != ref) { \
+ fprintf(stderr, \
+ "\n[TCT][%s][Line : %d] Assert fail; Values (%s == 0x%x) and (%s == 0x%x) are not equal\n", \
+ __FILE__, __LINE__, #var, (int)var, #ref, (int)ref); \
+ return 1; \
+ } \
+ } while (0)
+
+#define assert_eq_no_return(var, ref) \
+ do { \
+ if (var != ref) { \
+ fprintf(stderr, \
+ "\n[TCT][%s][Line : %d] Assert fail; Values (%s == 0x%x) and (%s == 0x%x) are not equal\n", \
+ __FILE__, __LINE__, #var, (int)var, #ref, (int)ref); \
+ return ; \
+ } \
+ } while (0)
+
+#define assert_neq_no_return(var, ref) \
+ do { \
+ if (var == ref) { \
+ fprintf(stderr, \
+ "\n[TCT][%s][Line : %d] Assert fail; Values (%s == 0x%x) and (%s == 0x%x) are equal\n", \
+ __FILE__, __LINE__, #var, (int)var, #ref, (int)ref); \
+ return ; \
+ } \
+ } while (0)
+
+#define assert_neq(var, ref) \
+ do { \
+ if (var == ref) { \
+ fprintf(stderr, \
+ "\n[TCT][%s][Line : %d] Assert fail; Values (%s == 0x%x) and (%s == 0x%x) are equal\n", \
+ __FILE__, __LINE__, #var, (int)var, #ref, (int)ref); \
+ return 1; \
+ } \
+ } while (0)
+
+#define assert_gt(var, ref) \
+ do { \
+ if (var <= ref) { \
+ fprintf(stderr, \
+ "\n[TCT][%s][Line : %d] Assert fail; Values (%s == 0x%x) is not greater than (%s == 0x%x)\n", \
+ __FILE__, __LINE__, #var, (int)var, #ref, (int)ref); \
+ return 1; \
+ } \
+ } while (0)
+
+#define assert_geq(var, ref) \
+ do { \
+ if (var < ref) { \
+ fprintf(stderr, \
+ "\n[TCT][%s][Line : %d] Assert fail; Values (%s == 0x%x) is not greater than or equal to (%s == 0x%x)\n", \
+ __FILE__, __LINE__, #var, (int)var, #ref, (int)ref); \
+ return 1; \
+ } \
+ } while (0)
+
+#define assert_lt(var, ref) \
+ do { \
+ if (var >= ref) { \
+ fprintf(stderr, \
+ "\n[TCT][%s][Line : %d] Assert fail; Values (%s == 0x%x) is not lower than (%s == 0x%x)\n", \
+ __FILE__, __LINE__, #var, (int)var, #ref, (int)ref); \
+ return 1; \
+ } \
+ } while (0)
+
+#define assert_leq(var, ref) \
+ do { \
+ if (var > ref) { \
+ fprintf(stderr, \
+ "\n[TCT][%s][Line : %d] Assert fail; Values (%s == 0x%x) is not lower than or equal to (%s == 0x%x)\n", \
+ __FILE__, __LINE__, #var, (int)var, #ref, (int)ref); \
+ return 1; \
+ } \
+ } while (0)
+
+#ifdef __cplusplus
+}
+#endif
+#endif // _ASSERT_H_
--- /dev/null
+//
+// Copyright (c) 2020 Samsung Electronics Co., Ltd.
+//
+// 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.
+//
+#ifndef _TCT_COMMON_H_
+#define _TCT_COMMON_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "assert_local.h"
+
+#include <malloc.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <sys/stat.h>
+
+#define CONFIG_LINE_LEN_MAX 2048
+#define CONFIG_VALUE_LEN_MAX 1024
+
+#define UTC_LOG "utc.log"
+#define ERR_UTC_LOG "utc_error.log"
+#define TC_RESULT "tc_result.log"
+
+FILE *g_fpLog;
+FILE *g_fpLogDump;
+int g_Serr;
+
+int old_Serr;
+
+#define FPRINTF(...) {\
+ g_fpLog = fopen(ERR_LOG, "a");\
+ fprintf(g_fpLog, __VA_ARGS__);\
+ fclose(g_fpLog);\
+}
+
+#define DUMP_UTC_ERRLOG() {\
+ g_Serr = dup(fileno(stderr));\
+ g_fpLogDump = freopen(ERR_UTC_LOG, "w", stderr);\
+ fflush(stderr);\
+}
+
+#define CLOSE_UTC_ERRLOG() {\
+ if(g_fpLogDump) \
+ {\
+ if (g_Serr != -1)\
+ {\
+ old_Serr = fileno(stderr);\
+ if(old_Serr != -1)\
+ {\
+ dup2(g_Serr, old_Serr);\
+ }\
+ close(g_Serr);\
+ }\
+ fclose(g_fpLogDump);\
+ }\
+}
+
+#define PRINT_TC_RESULT(...) {\
+ g_fpLog = fopen(TC_RESULT, "w");\
+ fprintf(g_fpLog, __VA_ARGS__);\
+ fclose(g_fpLog);\
+}
+
+
+#define FREE_MEMORY_TC(buffer) {\
+ if ( buffer != NULL )\
+{\
+ free(buffer);\
+ buffer = NULL;\
+}\
+}
+
+
+#define IS_FEATURE_SUPPORTED(feature_name, featureFlag, ModuleName)\
+{\
+ if ( !(TCTCheckSystemInfoFeatureSupported(feature_name, ModuleName)) )\
+{\
+ featureFlag = false;\
+}\
+ else\
+{\
+ featureFlag = true;\
+}\
+}
+
+#define PRINT_RESULT(eCompare, eRetVal, API, Error) {\
+ if ( eRetVal == eCompare )\
+{\
+ if ( DEBUG )\
+{\
+ FPRINTF("[Line : %d][%s] %s passed\\n", __LINE__, API_NAMESPACE, API);\
+}\
+}\
+ else \
+{\
+ FPRINTF("[Line : %d][%s] %s failed, error returned = %s [%d]\\n", __LINE__, API_NAMESPACE, API, Error, eRetVal);\
+ return 1;\
+}\
+}
+
+#define PRINT_RESULT_NORETURN(eCompare, eRetVal, API, Error) {\
+ if ( eRetVal == eCompare )\
+{\
+ if ( DEBUG )\
+{\
+ FPRINTF("[Line : %d][%s] %s passed\\n", __LINE__, API_NAMESPACE, API);\
+}\
+}\
+ else \
+{\
+ FPRINTF("[Line : %d][%s] %s failed, error returned = %s [%d]\\n", __LINE__, API_NAMESPACE, API, Error, eRetVal);\
+}\
+}
+
+#define PRINT_RESULT_CLEANUP(eCompare, eRetVal, API, Error, FreeResource) {\
+ if ( eRetVal == eCompare )\
+{\
+ if ( DEBUG )\
+{\
+ FPRINTF("[Line : %d][%s] %s passed\\n", __LINE__, API_NAMESPACE, API);\
+}\
+}\
+else \
+{\
+ FPRINTF("[Line : %d][%s] %s failed, error returned = %s [%d]\\n", __LINE__, API_NAMESPACE, API, Error, eRetVal);\
+ FreeResource;\
+ return 1;\
+}\
+}
+
+#define CHECK_VALUE_STRING(StringVariable, API) {\
+ if ( StringVariable == NULL )\
+{\
+ FPRINTF("[Line : %d][%s] %s failed, error returned = value returned is NULL\\n", __LINE__, API_NAMESPACE, API);\
+ return 1;\
+}\
+ else if ( DEBUG )\
+{\
+ FPRINTF("[Line : %d][%s] value returned = %s\\n", __LINE__, API_NAMESPACE, StringVariable);\
+}\
+ free(StringVariable);\
+ StringVariable = NULL;\
+}
+
+#define CHECK_VALUE_INT(Variable, API) {\
+ if ( Variable == 0 )\
+{\
+ FPRINTF("[Line : %d][%s] %s failed, error returned = value returned is Zero\\n", __LINE__, API_NAMESPACE, API);\
+ return 1;\
+}\
+ else if ( DEBUG )\
+{\
+ FPRINTF("[Line : %d][%s] value returned = %d\\n", __LINE__, API_NAMESPACE, Variable);\
+}\
+}
+
+#define CHECK_HANDLE(Handle, API) {\
+ if ( Handle == NULL )\
+{\
+ FPRINTF("[Line : %d][%s] %s failed, error returned = Handle returned is NULL\\n", __LINE__, API_NAMESPACE, API);\
+ return 1;\
+}\
+}
+
+#define FREE_MEMORY(buffer) {\
+ if ( buffer != NULL )\
+{\
+ free(buffer);\
+ buffer = NULL;\
+}\
+}
+
+bool TCTCheckSystemInfoFeatureSupported(char* pszKey, char* pszModuleName){
+ return false;
+}
+char* TCTSystemInfoGetError(int nRet){
+ return NULL;
+}
+bool GetValueFromConfigFile(char* pstrKeyString, char* pstrValue, char* pstrModule){
+ return false;
+}
+bool GetValueForTCTSetting(char* pstrKeyString, char* pstrValue, char* pstrModule){
+ return false;
+}
+
+#define dlog_print( type, tag, ...) do{ \
+ fprintf(stdout, ##__VA_ARGS__ ); \
+ fprintf(stdout, "\n" ); \
+} while(0)
+
+#define PRINT_UTC_LOG(...) do{ \
+ fprintf(stdout, ##__VA_ARGS__ ); \
+ fprintf(stdout, "\n" ); \
+} while(0)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // _TCT_COMMON_H_
--- /dev/null
+//
+// Copyright (c) 2020 Samsung Electronics Co., Ltd.
+//
+// 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.
+//
+#ifndef _TESTCASE_H_
+#define _TESTCASE_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* pointer to startup/cleanup functions */
+typedef void (*void_fun_ptr)(void);
+
+/* pointer to testcase functions */
+typedef int (*tc_fun_ptr)(void);
+
+/* struct describing specific testcase */
+typedef struct testcase_s {
+ const char* name;
+ tc_fun_ptr function;
+ void_fun_ptr startup;
+ void_fun_ptr cleanup;
+} testcase;
+
+#ifdef __cplusplus
+}
+#endif
+#endif // _TESTCASE_H_
--- /dev/null
+//
+// Copyright (c) 2020 Samsung Electronics Co., Ltd.
+//
+// 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 <stdio.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <string.h>
+
+#include <glib.h>
+#include <gio/gio.h>
+
+#ifndef API
+#define API __attribute__ ((visibility("default")))
+#endif
+
+#define NEGATIVE_DEVICE 5
+
+struct _mtpgdbuslibDeviceinfo;
+typedef struct _mtpgdbuslibDeviceinfo mtpgdbuslibDeviceinfo;
+typedef struct _mtpgdbuslibDeviceinfoIface mtpgdbuslibDeviceinfoIface;
+
+struct _mtpgdbuslibDeviceinfoIface
+{
+ GTypeInterface parent_iface;
+
+ gboolean (*handle_get_bus_location) (
+ mtpgdbuslibDeviceinfo *object,
+ GDBusMethodInvocation *invocation,
+ gint arg_mtp_device);
+
+ gboolean (*handle_get_device_number) (
+ mtpgdbuslibDeviceinfo *object,
+ GDBusMethodInvocation *invocation,
+ gint arg_mtp_device);
+
+ gboolean (*handle_get_device_version) (
+ mtpgdbuslibDeviceinfo *object,
+ GDBusMethodInvocation *invocation,
+ gint arg_mtp_device);
+
+ gboolean (*handle_get_manufacturer_name) (
+ mtpgdbuslibDeviceinfo *object,
+ GDBusMethodInvocation *invocation,
+ gint arg_mtp_device);
+
+ gboolean (*handle_get_model_name) (
+ mtpgdbuslibDeviceinfo *object,
+ GDBusMethodInvocation *invocation,
+ gint arg_mtp_device);
+
+ gboolean (*handle_get_serial_number) (
+ mtpgdbuslibDeviceinfo *object,
+ GDBusMethodInvocation *invocation,
+ gint arg_mtp_device);
+
+ gboolean (*handle_get_stitching_engine_version) (
+ mtpgdbuslibDeviceinfo *object,
+ GDBusMethodInvocation *invocation,
+ gint arg_mtp_device);
+};
+
+API mtpgdbuslibDeviceinfo *mtp_gdbuslib_deviceinfo_proxy_new_for_bus_sync (
+ GBusType bus_type,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error)
+{
+ return (void *)1234;
+}
+
+API gboolean mtp_gdbuslib_deviceinfo_call_get_manufacturer_name_sync (
+ mtpgdbuslibDeviceinfo *proxy,
+ gint arg_mtp_device,
+ gchar **out_manufacturer_name,
+ gint *out_result,
+ GCancellable *cancellable,
+ GError **error)
+{
+ bool ret = true;
+
+ if (arg_mtp_device == NEGATIVE_DEVICE) {
+ ret = false;
+ *error = g_error_new(1, 1, "ERROR OCCUR");
+ } else {
+ *out_manufacturer_name = g_strdup("SAMSUNG");
+ }
+
+ return ret;
+}
+
+API gboolean mtp_gdbuslib_deviceinfo_call_get_model_name_sync (
+ mtpgdbuslibDeviceinfo *proxy,
+ gint arg_mtp_device,
+ gchar **out_model_name,
+ gint *out_result,
+ GCancellable *cancellable,
+ GError **error)
+{
+ bool ret = true;
+
+ if (arg_mtp_device == NEGATIVE_DEVICE) {
+ ret = false;
+ *error = g_error_new(1, 1, "ERROR OCCUR");
+ } else {
+ *out_model_name = g_strdup("TIZEN");
+ }
+
+ return ret;
+
+}
+API gboolean mtp_gdbuslib_deviceinfo_call_get_serial_number_sync (
+ mtpgdbuslibDeviceinfo *proxy,
+ gint arg_mtp_device,
+ gchar **out_serial_number,
+ gint *out_result,
+ GCancellable *cancellable,
+ GError **error)
+{
+ bool ret = true;
+
+ if (arg_mtp_device == NEGATIVE_DEVICE) {
+ ret = false;
+ *error = g_error_new(1, 1, "ERROR OCCUR");
+ } else {
+ *out_serial_number = g_strdup("XXX-XXX");
+ }
+
+ return ret;
+}
+
+API gboolean mtp_gdbuslib_deviceinfo_call_get_device_version_sync (
+ mtpgdbuslibDeviceinfo *proxy,
+ gint arg_mtp_device,
+ gchar **out_device_version,
+ gint *out_result,
+ GCancellable *cancellable,
+ GError **error)
+{
+ bool ret = true;
+
+ if (arg_mtp_device == NEGATIVE_DEVICE) {
+ ret = false;
+ *error = g_error_new(1, 1, "ERROR OCCUR");
+ } else {
+ *out_device_version = g_strdup("6.0");
+ }
+
+ return ret;
+}
+
+API gboolean mtp_gdbuslib_deviceinfo_call_get_bus_location_sync (
+ mtpgdbuslibDeviceinfo *proxy,
+ gint arg_mtp_device,
+ gint *out_bus_location,
+ gint *out_result,
+ GCancellable *cancellable,
+ GError **error)
+{
+ bool ret = true;
+
+ if (arg_mtp_device == NEGATIVE_DEVICE) {
+ ret = false;
+ *error = g_error_new(1, 1, "ERROR OCCUR");
+ } else {
+ *out_bus_location = 3;
+ }
+
+ return ret;
+}
+
+API gboolean mtp_gdbuslib_deviceinfo_call_get_device_number_sync (
+ mtpgdbuslibDeviceinfo *proxy,
+ gint arg_mtp_device,
+ gint *out_device_number,
+ gint *out_result,
+ GCancellable *cancellable,
+ GError **error)
+{
+ bool ret = true;
+
+ if (arg_mtp_device == NEGATIVE_DEVICE) {
+ ret = false;
+ *error = g_error_new(1, 1, "ERROR OCCUR");
+ } else {
+ *out_device_number = 3;
+ }
+
+ return ret;
+}
+
+API gboolean mtp_gdbuslib_deviceinfo_call_get_stitching_engine_version_sync (
+ mtpgdbuslibDeviceinfo *proxy,
+ gint arg_mtp_device,
+ gchar **out_stitching_engine_version,
+ gint *out_result,
+ GCancellable *cancellable,
+ GError **error)
+{
+ bool ret = true;
+
+ if (arg_mtp_device == NEGATIVE_DEVICE) {
+ ret = false;
+ *error = g_error_new(1, 1, "ERROR OCCUR");
+ } else {
+ *out_stitching_engine_version = g_strdup("6.0");
+ }
+
+ return ret;
+}
--- /dev/null
+//
+// Copyright (c) 2020 Samsung Electronics Co., Ltd.
+//
+// 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 <stdio.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <string.h>
+
+#include <glib.h>
+#include <gio/gio.h>
+
+#ifndef API
+#define API __attribute__ ((visibility("default")))
+#endif
+
+#define NEGATIVE_DEVICE 5
+
+struct _mtpgdbuslibManager;
+typedef struct _mtpgdbuslibManager mtpgdbuslibManager;
+typedef struct _mtpgdbuslibManagerIface mtpgdbuslibManagerIface;
+
+struct _mtpgdbuslibManagerIface
+{
+ GTypeInterface parent_iface;
+
+ gboolean (*handle_delete_object) (
+ mtpgdbuslibManager *object,
+ GDBusMethodInvocation *invocation,
+ gint arg_mtp_device,
+ gint arg_object_handle);
+
+ gboolean (*handle_get_devices) (
+ mtpgdbuslibManager *object,
+ GDBusMethodInvocation *invocation);
+
+ gboolean (*handle_get_object) (
+ mtpgdbuslibManager *object,
+ GDBusMethodInvocation *invocation,
+ gint arg_mtp_device,
+ gint arg_object_handle,
+ const gchar *arg_dest_path);
+
+ gboolean (*handle_get_object_handles) (
+ mtpgdbuslibManager *object,
+ GDBusMethodInvocation *invocation,
+ gint arg_mtp_device,
+ gint arg_mtp_storage,
+ gint arg_file_type,
+ gint arg_parent_object_handle);
+
+ gboolean (*handle_get_partial_object) (
+ mtpgdbuslibManager *object,
+ GDBusMethodInvocation *invocation,
+ gint arg_mtp_device,
+ gint arg_object_handle,
+ const gchar *arg_dest_path,
+ gint arg_offset,
+ gint arg_max_bytes);
+
+ gboolean (*handle_get_storages) (
+ mtpgdbuslibManager *object,
+ GDBusMethodInvocation *invocation,
+ gint arg_mtp_device);
+
+ gboolean (*handle_get_thumbnail) (
+ mtpgdbuslibManager *object,
+ GDBusMethodInvocation *invocation,
+ gint arg_mtp_device,
+ gint arg_object_handle,
+ const gchar *arg_dest_path);
+
+ void (*mtp_event) (
+ mtpgdbuslibManager *object,
+ gint arg_event,
+ gint arg_arg1);
+};
+
+API mtpgdbuslibManager *mtp_gdbuslib_manager_proxy_new_for_bus_sync (
+ GBusType bus_type,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error)
+{
+ return (void *)1234;
+}
+
+API gboolean mtp_gdbuslib_manager_call_get_devices_sync (
+ mtpgdbuslibManager *proxy,
+ gint *out_device_count,
+ GVariant **out_mtp_devices,
+ gint *out_result,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariantBuilder builder;
+
+ if (*out_device_count == NEGATIVE_DEVICE) {
+ *error = g_error_new(1, 1, "ERROR OCCUR");
+ return false;
+ }
+
+ g_variant_builder_init(&builder, G_VARIANT_TYPE("aa{sv}"));
+ g_variant_builder_open(&builder, G_VARIANT_TYPE("a{sv}"));
+
+ g_variant_builder_add(&builder, "{sv}", "mtp_device", g_variant_new_int32(1));
+
+ g_variant_builder_close(&builder);
+
+ *out_mtp_devices = g_variant_builder_end(&builder);
+ *out_device_count = 1;
+
+ return true;
+}
+
+API gboolean mtp_gdbuslib_manager_call_get_storages_sync (
+ mtpgdbuslibManager *proxy,
+ gint arg_mtp_device,
+ gint *out_storage_count,
+ GVariant **out_mtp_storages,
+ gint *out_result,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariantBuilder builder;
+
+ if (arg_mtp_device == NEGATIVE_DEVICE) {
+ *error = g_error_new(1, 1, "ERROR OCCUR");
+ return false;
+ }
+
+ g_variant_builder_init(&builder, G_VARIANT_TYPE("aa{sv}"));
+ g_variant_builder_open(&builder, G_VARIANT_TYPE("a{sv}"));
+
+ g_variant_builder_add(&builder, "{sv}", "mtp_storage", g_variant_new_int32(1));
+
+ g_variant_builder_close(&builder);
+
+ *out_mtp_storages = g_variant_builder_end(&builder);
+ *out_storage_count = 1;
+
+ return true;
+}
+
+API gboolean mtp_gdbuslib_manager_call_get_object_handles_sync (
+ mtpgdbuslibManager *proxy,
+ gint arg_mtp_device,
+ gint arg_mtp_storage,
+ gint arg_file_type,
+ gint arg_parent_object_handle,
+ gint *out_object_count,
+ GVariant **out_object_handles,
+ gint *out_result,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariantBuilder builder;
+
+ if (arg_mtp_device == NEGATIVE_DEVICE) {
+ *error = g_error_new(1, 1, "ERROR OCCUR");
+ return false;
+ }
+
+ g_variant_builder_init(&builder, G_VARIANT_TYPE("aa{sv}"));
+ g_variant_builder_open(&builder, G_VARIANT_TYPE("a{sv}"));
+
+ g_variant_builder_add(&builder, "{sv}", "object_handle", g_variant_new_int32(1));
+
+ g_variant_builder_close(&builder);
+
+ *out_object_handles = g_variant_builder_end(&builder);
+ *out_object_count = 1;
+
+ return true;
+}
+
+API gboolean mtp_gdbuslib_manager_call_get_object_sync (
+ mtpgdbuslibManager *proxy,
+ gint arg_mtp_device,
+ gint arg_object_handle,
+ const gchar *arg_dest_path,
+ gint *out_result,
+ GCancellable *cancellable,
+ GError **error)
+{
+ if (arg_mtp_device == NEGATIVE_DEVICE) {
+ *error = g_error_new(1, 1, "ERROR OCCUR");
+ return false;
+ }
+
+ return true;
+}
+
+API gboolean mtp_gdbuslib_manager_call_get_partial_object_sync (
+ mtpgdbuslibManager *proxy,
+ gint arg_mtp_device,
+ gint arg_object_handle,
+ const gchar *arg_dest_path,
+ gint arg_offset,
+ gint arg_max_bytes,
+ gint *out_actual_written,
+ gint *out_result,
+ GCancellable *cancellable,
+ GError **error)
+{
+ if (arg_mtp_device == NEGATIVE_DEVICE) {
+ *error = g_error_new(1, 1, "ERROR OCCUR");
+ return false;
+ }
+
+ return true;
+}
+
+API gboolean mtp_gdbuslib_manager_call_get_thumbnail_sync (
+ mtpgdbuslibManager *proxy,
+ gint arg_mtp_device,
+ gint arg_object_handle,
+ const gchar *arg_dest_path,
+ gint *out_result,
+ GCancellable *cancellable,
+ GError **error)
+{
+ if (arg_mtp_device == NEGATIVE_DEVICE) {
+ *error = g_error_new(1, 1, "ERROR OCCUR");
+ return false;
+ }
+
+ return true;
+}
+
+API gboolean mtp_gdbuslib_manager_call_delete_object_sync (
+ mtpgdbuslibManager *proxy,
+ gint arg_mtp_device,
+ gint arg_object_handle,
+ gint *out_result,
+ GCancellable *cancellable,
+ GError **error)
+{
+ if (arg_mtp_device == NEGATIVE_DEVICE) {
+ *error = g_error_new(1, 1, "ERROR OCCUR");
+ return false;
+ }
+
+ return true;
+}
--- /dev/null
+//
+// Copyright (c) 2020 Samsung Electronics Co., Ltd.
+//
+// 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 <stdio.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <string.h>
+
+#include <glib.h>
+#include <gio/gio.h>
+
+#ifndef API
+#define API __attribute__ ((visibility("default")))
+#endif
+
+#define NEGATIVE_DEVICE 5
+
+struct _mtpgdbuslibObjectinfo;
+typedef struct _mtpgdbuslibObjectinfo mtpgdbuslibObjectinfo;
+typedef struct _mtpgdbuslibObjectinfoIface mtpgdbuslibObjectinfoIface;
+
+struct _mtpgdbuslibObjectinfoIface
+{
+ GTypeInterface parent_iface;
+
+ gboolean (*handle_get_property) (
+ mtpgdbuslibObjectinfo *object,
+ GDBusMethodInvocation *invocation,
+ gint arg_mtp_device,
+ gint arg_object_handle,
+ gint arg_property);
+
+ gboolean (*handle_get_property_string) (
+ mtpgdbuslibObjectinfo *object,
+ GDBusMethodInvocation *invocation,
+ gint arg_mtp_device,
+ gint arg_object_handle,
+ gint arg_property);
+};
+
+API mtpgdbuslibObjectinfo *mtp_gdbuslib_objectinfo_proxy_new_for_bus_sync (
+ GBusType bus_type,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error)
+{
+ return (void *)1234;
+}
+
+API gboolean mtp_gdbuslib_objectinfo_call_get_property_sync (
+ mtpgdbuslibObjectinfo *proxy,
+ gint arg_mtp_device,
+ gint arg_object_handle,
+ gint arg_property,
+ gint *out_property_value,
+ gint *out_result,
+ GCancellable *cancellable,
+ GError **error)
+{
+ bool ret = true;
+
+ if (arg_mtp_device == NEGATIVE_DEVICE) {
+ ret = false;
+ *error = g_error_new(1, 1, "ERROR OCCUR");
+ } else {
+ *out_property_value = 1;
+ }
+
+ return ret;
+}
+
+API gboolean mtp_gdbuslib_objectinfo_call_get_property_string_sync (
+ mtpgdbuslibObjectinfo *proxy,
+ gint arg_mtp_device,
+ gint arg_object_handle,
+ gint arg_property,
+ gchar **out_property_value,
+ gint *out_result,
+ GCancellable *cancellable,
+ GError **error)
+{
+ bool ret = true;
+
+ if (arg_mtp_device == NEGATIVE_DEVICE) {
+ ret = false;
+ *error = g_error_new(1, 1, "ERROR OCCUR");
+ } else {
+ *out_property_value = g_strdup("property_value");
+ }
+
+ return ret;
+}
--- /dev/null
+//
+// Copyright (c) 2020 Samsung Electronics Co., Ltd.
+//
+// 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 <stdio.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <string.h>
+
+#include <glib.h>
+#include <gio/gio.h>
+#include <sqlite3.h>
+
+#ifndef API
+#define API __attribute__ ((visibility("default")))
+#endif
+
+#define NEGATIVE_DEVICE 5
+
+API int sqlite3_open_v2(const char *filename, sqlite3 **ppDb, int flags,
+ const char *zVfs)
+{
+ *ppDb = (sqlite3 *)malloc(sizeof(4));
+
+ return SQLITE_OK;
+}
+
+API char *sqlite3_mprintf(const char *zFormat, ...)
+{
+ va_list ap;
+ va_start(ap, zFormat);
+
+ va_arg(ap, char *);
+ int device_number = va_arg(ap, int);
+ va_end(ap);
+
+ if (device_number == NEGATIVE_DEVICE)
+ return NULL;
+
+ return g_strdup("TEMP");
+}
+
+API int sqlite3_prepare_v2(sqlite3 *db, const char *zSql, int nBytes,
+ sqlite3_stmt **ppStmt, const char **pzTail)
+{
+ *ppStmt = (sqlite3_stmt *)malloc(sizeof(4));
+
+ return SQLITE_OK;
+}
+
+API int sqlite3_step(sqlite3_stmt *ppStmt)
+{
+ return SQLITE_ROW;
+}
+
+API int sqlite3_finalize(sqlite3_stmt *ppStmt)
+{
+ if (ppStmt != NULL)
+ free(ppStmt);
+
+ return SQLITE_OK;
+}
+
+API void sqlite3_free(void* memory)
+{
+ if (memory != NULL)
+ free(memory);
+
+ return;
+}
+
+API int sqlite3_close(sqlite3 *db)
+{
+ if (db != NULL)
+ free(db);
+
+ return SQLITE_OK;
+}
+
+API int sqlite3_column_int(sqlite3_stmt *pStmt, int i)
+{
+ return 1;
+}
+
+API const unsigned char *sqlite3_column_text(sqlite3_stmt *pStmt, int i)
+{
+ return (const unsigned char *)g_strdup("TEMP");
+}
--- /dev/null
+//
+// Copyright (c) 2020 Samsung Electronics Co., Ltd.
+//
+// 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 <stdio.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <string.h>
+
+#include <glib.h>
+#include <gio/gio.h>
+
+#ifndef API
+#define API __attribute__ ((visibility("default")))
+#endif
+
+#define NEGATIVE_DEVICE 5
+
+struct _mtpgdbuslibStorageinfo;
+typedef struct _mtpgdbuslibStorageinfo mtpgdbuslibStorageinfo;
+typedef struct _mtpgdbuslibStorageinfoIface mtpgdbuslibStorageinfoIface;
+
+struct _mtpgdbuslibStorageinfoIface
+{
+ GTypeInterface parent_iface;
+
+ gboolean (*handle_get_description) (
+ mtpgdbuslibStorageinfo *object,
+ GDBusMethodInvocation *invocation,
+ gint arg_mtp_device,
+ gint arg_mtp_storage);
+
+ gboolean (*handle_get_free_space) (
+ mtpgdbuslibStorageinfo *object,
+ GDBusMethodInvocation *invocation,
+ gint arg_mtp_device,
+ gint arg_mtp_storage);
+
+ gboolean (*handle_get_max_capacity) (
+ mtpgdbuslibStorageinfo *object,
+ GDBusMethodInvocation *invocation,
+ gint arg_mtp_device,
+ gint arg_mtp_storage);
+
+ gboolean (*handle_get_storage_type) (
+ mtpgdbuslibStorageinfo *object,
+ GDBusMethodInvocation *invocation,
+ gint arg_mtp_device,
+ gint arg_mtp_storage);
+
+ gboolean (*handle_get_volume_identifier) (
+ mtpgdbuslibStorageinfo *object,
+ GDBusMethodInvocation *invocation,
+ gint arg_mtp_device,
+ gint arg_mtp_storage);
+};
+
+API mtpgdbuslibStorageinfo *mtp_gdbuslib_storageinfo_proxy_new_for_bus_sync (
+ GBusType bus_type,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error)
+{
+ return (void *)1234;
+}
+
+API gboolean mtp_gdbuslib_storageinfo_call_get_description_sync (
+ mtpgdbuslibStorageinfo *proxy,
+ gint arg_mtp_device,
+ gint arg_mtp_storage,
+ gchar **out_description,
+ gint *out_result,
+ GCancellable *cancellable,
+ GError **error)
+{
+ bool ret = true;
+
+ if (arg_mtp_device == NEGATIVE_DEVICE) {
+ ret = false;
+ *error = g_error_new(1, 1, "ERROR OCCUR");
+ } else {
+ *out_description = g_strdup("This is Storage");
+ }
+
+ return ret;
+}
+
+API gboolean mtp_gdbuslib_storageinfo_call_get_free_space_sync (
+ mtpgdbuslibStorageinfo *proxy,
+ gint arg_mtp_device,
+ gint arg_mtp_storage,
+ guint64 *out_free_space,
+ gint *out_result,
+ GCancellable *cancellable,
+ GError **error)
+{
+ bool ret = true;
+
+ if (arg_mtp_device == NEGATIVE_DEVICE) {
+ ret = false;
+ *error = g_error_new(1, 1, "ERROR OCCUR");
+ } else {
+ *out_free_space = 1000;
+ }
+
+ return ret;
+}
+
+API gboolean mtp_gdbuslib_storageinfo_call_get_max_capacity_sync (
+ mtpgdbuslibStorageinfo *proxy,
+ gint arg_mtp_device,
+ gint arg_mtp_storage,
+ guint64 *out_max_capacity,
+ gint *out_result,
+ GCancellable *cancellable,
+ GError **error)
+{
+ bool ret = true;
+
+ if (arg_mtp_device == NEGATIVE_DEVICE) {
+ ret = false;
+ *error = g_error_new(1, 1, "ERROR OCCUR");
+ } else {
+ *out_max_capacity = 1000;
+ }
+
+ return ret;
+}
+
+API gboolean mtp_gdbuslib_storageinfo_call_get_storage_type_sync (
+ mtpgdbuslibStorageinfo *proxy,
+ gint arg_mtp_device,
+ gint arg_mtp_storage,
+ gint *out_storage_type,
+ gint *out_result,
+ GCancellable *cancellable,
+ GError **error)
+{
+ bool ret = true;
+
+ if (arg_mtp_device == NEGATIVE_DEVICE) {
+ ret = false;
+ *error = g_error_new(1, 1, "ERROR OCCUR");
+ } else {
+ *out_storage_type = 1;
+ }
+
+ return ret;
+}
+
+API gboolean mtp_gdbuslib_storageinfo_call_get_volume_identifier_sync (
+ mtpgdbuslibStorageinfo *proxy,
+ gint arg_mtp_device,
+ gint arg_mtp_storage,
+ gchar **out_volume_identifier,
+ gint *out_result,
+ GCancellable *cancellable,
+ GError **error)
+{
+ bool ret = true;
+
+ if (arg_mtp_device == NEGATIVE_DEVICE) {
+ ret = false;
+ *error = g_error_new(1, 1, "ERROR OCCUR");
+ } else {
+ *out_volume_identifier = g_strdup("volume_identifier");
+ }
+
+ return ret;
+}
--- /dev/null
+//
+// Copyright (c) 2020 Samsung Electronics Co., Ltd.
+//
+// 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 <stdio.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <string.h>
+
+#include <glib.h>
+#include <gio/gio.h>
+
+#ifndef API
+#define API __attribute__ ((visibility("default")))
+#endif
+
+typedef enum {
+ LOG_ID_INVALID = -1,
+ LOG_ID_MAIN,
+ LOG_ID_RADIO,
+ LOG_ID_SYSTEM,
+ LOG_ID_APPS,
+ LOG_ID_KMSG,
+ LOG_ID_SYSLOG,
+ LOG_ID_MAX
+} log_id_t;
+
+API int __dlog_print(log_id_t log_id, int prio, const char *tag, const char *fmt, ...)
+{
+ va_list ap;
+ va_start(ap, fmt);
+ vprintf(fmt, ap);
+ va_end(ap);
+ printf("\n");
+
+ return 0;
+}
+
+API int system_info_get_platform_bool(const char *key, bool *value)
+{
+ *value = true;
+ return 0;
+}
+
+API gulong g_signal_connect_data(gpointer instance,
+ const gchar *detailed_signal,
+ GCallback c_handler,
+ gpointer data,
+ GClosureNotify destroy_data,
+ GConnectFlags connect_flags)
+{
+ return 0;
+}
--- /dev/null
+#!/bin/bash
+
+export LD_LIBRARY_PATH=..:.:$LD_LIBRARY_PATH
+pushd ../
+RootDir=$PWD
+popd
+
+unitTestFile=tct-mtp-core
+if [ ! -x "./$unitTestFile" ]
+then
+ echo "$unitTestFile file does not exist!"
+ exit -1
+fi
+
+LD_PRELOAD=./libmtp-mock.so ./$unitTestFile
+
+CMakeDir=${RootDir}/CMakeFiles/capi-network-mtp.dir/src
+CoverageDir=${RootDir}/coverage
+
+pushd $CMakeDir
+
+ for obj in `ls *.o`
+ do
+ gcov -b -c $obj
+ done
+
+ if [ -f /usr/bin/lcov ]
+ then
+ lcov -c -d . --exclude "/home/abuild/rpmbuild/BUILD/capi-network-mtp-1.3.19/src/mtp_gdbuslib.c" -o cov.info
+# lcov -c -d . -o cov.info
+ genhtml cov.info -o ${CoverageDir}
+ echo "Coverage test result created! [${CoverageDir}]"
+ else
+ echo "lcov does not exist!"
+ fi
+popd
--- /dev/null
+//
+// Copyright (c) 2020 Samsung Electronics Co., Ltd.
+//
+// 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 <stdio.h>
+#include <string.h>
+#include "tct_common.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "tct-mtp-core.h"
+
+#ifdef __cplusplus
+}
+#endif
+
+#include <gtest/gtest.h>
+
+#include <malloc.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/wait.h>
+#include <stdbool.h>
+
+TEST(mtp, mtp){
+ char *pszGetTCName = NULL;
+ pszGetTCName = (char*)malloc( 256 );
+ memset( pszGetTCName, 0x00, 256);
+ strcpy( pszGetTCName, "utc_mtp");
+ int i=0, result=0;
+
+ dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName);
+
+ int successCnt = 0;
+ int errorCnt = 0;
+ for ( i = 0; tc_array[i].name; i++ )
+ {
+ if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) )
+ {
+ if ( tc_array[i].startup )
+ {
+ tc_array[i].startup();
+ }
+
+ result = tc_array[i].function();
+
+ if( result == 0 ) {
+ successCnt++;
+ } else {
+ dlog_print(DLOG_INFO, "NativeTCT", "[Error][%d] %s returns value = %d", i, tc_array[i].name, result);
+ errorCnt++;
+ }
+
+ EXPECT_EQ(result, 0);
+
+ if ( tc_array[i].cleanup )
+ {
+ tc_array[i].cleanup();
+ }
+ }
+ else
+ {
+ dlog_print(DLOG_INFO, "NativeTCT", "Name check error! [%s][%s]", pszGetTCName, tc_array[i].name);
+ ASSERT_EQ(0, 1);
+ }
+ }
+
+ dlog_print(DLOG_INFO, "NativeTCT", "==========================");
+ dlog_print(DLOG_INFO, "NativeTCT", "Success [%4d / %4d]", successCnt, successCnt + errorCnt);
+ dlog_print(DLOG_INFO, "NativeTCT", "Error [%4d / %4d]", errorCnt, successCnt + errorCnt);
+ dlog_print(DLOG_INFO, "NativeTCT", "==========================");
+
+ FREE_MEMORY_TC(pszGetTCName);
+}
+
+int main(int argc, char** argv) {
+ ::testing::InitGoogleTest(&argc, argv);
+ return RUN_ALL_TESTS();
+}
--- /dev/null
+//
+// Copyright (c) 2020 Samsung Electronics Co., Ltd.
+//
+// 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.
+//
+#ifndef __TCT_MTP_NATIVE_H__
+#define __TCT_MTP_NATIVE_H__
+
+#include "testcase.h"
+#include "tct_common.h"
+
+extern void utc_mtp_manager_startup(void);
+extern void utc_mtp_manager_cleanup(void);
+extern void utc_mtp_deviceinfo_startup(void);
+extern void utc_mtp_deviceinfo_cleanup(void);
+extern void utc_mtp_storageinfo_startup(void);
+extern void utc_mtp_storageinfo_cleanup(void);
+extern void utc_mtp_objectinfo_startup(void);
+extern void utc_mtp_objectinfo_cleanup(void);
+
+extern int utc_mtp_mtp_initialize_p(void);
+extern int utc_mtp_mtp_get_devices_p(void);
+extern int utc_mtp_mtp_get_devices_n1(void);
+extern int utc_mtp_mtp_get_devices_n2(void);
+extern int utc_mtp_mtp_get_storages_p(void);
+extern int utc_mtp_mtp_get_storages_n1(void);
+extern int utc_mtp_mtp_get_storages_n2(void);
+extern int utc_mtp_mtp_get_object_handles_p(void);
+extern int utc_mtp_mtp_get_object_handles_n1(void);
+extern int utc_mtp_mtp_get_object_handles_n2(void);
+extern int utc_mtp_mtp_delete_object_p(void);
+extern int utc_mtp_mtp_delete_object_n1(void);
+extern int utc_mtp_mtp_delete_object_n2(void);
+extern int utc_mtp_mtp_get_object_p(void);
+extern int utc_mtp_mtp_get_object_n1(void);
+extern int utc_mtp_mtp_get_object_n2(void);
+extern int utc_mtp_mtp_get_partial_object_p(void);
+extern int utc_mtp_mtp_get_partial_object_n1(void);
+extern int utc_mtp_mtp_get_partial_object_n2(void);
+extern int utc_mtp_mtp_get_thumbnail_p(void);
+extern int utc_mtp_mtp_get_thumbnail_n1(void);
+extern int utc_mtp_mtp_get_thumbnail_n2(void);
+extern int utc_mtp_mtp_add_mtp_event_cb_p(void);
+extern int utc_mtp_mtp_add_mtp_event_cb_n(void);
+extern int utc_mtp_mtp_remove_mtp_event_cb_p(void);
+extern int utc_mtp_mtp_remove_mtp_event_cb_n(void);
+extern int utc_mtp_mtp_deinitialize_p(void);
+
+extern int utc_mtp_mtp_deviceinfo_get_manufacturer_name_p(void);
+extern int utc_mtp_mtp_deviceinfo_get_manufacturer_name_n1(void);
+extern int utc_mtp_mtp_deviceinfo_get_manufacturer_name_n2(void);
+extern int utc_mtp_mtp_deviceinfo_get_model_name_p(void);
+extern int utc_mtp_mtp_deviceinfo_get_model_name_n1(void);
+extern int utc_mtp_mtp_deviceinfo_get_model_name_n2(void);
+extern int utc_mtp_mtp_deviceinfo_get_serial_number_p(void);
+extern int utc_mtp_mtp_deviceinfo_get_serial_number_n1(void);
+extern int utc_mtp_mtp_deviceinfo_get_serial_number_n2(void);
+extern int utc_mtp_mtp_deviceinfo_get_device_version_p(void);
+extern int utc_mtp_mtp_deviceinfo_get_device_version_n1(void);
+extern int utc_mtp_mtp_deviceinfo_get_device_version_n2(void);
+extern int utc_mtp_mtp_deviceinfo_get_bus_location_p(void);
+extern int utc_mtp_mtp_deviceinfo_get_bus_location_n1(void);
+extern int utc_mtp_mtp_deviceinfo_get_bus_location_n2(void);
+extern int utc_mtp_mtp_deviceinfo_get_device_number_p(void);
+extern int utc_mtp_mtp_deviceinfo_get_device_number_n1(void);
+extern int utc_mtp_mtp_deviceinfo_get_device_number_n2(void);
+extern int utc_mtp_mtp_deviceinfo_get_stitching_engine_version_p(void);
+extern int utc_mtp_mtp_deviceinfo_get_stitching_engine_version_n1(void);
+extern int utc_mtp_mtp_deviceinfo_get_stitching_engine_version_n2(void);
+
+extern int utc_mtp_mtp_storageinfo_get_description_p(void);
+extern int utc_mtp_mtp_storageinfo_get_description_n1(void);
+extern int utc_mtp_mtp_storageinfo_get_description_n2(void);
+extern int utc_mtp_mtp_storageinfo_get_free_space_p(void);
+extern int utc_mtp_mtp_storageinfo_get_free_space_n1(void);
+extern int utc_mtp_mtp_storageinfo_get_free_space_n2(void);
+extern int utc_mtp_mtp_storageinfo_get_max_capacity_p(void);
+extern int utc_mtp_mtp_storageinfo_get_max_capacity_n1(void);
+extern int utc_mtp_mtp_storageinfo_get_max_capacity_n2(void);
+extern int utc_mtp_mtp_storageinfo_get_storage_type_p(void);
+extern int utc_mtp_mtp_storageinfo_get_storage_type_n1(void);
+extern int utc_mtp_mtp_storageinfo_get_storage_type_n2(void);
+extern int utc_mtp_mtp_storageinfo_get_volume_identifier_p(void);
+extern int utc_mtp_mtp_storageinfo_get_volume_identifier_n1(void);
+extern int utc_mtp_mtp_storageinfo_get_volume_identifier_n2(void);
+
+extern int utc_mtp_mtp_objectinfo_get_file_name_p(void);
+extern int utc_mtp_mtp_objectinfo_get_file_name_n1(void);
+extern int utc_mtp_mtp_objectinfo_get_file_name_n2(void);
+extern int utc_mtp_mtp_objectinfo_get_keywords_p(void);
+extern int utc_mtp_mtp_objectinfo_get_keywords_n1(void);
+extern int utc_mtp_mtp_objectinfo_get_keywords_n2(void);
+extern int utc_mtp_mtp_objectinfo_get_association_desc_p(void);
+extern int utc_mtp_mtp_objectinfo_get_association_desc_n1(void);
+extern int utc_mtp_mtp_objectinfo_get_association_desc_n2(void);
+extern int utc_mtp_mtp_objectinfo_get_association_type_p(void);
+extern int utc_mtp_mtp_objectinfo_get_association_type_n1(void);
+extern int utc_mtp_mtp_objectinfo_get_association_type_n2(void);
+extern int utc_mtp_mtp_objectinfo_get_size_p(void);
+extern int utc_mtp_mtp_objectinfo_get_size_n1(void);
+extern int utc_mtp_mtp_objectinfo_get_size_n2(void);
+extern int utc_mtp_mtp_objectinfo_get_parent_object_handle_p(void);
+extern int utc_mtp_mtp_objectinfo_get_parent_object_handle_n1(void);
+extern int utc_mtp_mtp_objectinfo_get_parent_object_handle_n2(void);
+extern int utc_mtp_mtp_objectinfo_get_storage_p(void);
+extern int utc_mtp_mtp_objectinfo_get_storage_n1(void);
+extern int utc_mtp_mtp_objectinfo_get_storage_n2(void);
+extern int utc_mtp_mtp_objectinfo_get_date_created_p(void);
+extern int utc_mtp_mtp_objectinfo_get_date_created_n1(void);
+extern int utc_mtp_mtp_objectinfo_get_date_created_n2(void);
+extern int utc_mtp_mtp_objectinfo_get_date_modified_p(void);
+extern int utc_mtp_mtp_objectinfo_get_date_modified_n1(void);
+extern int utc_mtp_mtp_objectinfo_get_date_modified_n2(void);
+extern int utc_mtp_mtp_objectinfo_get_file_type_p(void);
+extern int utc_mtp_mtp_objectinfo_get_file_type_n1(void);
+extern int utc_mtp_mtp_objectinfo_get_file_type_n2(void);
+extern int utc_mtp_mtp_objectinfo_get_image_bit_depth_p(void);
+extern int utc_mtp_mtp_objectinfo_get_image_bit_depth_n1(void);
+extern int utc_mtp_mtp_objectinfo_get_image_bit_depth_n2(void);
+extern int utc_mtp_mtp_objectinfo_get_image_pix_width_p(void);
+extern int utc_mtp_mtp_objectinfo_get_image_pix_width_n1(void);
+extern int utc_mtp_mtp_objectinfo_get_image_pix_width_n2(void);
+extern int utc_mtp_mtp_objectinfo_get_image_pix_height_p(void);
+extern int utc_mtp_mtp_objectinfo_get_image_pix_height_n1(void);
+extern int utc_mtp_mtp_objectinfo_get_image_pix_height_n2(void);
+extern int utc_mtp_mtp_objectinfo_get_thumbnail_size_p(void);
+extern int utc_mtp_mtp_objectinfo_get_thumbnail_size_n1(void);
+extern int utc_mtp_mtp_objectinfo_get_thumbnail_size_n2(void);
+extern int utc_mtp_mtp_objectinfo_get_thumbnail_file_type_p(void);
+extern int utc_mtp_mtp_objectinfo_get_thumbnail_file_type_n1(void);
+extern int utc_mtp_mtp_objectinfo_get_thumbnail_file_type_n2(void);
+extern int utc_mtp_mtp_objectinfo_get_thumbnail_pix_height_p(void);
+extern int utc_mtp_mtp_objectinfo_get_thumbnail_pix_height_n1(void);
+extern int utc_mtp_mtp_objectinfo_get_thumbnail_pix_height_n2(void);
+extern int utc_mtp_mtp_objectinfo_get_thumbnail_pix_width_p(void);
+extern int utc_mtp_mtp_objectinfo_get_thumbnail_pix_width_n1(void);
+extern int utc_mtp_mtp_objectinfo_get_thumbnail_pix_width_n2(void);
+extern int utc_mtp_mtp_objectinfo_get_object_info_p(void);
+extern int utc_mtp_mtp_objectinfo_get_object_info_n1(void);
+extern int utc_mtp_mtp_objectinfo_get_object_info_n2(void);
+
+testcase tc_array[] = {
+ {"utc_mtp_mtp_initialize_p",utc_mtp_mtp_initialize_p,utc_mtp_manager_startup,utc_mtp_manager_cleanup},
+ {"utc_mtp_mtp_get_devices_p",utc_mtp_mtp_get_devices_p,utc_mtp_manager_startup,utc_mtp_manager_cleanup},
+ {"utc_mtp_mtp_get_devices_n1",utc_mtp_mtp_get_devices_n1,utc_mtp_manager_startup,utc_mtp_manager_cleanup},
+ {"utc_mtp_mtp_get_devices_n2",utc_mtp_mtp_get_devices_n2,utc_mtp_manager_startup,utc_mtp_manager_cleanup},
+ {"utc_mtp_mtp_get_storages_p",utc_mtp_mtp_get_storages_p,utc_mtp_manager_startup,utc_mtp_manager_cleanup},
+ {"utc_mtp_mtp_get_storages_n1",utc_mtp_mtp_get_storages_n1,utc_mtp_manager_startup,utc_mtp_manager_cleanup},
+ {"utc_mtp_mtp_get_storages_n2",utc_mtp_mtp_get_storages_n2,utc_mtp_manager_startup,utc_mtp_manager_cleanup},
+ {"utc_mtp_mtp_get_object_handles_p",utc_mtp_mtp_get_object_handles_p,utc_mtp_manager_startup,utc_mtp_manager_cleanup},
+ {"utc_mtp_mtp_get_object_handles_n1",utc_mtp_mtp_get_object_handles_n1,utc_mtp_manager_startup,utc_mtp_manager_cleanup},
+ {"utc_mtp_mtp_get_object_handles_n2",utc_mtp_mtp_get_object_handles_n2,utc_mtp_manager_startup,utc_mtp_manager_cleanup},
+ {"utc_mtp_mtp_delete_object_p",utc_mtp_mtp_delete_object_p,utc_mtp_manager_startup,utc_mtp_manager_cleanup},
+ {"utc_mtp_mtp_delete_object_n1",utc_mtp_mtp_delete_object_n1,utc_mtp_manager_startup,utc_mtp_manager_cleanup},
+ {"utc_mtp_mtp_delete_object_n2",utc_mtp_mtp_delete_object_n2,utc_mtp_manager_startup,utc_mtp_manager_cleanup},
+ {"utc_mtp_mtp_get_object_p",utc_mtp_mtp_get_object_p,utc_mtp_manager_startup,utc_mtp_manager_cleanup},
+ {"utc_mtp_mtp_get_object_n1",utc_mtp_mtp_get_object_n1,utc_mtp_manager_startup,utc_mtp_manager_cleanup},
+ {"utc_mtp_mtp_get_object_n2",utc_mtp_mtp_get_object_n2,utc_mtp_manager_startup,utc_mtp_manager_cleanup},
+ {"utc_mtp_mtp_get_partial_object_p",utc_mtp_mtp_get_partial_object_p,utc_mtp_manager_startup,utc_mtp_manager_cleanup},
+ {"utc_mtp_mtp_get_partial_object_n1",utc_mtp_mtp_get_partial_object_n1,utc_mtp_manager_startup,utc_mtp_manager_cleanup},
+ {"utc_mtp_mtp_get_partial_object_n2",utc_mtp_mtp_get_partial_object_n2,utc_mtp_manager_startup,utc_mtp_manager_cleanup},
+ {"utc_mtp_mtp_get_thumbnail_p",utc_mtp_mtp_get_thumbnail_p,utc_mtp_manager_startup,utc_mtp_manager_cleanup},
+ {"utc_mtp_mtp_get_thumbnail_n1",utc_mtp_mtp_get_thumbnail_n1,utc_mtp_manager_startup,utc_mtp_manager_cleanup},
+ {"utc_mtp_mtp_get_thumbnail_n2",utc_mtp_mtp_get_thumbnail_n2,utc_mtp_manager_startup,utc_mtp_manager_cleanup},
+ {"utc_mtp_mtp_add_mtp_event_cb_p",utc_mtp_mtp_add_mtp_event_cb_p,utc_mtp_manager_startup,utc_mtp_manager_cleanup},
+ {"utc_mtp_mtp_add_mtp_event_cb_n",utc_mtp_mtp_add_mtp_event_cb_n,utc_mtp_manager_startup,utc_mtp_manager_cleanup},
+ {"utc_mtp_mtp_remove_mtp_event_cb_p",utc_mtp_mtp_remove_mtp_event_cb_p,utc_mtp_manager_startup,utc_mtp_manager_cleanup},
+ {"utc_mtp_mtp_remove_mtp_event_cb_n",utc_mtp_mtp_remove_mtp_event_cb_n,utc_mtp_manager_startup,utc_mtp_manager_cleanup},
+ {"utc_mtp_mtp_deinitialize_p",utc_mtp_mtp_deinitialize_p,utc_mtp_manager_startup,utc_mtp_manager_cleanup},
+
+ {"utc_mtp_mtp_deviceinfo_get_manufacturer_name_p",utc_mtp_mtp_deviceinfo_get_manufacturer_name_p,utc_mtp_deviceinfo_startup,utc_mtp_deviceinfo_cleanup},
+ {"utc_mtp_mtp_deviceinfo_get_manufacturer_name_n1",utc_mtp_mtp_deviceinfo_get_manufacturer_name_n1,utc_mtp_deviceinfo_startup,utc_mtp_deviceinfo_cleanup},
+ {"utc_mtp_mtp_deviceinfo_get_manufacturer_name_n2",utc_mtp_mtp_deviceinfo_get_manufacturer_name_n2,utc_mtp_deviceinfo_startup,utc_mtp_deviceinfo_cleanup},
+ {"utc_mtp_mtp_deviceinfo_get_model_name_p",utc_mtp_mtp_deviceinfo_get_model_name_p,utc_mtp_deviceinfo_startup,utc_mtp_deviceinfo_cleanup},
+ {"utc_mtp_mtp_deviceinfo_get_model_name_n1",utc_mtp_mtp_deviceinfo_get_model_name_n1,utc_mtp_deviceinfo_startup,utc_mtp_deviceinfo_cleanup},
+ {"utc_mtp_mtp_deviceinfo_get_model_name_n2",utc_mtp_mtp_deviceinfo_get_model_name_n2,utc_mtp_deviceinfo_startup,utc_mtp_deviceinfo_cleanup},
+ {"utc_mtp_mtp_deviceinfo_get_serial_number_p",utc_mtp_mtp_deviceinfo_get_serial_number_p,utc_mtp_deviceinfo_startup,utc_mtp_deviceinfo_cleanup},
+ {"utc_mtp_mtp_deviceinfo_get_serial_number_n1",utc_mtp_mtp_deviceinfo_get_serial_number_n1,utc_mtp_deviceinfo_startup,utc_mtp_deviceinfo_cleanup},
+ {"utc_mtp_mtp_deviceinfo_get_serial_number_n2",utc_mtp_mtp_deviceinfo_get_serial_number_n2,utc_mtp_deviceinfo_startup,utc_mtp_deviceinfo_cleanup},
+ {"utc_mtp_mtp_deviceinfo_get_device_version_p",utc_mtp_mtp_deviceinfo_get_device_version_p,utc_mtp_deviceinfo_startup,utc_mtp_deviceinfo_cleanup},
+ {"utc_mtp_mtp_deviceinfo_get_device_version_n1",utc_mtp_mtp_deviceinfo_get_device_version_n1,utc_mtp_deviceinfo_startup,utc_mtp_deviceinfo_cleanup},
+ {"utc_mtp_mtp_deviceinfo_get_device_version_n2",utc_mtp_mtp_deviceinfo_get_device_version_n2,utc_mtp_deviceinfo_startup,utc_mtp_deviceinfo_cleanup},
+ {"utc_mtp_mtp_deviceinfo_get_bus_location_p",utc_mtp_mtp_deviceinfo_get_bus_location_p,utc_mtp_deviceinfo_startup,utc_mtp_deviceinfo_cleanup},
+ {"utc_mtp_mtp_deviceinfo_get_bus_location_n1",utc_mtp_mtp_deviceinfo_get_bus_location_n1,utc_mtp_deviceinfo_startup,utc_mtp_deviceinfo_cleanup},
+ {"utc_mtp_mtp_deviceinfo_get_bus_location_n2",utc_mtp_mtp_deviceinfo_get_bus_location_n2,utc_mtp_deviceinfo_startup,utc_mtp_deviceinfo_cleanup},
+ {"utc_mtp_mtp_deviceinfo_get_device_number_p",utc_mtp_mtp_deviceinfo_get_device_number_p,utc_mtp_deviceinfo_startup,utc_mtp_deviceinfo_cleanup},
+ {"utc_mtp_mtp_deviceinfo_get_device_number_n1",utc_mtp_mtp_deviceinfo_get_device_number_n1,utc_mtp_deviceinfo_startup,utc_mtp_deviceinfo_cleanup},
+ {"utc_mtp_mtp_deviceinfo_get_device_number_n2",utc_mtp_mtp_deviceinfo_get_device_number_n2,utc_mtp_deviceinfo_startup,utc_mtp_deviceinfo_cleanup},
+ {"utc_mtp_mtp_deviceinfo_get_stitching_engine_version_p",utc_mtp_mtp_deviceinfo_get_stitching_engine_version_p,utc_mtp_deviceinfo_startup,utc_mtp_deviceinfo_cleanup},
+ {"utc_mtp_mtp_deviceinfo_get_stitching_engine_version_n1",utc_mtp_mtp_deviceinfo_get_stitching_engine_version_n1,utc_mtp_deviceinfo_startup,utc_mtp_deviceinfo_cleanup},
+ {"utc_mtp_mtp_deviceinfo_get_stitching_engine_version_n2",utc_mtp_mtp_deviceinfo_get_stitching_engine_version_n2,utc_mtp_deviceinfo_startup,utc_mtp_deviceinfo_cleanup},
+
+ {"utc_mtp_mtp_storageinfo_get_description_p",utc_mtp_mtp_storageinfo_get_description_p,utc_mtp_storageinfo_startup,utc_mtp_storageinfo_cleanup},
+ {"utc_mtp_mtp_storageinfo_get_description_n1",utc_mtp_mtp_storageinfo_get_description_n1,utc_mtp_storageinfo_startup,utc_mtp_storageinfo_cleanup},
+ {"utc_mtp_mtp_storageinfo_get_description_n2",utc_mtp_mtp_storageinfo_get_description_n2,utc_mtp_storageinfo_startup,utc_mtp_storageinfo_cleanup},
+ {"utc_mtp_mtp_storageinfo_get_free_space_p",utc_mtp_mtp_storageinfo_get_free_space_p,utc_mtp_storageinfo_startup,utc_mtp_storageinfo_cleanup},
+ {"utc_mtp_mtp_storageinfo_get_free_space_n1",utc_mtp_mtp_storageinfo_get_free_space_n1,utc_mtp_storageinfo_startup,utc_mtp_storageinfo_cleanup},
+ {"utc_mtp_mtp_storageinfo_get_free_space_n2",utc_mtp_mtp_storageinfo_get_free_space_n2,utc_mtp_storageinfo_startup,utc_mtp_storageinfo_cleanup},
+ {"utc_mtp_mtp_storageinfo_get_max_capacity_p",utc_mtp_mtp_storageinfo_get_max_capacity_p,utc_mtp_storageinfo_startup,utc_mtp_storageinfo_cleanup},
+ {"utc_mtp_mtp_storageinfo_get_max_capacity_n1",utc_mtp_mtp_storageinfo_get_max_capacity_n1,utc_mtp_storageinfo_startup,utc_mtp_storageinfo_cleanup},
+ {"utc_mtp_mtp_storageinfo_get_max_capacity_n2",utc_mtp_mtp_storageinfo_get_max_capacity_n2,utc_mtp_storageinfo_startup,utc_mtp_storageinfo_cleanup},
+ {"utc_mtp_mtp_storageinfo_get_storage_type_p",utc_mtp_mtp_storageinfo_get_storage_type_p,utc_mtp_storageinfo_startup,utc_mtp_storageinfo_cleanup},
+ {"utc_mtp_mtp_storageinfo_get_storage_type_n1",utc_mtp_mtp_storageinfo_get_storage_type_n1,utc_mtp_storageinfo_startup,utc_mtp_storageinfo_cleanup},
+ {"utc_mtp_mtp_storageinfo_get_storage_type_n2",utc_mtp_mtp_storageinfo_get_storage_type_n2,utc_mtp_storageinfo_startup,utc_mtp_storageinfo_cleanup},
+ {"utc_mtp_mtp_storageinfo_get_volume_identifier_p",utc_mtp_mtp_storageinfo_get_volume_identifier_p,utc_mtp_storageinfo_startup,utc_mtp_storageinfo_cleanup},
+ {"utc_mtp_mtp_storageinfo_get_volume_identifier_n1",utc_mtp_mtp_storageinfo_get_volume_identifier_n1,utc_mtp_storageinfo_startup,utc_mtp_storageinfo_cleanup},
+ {"utc_mtp_mtp_storageinfo_get_volume_identifier_n2",utc_mtp_mtp_storageinfo_get_volume_identifier_n2,utc_mtp_storageinfo_startup,utc_mtp_storageinfo_cleanup},
+
+ {"utc_mtp_mtp_objectinfo_get_file_name_p",utc_mtp_mtp_objectinfo_get_file_name_p,utc_mtp_objectinfo_startup,utc_mtp_objectinfo_cleanup},
+ {"utc_mtp_mtp_objectinfo_get_file_name_n1",utc_mtp_mtp_objectinfo_get_file_name_n1,utc_mtp_objectinfo_startup,utc_mtp_objectinfo_cleanup},
+ {"utc_mtp_mtp_objectinfo_get_file_name_n2",utc_mtp_mtp_objectinfo_get_file_name_n2,utc_mtp_objectinfo_startup,utc_mtp_objectinfo_cleanup},
+ {"utc_mtp_mtp_objectinfo_get_keywords_p",utc_mtp_mtp_objectinfo_get_keywords_p,utc_mtp_objectinfo_startup,utc_mtp_objectinfo_cleanup},
+ {"utc_mtp_mtp_objectinfo_get_keywords_n1",utc_mtp_mtp_objectinfo_get_keywords_n1,utc_mtp_objectinfo_startup,utc_mtp_objectinfo_cleanup},
+ {"utc_mtp_mtp_objectinfo_get_keywords_n2",utc_mtp_mtp_objectinfo_get_keywords_n2,utc_mtp_objectinfo_startup,utc_mtp_objectinfo_cleanup},
+ {"utc_mtp_mtp_objectinfo_get_association_desc_p",utc_mtp_mtp_objectinfo_get_association_desc_p,utc_mtp_objectinfo_startup,utc_mtp_objectinfo_cleanup},
+ {"utc_mtp_mtp_objectinfo_get_association_desc_n1",utc_mtp_mtp_objectinfo_get_association_desc_n1,utc_mtp_objectinfo_startup,utc_mtp_objectinfo_cleanup},
+ {"utc_mtp_mtp_objectinfo_get_association_desc_n2",utc_mtp_mtp_objectinfo_get_association_desc_n2,utc_mtp_objectinfo_startup,utc_mtp_objectinfo_cleanup},
+ {"utc_mtp_mtp_objectinfo_get_association_type_p",utc_mtp_mtp_objectinfo_get_association_type_p,utc_mtp_objectinfo_startup,utc_mtp_objectinfo_cleanup},
+ {"utc_mtp_mtp_objectinfo_get_association_type_n1",utc_mtp_mtp_objectinfo_get_association_type_n1,utc_mtp_objectinfo_startup,utc_mtp_objectinfo_cleanup},
+ {"utc_mtp_mtp_objectinfo_get_association_type_n2",utc_mtp_mtp_objectinfo_get_association_type_n2,utc_mtp_objectinfo_startup,utc_mtp_objectinfo_cleanup},
+ {"utc_mtp_mtp_objectinfo_get_size_p",utc_mtp_mtp_objectinfo_get_size_p,utc_mtp_objectinfo_startup,utc_mtp_objectinfo_cleanup},
+ {"utc_mtp_mtp_objectinfo_get_size_n1",utc_mtp_mtp_objectinfo_get_size_n1,utc_mtp_objectinfo_startup,utc_mtp_objectinfo_cleanup},
+ {"utc_mtp_mtp_objectinfo_get_size_n2",utc_mtp_mtp_objectinfo_get_size_n2,utc_mtp_objectinfo_startup,utc_mtp_objectinfo_cleanup},
+ {"utc_mtp_mtp_objectinfo_get_parent_object_handle_p",utc_mtp_mtp_objectinfo_get_parent_object_handle_p,utc_mtp_objectinfo_startup,utc_mtp_objectinfo_cleanup},
+ {"utc_mtp_mtp_objectinfo_get_parent_object_handle_n1",utc_mtp_mtp_objectinfo_get_parent_object_handle_n1,utc_mtp_objectinfo_startup,utc_mtp_objectinfo_cleanup},
+ {"utc_mtp_mtp_objectinfo_get_parent_object_handle_n2",utc_mtp_mtp_objectinfo_get_parent_object_handle_n2,utc_mtp_objectinfo_startup,utc_mtp_objectinfo_cleanup},
+ {"utc_mtp_mtp_objectinfo_get_storage_p",utc_mtp_mtp_objectinfo_get_storage_p,utc_mtp_objectinfo_startup,utc_mtp_objectinfo_cleanup},
+ {"utc_mtp_mtp_objectinfo_get_storage_n1",utc_mtp_mtp_objectinfo_get_storage_n1,utc_mtp_objectinfo_startup,utc_mtp_objectinfo_cleanup},
+ {"utc_mtp_mtp_objectinfo_get_storage_n2",utc_mtp_mtp_objectinfo_get_storage_n2,utc_mtp_objectinfo_startup,utc_mtp_objectinfo_cleanup},
+ {"utc_mtp_mtp_objectinfo_get_date_created_p",utc_mtp_mtp_objectinfo_get_date_created_p,utc_mtp_objectinfo_startup,utc_mtp_objectinfo_cleanup},
+ {"utc_mtp_mtp_objectinfo_get_date_created_n1",utc_mtp_mtp_objectinfo_get_date_created_n1,utc_mtp_objectinfo_startup,utc_mtp_objectinfo_cleanup},
+ {"utc_mtp_mtp_objectinfo_get_date_created_n2",utc_mtp_mtp_objectinfo_get_date_created_n2,utc_mtp_objectinfo_startup,utc_mtp_objectinfo_cleanup},
+ {"utc_mtp_mtp_objectinfo_get_date_modified_p",utc_mtp_mtp_objectinfo_get_date_modified_p,utc_mtp_objectinfo_startup,utc_mtp_objectinfo_cleanup},
+ {"utc_mtp_mtp_objectinfo_get_date_modified_n1",utc_mtp_mtp_objectinfo_get_date_modified_n1,utc_mtp_objectinfo_startup,utc_mtp_objectinfo_cleanup},
+ {"utc_mtp_mtp_objectinfo_get_date_modified_n2",utc_mtp_mtp_objectinfo_get_date_modified_n2,utc_mtp_objectinfo_startup,utc_mtp_objectinfo_cleanup},
+ {"utc_mtp_mtp_objectinfo_get_file_type_p",utc_mtp_mtp_objectinfo_get_file_type_p,utc_mtp_objectinfo_startup,utc_mtp_objectinfo_cleanup},
+ {"utc_mtp_mtp_objectinfo_get_file_type_n1",utc_mtp_mtp_objectinfo_get_file_type_n1,utc_mtp_objectinfo_startup,utc_mtp_objectinfo_cleanup},
+ {"utc_mtp_mtp_objectinfo_get_file_type_n2",utc_mtp_mtp_objectinfo_get_file_type_n2,utc_mtp_objectinfo_startup,utc_mtp_objectinfo_cleanup},
+ {"utc_mtp_mtp_objectinfo_get_image_bit_depth_p",utc_mtp_mtp_objectinfo_get_image_bit_depth_p,utc_mtp_objectinfo_startup,utc_mtp_objectinfo_cleanup},
+ {"utc_mtp_mtp_objectinfo_get_image_bit_depth_n1",utc_mtp_mtp_objectinfo_get_image_bit_depth_n1,utc_mtp_objectinfo_startup,utc_mtp_objectinfo_cleanup},
+ {"utc_mtp_mtp_objectinfo_get_image_bit_depth_n2",utc_mtp_mtp_objectinfo_get_image_bit_depth_n2,utc_mtp_objectinfo_startup,utc_mtp_objectinfo_cleanup},
+ {"utc_mtp_mtp_objectinfo_get_image_pix_width_p",utc_mtp_mtp_objectinfo_get_image_pix_width_p,utc_mtp_objectinfo_startup,utc_mtp_objectinfo_cleanup},
+ {"utc_mtp_mtp_objectinfo_get_image_pix_width_n1",utc_mtp_mtp_objectinfo_get_image_pix_width_n1,utc_mtp_objectinfo_startup,utc_mtp_objectinfo_cleanup},
+ {"utc_mtp_mtp_objectinfo_get_image_pix_width_n2",utc_mtp_mtp_objectinfo_get_image_pix_width_n2,utc_mtp_objectinfo_startup,utc_mtp_objectinfo_cleanup},
+ {"utc_mtp_mtp_objectinfo_get_image_pix_height_p",utc_mtp_mtp_objectinfo_get_image_pix_height_p,utc_mtp_objectinfo_startup,utc_mtp_objectinfo_cleanup},
+ {"utc_mtp_mtp_objectinfo_get_image_pix_height_n1",utc_mtp_mtp_objectinfo_get_image_pix_height_n1,utc_mtp_objectinfo_startup,utc_mtp_objectinfo_cleanup},
+ {"utc_mtp_mtp_objectinfo_get_image_pix_height_n2",utc_mtp_mtp_objectinfo_get_image_pix_height_n2,utc_mtp_objectinfo_startup,utc_mtp_objectinfo_cleanup},
+ {"utc_mtp_mtp_objectinfo_get_thumbnail_size_p",utc_mtp_mtp_objectinfo_get_thumbnail_size_p,utc_mtp_objectinfo_startup,utc_mtp_objectinfo_cleanup},
+ {"utc_mtp_mtp_objectinfo_get_thumbnail_size_n1",utc_mtp_mtp_objectinfo_get_thumbnail_size_n1,utc_mtp_objectinfo_startup,utc_mtp_objectinfo_cleanup},
+ {"utc_mtp_mtp_objectinfo_get_thumbnail_size_n2",utc_mtp_mtp_objectinfo_get_thumbnail_size_n2,utc_mtp_objectinfo_startup,utc_mtp_objectinfo_cleanup},
+ {"utc_mtp_mtp_objectinfo_get_thumbnail_file_type_p",utc_mtp_mtp_objectinfo_get_thumbnail_file_type_p,utc_mtp_objectinfo_startup,utc_mtp_objectinfo_cleanup},
+ {"utc_mtp_mtp_objectinfo_get_thumbnail_file_type_n1",utc_mtp_mtp_objectinfo_get_thumbnail_file_type_n1,utc_mtp_objectinfo_startup,utc_mtp_objectinfo_cleanup},
+ {"utc_mtp_mtp_objectinfo_get_thumbnail_file_type_n2",utc_mtp_mtp_objectinfo_get_thumbnail_file_type_n2,utc_mtp_objectinfo_startup,utc_mtp_objectinfo_cleanup},
+ {"utc_mtp_mtp_objectinfo_get_thumbnail_pix_height_p",utc_mtp_mtp_objectinfo_get_thumbnail_pix_height_p,utc_mtp_objectinfo_startup,utc_mtp_objectinfo_cleanup},
+ {"utc_mtp_mtp_objectinfo_get_thumbnail_pix_height_n1",utc_mtp_mtp_objectinfo_get_thumbnail_pix_height_n1,utc_mtp_objectinfo_startup,utc_mtp_objectinfo_cleanup},
+ {"utc_mtp_mtp_objectinfo_get_thumbnail_pix_height_n2",utc_mtp_mtp_objectinfo_get_thumbnail_pix_height_n2,utc_mtp_objectinfo_startup,utc_mtp_objectinfo_cleanup},
+ {"utc_mtp_mtp_objectinfo_get_thumbnail_pix_width_p",utc_mtp_mtp_objectinfo_get_thumbnail_pix_width_p,utc_mtp_objectinfo_startup,utc_mtp_objectinfo_cleanup},
+ {"utc_mtp_mtp_objectinfo_get_thumbnail_pix_width_n1",utc_mtp_mtp_objectinfo_get_thumbnail_pix_width_n1,utc_mtp_objectinfo_startup,utc_mtp_objectinfo_cleanup},
+ {"utc_mtp_mtp_objectinfo_get_thumbnail_pix_width_n2",utc_mtp_mtp_objectinfo_get_thumbnail_pix_width_n2,utc_mtp_objectinfo_startup,utc_mtp_objectinfo_cleanup},
+ {"utc_mtp_mtp_objectinfo_get_object_info_p",utc_mtp_mtp_objectinfo_get_object_info_p,utc_mtp_objectinfo_startup,utc_mtp_objectinfo_cleanup},
+ {"utc_mtp_mtp_objectinfo_get_object_info_n1",utc_mtp_mtp_objectinfo_get_object_info_n1,utc_mtp_objectinfo_startup,utc_mtp_objectinfo_cleanup},
+ {"utc_mtp_mtp_objectinfo_get_object_info_n2",utc_mtp_mtp_objectinfo_get_object_info_n2,utc_mtp_objectinfo_startup,utc_mtp_objectinfo_cleanup},
+ {NULL, NULL}
+};
+
+#endif // __TCT_MTP_NATIVE_H__
--- /dev/null
+//
+// Copyright (c) 2020 Samsung Electronics Co., Ltd.
+//
+// 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 "utc-mtp.h"
+
+#define NEGATIVE_DEVICE 5
+
+static int _init_state = MTP_ERROR_NONE;
+
+void utc_mtp_deviceinfo_startup(void)
+{
+ _init_state = mtp_initialize();
+}
+
+void utc_mtp_deviceinfo_cleanup(void)
+{
+ mtp_deinitialize();
+}
+
+int utc_mtp_mtp_deviceinfo_get_manufacturer_name_p(void)
+{
+ int ret = MTP_ERROR_NONE;
+ char *manufacturer_name = NULL;
+
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_deviceinfo_get_manufacturer_name(1, &manufacturer_name);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_NONE);
+ return 0;
+}
+
+int utc_mtp_mtp_deviceinfo_get_manufacturer_name_n1(void)
+{
+ int ret = MTP_ERROR_NONE;
+
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_deviceinfo_get_manufacturer_name(0, NULL);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_INVALID_PARAMETER);
+ return 0;
+}
+
+int utc_mtp_mtp_deviceinfo_get_manufacturer_name_n2(void)
+{
+ int ret = MTP_ERROR_NONE;
+ char *manufacturer_name = NULL;
+
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_deviceinfo_get_manufacturer_name(NEGATIVE_DEVICE, &manufacturer_name);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_COMM_ERROR);
+ return 0;
+}
+
+int utc_mtp_mtp_deviceinfo_get_model_name_p(void)
+{
+ int ret = MTP_ERROR_NONE;
+ char *model_name = NULL;
+
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_deviceinfo_get_model_name(1, &model_name);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_NONE);
+ return 0;
+}
+
+int utc_mtp_mtp_deviceinfo_get_model_name_n1(void)
+{
+ int ret = MTP_ERROR_NONE;
+
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_deviceinfo_get_model_name(0, NULL);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_INVALID_PARAMETER);
+ return 0;
+}
+
+int utc_mtp_mtp_deviceinfo_get_model_name_n2(void)
+{
+ int ret = MTP_ERROR_NONE;
+ char *model_name = NULL;
+
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_deviceinfo_get_model_name(NEGATIVE_DEVICE, &model_name);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_COMM_ERROR);
+ return 0;
+}
+
+int utc_mtp_mtp_deviceinfo_get_serial_number_p(void)
+{
+ int ret = MTP_ERROR_NONE;
+ char *serial_number = NULL;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_deviceinfo_get_serial_number(1, &serial_number);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_NONE);
+ return 0;
+}
+
+int utc_mtp_mtp_deviceinfo_get_serial_number_n1(void)
+{
+ int ret = MTP_ERROR_NONE;
+
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_deviceinfo_get_serial_number(0, NULL);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_INVALID_PARAMETER);
+ return 0;
+}
+
+int utc_mtp_mtp_deviceinfo_get_serial_number_n2(void)
+{
+ int ret = MTP_ERROR_NONE;
+ char *serial_number = NULL;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_deviceinfo_get_serial_number(NEGATIVE_DEVICE, &serial_number);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_COMM_ERROR);
+ return 0;
+}
+
+int utc_mtp_mtp_deviceinfo_get_device_version_p(void)
+{
+ int ret = MTP_ERROR_NONE;
+ char *device_version = NULL;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_deviceinfo_get_device_version(1, &device_version);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_NONE);
+ return 0;
+}
+
+int utc_mtp_mtp_deviceinfo_get_device_version_n1(void)
+{
+ int ret = MTP_ERROR_NONE;
+
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_deviceinfo_get_device_version(0, NULL);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_INVALID_PARAMETER);
+ return 0;
+}
+
+int utc_mtp_mtp_deviceinfo_get_device_version_n2(void)
+{
+ int ret = MTP_ERROR_NONE;
+ char *device_version = NULL;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_deviceinfo_get_device_version(NEGATIVE_DEVICE, &device_version);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_COMM_ERROR);
+ return 0;
+}
+
+int utc_mtp_mtp_deviceinfo_get_bus_location_p(void)
+{
+ int ret = MTP_ERROR_NONE;
+ int bus_location = 0;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_deviceinfo_get_bus_location(1, &bus_location);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_NONE);
+ return 0;
+}
+
+int utc_mtp_mtp_deviceinfo_get_bus_location_n1(void)
+{
+ int ret = MTP_ERROR_NONE;
+
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_deviceinfo_get_bus_location(0, NULL);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_INVALID_PARAMETER);
+ return 0;
+}
+
+int utc_mtp_mtp_deviceinfo_get_bus_location_n2(void)
+{
+ int ret = MTP_ERROR_NONE;
+ int bus_location = 0;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_deviceinfo_get_bus_location(NEGATIVE_DEVICE, &bus_location);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_COMM_ERROR);
+ return 0;
+}
+
+int utc_mtp_mtp_deviceinfo_get_device_number_p(void)
+{
+ int ret = MTP_ERROR_NONE;
+ int device_number = 0;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_deviceinfo_get_device_number(1, &device_number);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_NONE);
+ return 0;
+}
+
+int utc_mtp_mtp_deviceinfo_get_device_number_n1(void)
+{
+ int ret = MTP_ERROR_NONE;
+
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_deviceinfo_get_device_number(0, NULL);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_INVALID_PARAMETER);
+ return 0;
+}
+
+int utc_mtp_mtp_deviceinfo_get_device_number_n2(void)
+{
+ int ret = MTP_ERROR_NONE;
+ int device_number = 0;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_deviceinfo_get_device_number(NEGATIVE_DEVICE, &device_number);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_COMM_ERROR);
+ return 0;
+}
+
+int utc_mtp_mtp_deviceinfo_get_stitching_engine_version_p(void)
+{
+ int ret = MTP_ERROR_NONE;
+ char *stitching_engine_version = NULL;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_deviceinfo_get_stitching_engine_version(1, &stitching_engine_version);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_NONE);
+ return 0;
+}
+
+int utc_mtp_mtp_deviceinfo_get_stitching_engine_version_n1(void)
+{
+ int ret = MTP_ERROR_NONE;
+
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_deviceinfo_get_stitching_engine_version(0, NULL);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_INVALID_PARAMETER);
+ return 0;
+}
+
+int utc_mtp_mtp_deviceinfo_get_stitching_engine_version_n2(void)
+{
+ int ret = MTP_ERROR_NONE;
+ char *stitching_engine_version = NULL;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_deviceinfo_get_stitching_engine_version(NEGATIVE_DEVICE, &stitching_engine_version);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_COMM_ERROR);
+ return 0;
+}
--- /dev/null
+//
+// Copyright (c) 2020 Samsung Electronics Co., Ltd.
+//
+// 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 "utc-mtp.h"
+
+#define NEGATIVE_DEVICE 5
+
+static int _init_state = MTP_ERROR_NONE;
+
+void _mtp_event_cb(mtp_event_e event, int arg, void *user_data)
+{
+
+}
+
+void utc_mtp_manager_startup(void)
+{
+ _init_state = mtp_initialize();
+}
+
+void utc_mtp_manager_cleanup(void)
+{
+ mtp_deinitialize();
+}
+
+int utc_mtp_mtp_initialize_p(void)
+{
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ return 0;
+}
+
+int utc_mtp_mtp_get_devices_p(void)
+{
+ int ret = MTP_ERROR_NONE;
+ int *mtp_devices = NULL;
+ int device_count = 0;
+
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+
+ ret = mtp_get_devices(&mtp_devices, &device_count);
+
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_NONE);
+ return 0;
+}
+
+int utc_mtp_mtp_get_devices_n1(void)
+{
+ int ret = MTP_ERROR_NONE;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_get_devices(NULL, NULL);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_INVALID_PARAMETER);
+ return 0;
+}
+
+int utc_mtp_mtp_get_devices_n2(void)
+{
+ int ret = MTP_ERROR_NONE;
+ int *mtp_devices = NULL;
+ int device_count = NEGATIVE_DEVICE;
+
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_get_devices(&mtp_devices, &device_count);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_COMM_ERROR);
+ return 0;
+}
+
+int utc_mtp_mtp_get_storages_p(void)
+{
+ int ret = MTP_ERROR_NONE;
+ int *mtp_storages = NULL;
+ int storage_count = 0;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_get_storages(1, &mtp_storages, &storage_count);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_NONE);
+ return 0;
+}
+
+int utc_mtp_mtp_get_storages_n1(void)
+{
+ int ret = MTP_ERROR_NONE;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_get_storages(0, NULL, NULL);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_INVALID_PARAMETER);
+ return 0;
+}
+
+int utc_mtp_mtp_get_storages_n2(void)
+{
+ int ret = MTP_ERROR_NONE;
+ int *mtp_storages = NULL;
+ int storage_count = 0;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_get_storages(NEGATIVE_DEVICE, &mtp_storages, &storage_count);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_COMM_ERROR);
+ return 0;
+}
+
+int utc_mtp_mtp_get_object_handles_p(void)
+{
+ int ret = MTP_ERROR_NONE;
+ int *object_handles = NULL;
+ int object_count = 0;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_get_object_handles(1, 1, MTP_FILETYPE_ALL, 0, &object_handles, &object_count);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_NONE);
+ return 0;
+}
+
+int utc_mtp_mtp_get_object_handles_n1(void)
+{
+ int ret = MTP_ERROR_NONE;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_get_object_handles(0, 0, MTP_FILETYPE_ALL, 0, NULL, NULL);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_INVALID_PARAMETER);
+ return 0;
+}
+
+int utc_mtp_mtp_get_object_handles_n2(void)
+{
+ int ret = MTP_ERROR_NONE;
+ int *object_handles = NULL;
+ int object_count = 0;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_get_object_handles(NEGATIVE_DEVICE, 1, MTP_FILETYPE_ALL, 0, &object_handles, &object_count);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_COMM_ERROR);
+ return 0;
+}
+
+int utc_mtp_mtp_delete_object_p(void)
+{
+ int ret = MTP_ERROR_NONE;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_delete_object(1, 1);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_NONE);
+ return 0;
+}
+
+int utc_mtp_mtp_delete_object_n1(void)
+{
+ int ret = MTP_ERROR_NONE;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_delete_object(0, 0);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_INVALID_PARAMETER);
+ return 0;
+}
+
+int utc_mtp_mtp_delete_object_n2(void)
+{
+ int ret = MTP_ERROR_NONE;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_delete_object(NEGATIVE_DEVICE, 1);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_COMM_ERROR);
+ return 0;
+}
+
+int utc_mtp_mtp_get_object_p(void)
+{
+ int ret = MTP_ERROR_NONE;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_get_object(1, 1, "/destination_path");
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_NONE);
+ return 0;
+}
+
+int utc_mtp_mtp_get_object_n1(void)
+{
+ int ret = MTP_ERROR_NONE;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_get_object(0, 0, NULL);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_INVALID_PARAMETER);
+ return 0;
+}
+
+int utc_mtp_mtp_get_object_n2(void)
+{
+ int ret = MTP_ERROR_NONE;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_get_object(NEGATIVE_DEVICE, 1, "/destination_path");
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_COMM_ERROR);
+ return 0;
+}
+
+int utc_mtp_mtp_get_partial_object_p(void)
+{
+ int ret = MTP_ERROR_NONE;
+ int actual_written = 0;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_get_partial_object(1, 1, "/destination_path", 0, 0, &actual_written);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_NONE);
+ return 0;
+}
+
+int utc_mtp_mtp_get_partial_object_n1(void)
+{
+ int ret = MTP_ERROR_NONE;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_get_partial_object(0, 0, "/destination_path", 0, 0, NULL);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_INVALID_PARAMETER);
+ return 0;
+}
+
+int utc_mtp_mtp_get_partial_object_n2(void)
+{
+ int ret = MTP_ERROR_NONE;
+ int actual_written = 0;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_get_partial_object(NEGATIVE_DEVICE, 1, "/destination_path", 0, 0, &actual_written);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_COMM_ERROR);
+ return 0;
+}
+
+int utc_mtp_mtp_get_thumbnail_p(void)
+{
+ int ret = MTP_ERROR_NONE;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_get_thumbnail(1, 1, "/destination_path");
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_NONE);
+ return 0;
+}
+
+int utc_mtp_mtp_get_thumbnail_n1(void)
+{
+ int ret = MTP_ERROR_NONE;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_get_thumbnail(0, 0, NULL);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_INVALID_PARAMETER);
+ return 0;
+}
+
+int utc_mtp_mtp_get_thumbnail_n2(void)
+{
+ int ret = MTP_ERROR_NONE;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_get_thumbnail(NEGATIVE_DEVICE, 0, "/destination_path");
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_COMM_ERROR);
+ return 0;
+}
+
+int utc_mtp_mtp_add_mtp_event_cb_p(void)
+{
+ int ret = MTP_ERROR_NONE;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_add_mtp_event_cb(_mtp_event_cb, NULL);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_NONE);
+ return 0;
+}
+
+int utc_mtp_mtp_add_mtp_event_cb_n(void)
+{
+ int ret = MTP_ERROR_NONE;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_add_mtp_event_cb(NULL, NULL);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_INVALID_PARAMETER);
+ return 0;
+}
+
+int utc_mtp_mtp_remove_mtp_event_cb_p(void)
+{
+ int ret = MTP_ERROR_NONE;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_remove_mtp_event_cb(_mtp_event_cb);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_NONE);
+ return 0;
+}
+
+int utc_mtp_mtp_remove_mtp_event_cb_n(void)
+{
+ int ret = MTP_ERROR_NONE;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_remove_mtp_event_cb(NULL);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_INVALID_PARAMETER);
+ return 0;
+}
+
+int utc_mtp_mtp_deinitialize_p(void)
+{
+ int ret = MTP_ERROR_NONE;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_deinitialize();
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_NONE);
+ return 0;
+}
--- /dev/null
+//
+// Copyright (c) 2020 Samsung Electronics Co., Ltd.
+//
+// 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 "utc-mtp.h"
+
+#define NEGATIVE_DEVICE 5
+
+static int _init_state = MTP_ERROR_NONE;
+
+void utc_mtp_objectinfo_startup(void)
+{
+ _init_state = mtp_initialize();
+}
+
+void utc_mtp_objectinfo_cleanup(void)
+{
+ mtp_deinitialize();
+}
+
+int utc_mtp_mtp_objectinfo_get_file_name_p(void)
+{
+ int ret = MTP_ERROR_NONE;
+ char *filename = NULL;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_objectinfo_get_file_name(1, 1, &filename);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_NONE);
+ return 0;
+}
+
+int utc_mtp_mtp_objectinfo_get_file_name_n1(void)
+{
+ int ret = MTP_ERROR_NONE;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_objectinfo_get_file_name(0, 0, NULL);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_INVALID_PARAMETER);
+ return 0;
+}
+
+int utc_mtp_mtp_objectinfo_get_file_name_n2(void)
+{
+ int ret = MTP_ERROR_NONE;
+ char *filename = NULL;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_objectinfo_get_file_name(NEGATIVE_DEVICE, 1, &filename);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_COMM_ERROR);
+ return 0;
+}
+
+int utc_mtp_mtp_objectinfo_get_keywords_p(void)
+{
+ int ret = MTP_ERROR_NONE;
+ char *keywords = NULL;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_objectinfo_get_keywords(1, 1, &keywords);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_NONE);
+ return 0;
+}
+
+int utc_mtp_mtp_objectinfo_get_keywords_n1(void)
+{
+ int ret = MTP_ERROR_NONE;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_objectinfo_get_keywords(0, 0, NULL);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_INVALID_PARAMETER);
+ return 0;
+}
+
+int utc_mtp_mtp_objectinfo_get_keywords_n2(void)
+{
+ int ret = MTP_ERROR_NONE;
+ char *keywords = NULL;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_objectinfo_get_keywords(NEGATIVE_DEVICE, 1, &keywords);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_COMM_ERROR);
+ return 0;
+}
+
+int utc_mtp_mtp_objectinfo_get_association_desc_p(void)
+{
+ int ret = MTP_ERROR_NONE;
+ int asso_desc = 0;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_objectinfo_get_association_desc(1, 1, &asso_desc);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_NONE);
+ return 0;
+}
+
+int utc_mtp_mtp_objectinfo_get_association_desc_n1(void)
+{
+ int ret = MTP_ERROR_NONE;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_objectinfo_get_association_desc(0, 0, NULL);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_INVALID_PARAMETER);
+ return 0;
+}
+
+int utc_mtp_mtp_objectinfo_get_association_desc_n2(void)
+{
+ int ret = MTP_ERROR_NONE;
+ int asso_desc = 0;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_objectinfo_get_association_desc(NEGATIVE_DEVICE, 1, &asso_desc);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_COMM_ERROR);
+ return 0;
+}
+
+int utc_mtp_mtp_objectinfo_get_association_type_p(void)
+{
+ int ret = MTP_ERROR_NONE;
+ int asso_type = 0;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_objectinfo_get_association_type(1, 1, &asso_type);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_NONE);
+ return 0;
+}
+
+int utc_mtp_mtp_objectinfo_get_association_type_n1(void)
+{
+ int ret = MTP_ERROR_NONE;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_objectinfo_get_association_type(0, 0, NULL);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_INVALID_PARAMETER);
+ return 0;
+}
+
+int utc_mtp_mtp_objectinfo_get_association_type_n2(void)
+{
+ int ret = MTP_ERROR_NONE;
+ int asso_type = 0;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_objectinfo_get_association_type(NEGATIVE_DEVICE, 1, &asso_type);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_COMM_ERROR);
+ return 0;
+}
+
+int utc_mtp_mtp_objectinfo_get_size_p(void)
+{
+ int ret = MTP_ERROR_NONE;
+ int size = 0;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_objectinfo_get_size(1, 1, &size);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_NONE);
+ return 0;
+}
+
+int utc_mtp_mtp_objectinfo_get_size_n1(void)
+{
+ int ret = MTP_ERROR_NONE;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_objectinfo_get_size(0, 0, NULL);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_INVALID_PARAMETER);
+ return 0;
+}
+
+int utc_mtp_mtp_objectinfo_get_size_n2(void)
+{
+ int ret = MTP_ERROR_NONE;
+ int size = 0;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_objectinfo_get_size(NEGATIVE_DEVICE, 1, &size);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_COMM_ERROR);
+ return 0;
+}
+
+int utc_mtp_mtp_objectinfo_get_parent_object_handle_p(void)
+{
+ int ret = MTP_ERROR_NONE;
+ int parent_object_handle = 0;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_objectinfo_get_parent_object_handle(1, 1, &parent_object_handle);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_NONE);
+ return 0;
+}
+
+int utc_mtp_mtp_objectinfo_get_parent_object_handle_n1(void)
+{
+ int ret = MTP_ERROR_NONE;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_objectinfo_get_parent_object_handle(0, 0, NULL);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_INVALID_PARAMETER);
+ return 0;
+}
+
+int utc_mtp_mtp_objectinfo_get_parent_object_handle_n2(void)
+{
+ int ret = MTP_ERROR_NONE;
+ int parent_object_handle = 0;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_objectinfo_get_parent_object_handle(NEGATIVE_DEVICE, 1, &parent_object_handle);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_COMM_ERROR);
+ return 0;
+}
+
+int utc_mtp_mtp_objectinfo_get_storage_p(void)
+{
+ int ret = MTP_ERROR_NONE;
+ int mtp_storage = 0;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_objectinfo_get_storage(1, 1, &mtp_storage);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_NONE);
+ return 0;
+}
+
+int utc_mtp_mtp_objectinfo_get_storage_n1(void)
+{
+ int ret = MTP_ERROR_NONE;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_objectinfo_get_storage(0, 0, NULL);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_INVALID_PARAMETER);
+ return 0;
+}
+
+int utc_mtp_mtp_objectinfo_get_storage_n2(void)
+{
+ int ret = MTP_ERROR_NONE;
+ int mtp_storage = 0;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_objectinfo_get_storage(NEGATIVE_DEVICE, 1, &mtp_storage);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_COMM_ERROR);
+ return 0;
+}
+
+int utc_mtp_mtp_objectinfo_get_date_created_p(void)
+{
+ int ret = MTP_ERROR_NONE;
+ int data_created = 0;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_objectinfo_get_date_created(1, 1, &data_created);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_NONE);
+ return 0;
+}
+
+int utc_mtp_mtp_objectinfo_get_date_created_n1(void)
+{
+ int ret = MTP_ERROR_NONE;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_objectinfo_get_date_created(0, 0, NULL);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_INVALID_PARAMETER);
+ return 0;
+}
+
+int utc_mtp_mtp_objectinfo_get_date_created_n2(void)
+{
+ int ret = MTP_ERROR_NONE;
+ int data_created = 0;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_objectinfo_get_date_created(NEGATIVE_DEVICE, 1, &data_created);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_COMM_ERROR);
+ return 0;
+}
+
+int utc_mtp_mtp_objectinfo_get_date_modified_p(void)
+{
+ int ret = MTP_ERROR_NONE;
+ int data_modified = 0;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_objectinfo_get_date_modified(1, 1, &data_modified);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_NONE);
+ return 0;
+}
+
+int utc_mtp_mtp_objectinfo_get_date_modified_n1(void)
+{
+ int ret = MTP_ERROR_NONE;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_objectinfo_get_date_modified(0, 0, NULL);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_INVALID_PARAMETER);
+ return 0;
+}
+
+int utc_mtp_mtp_objectinfo_get_date_modified_n2(void)
+{
+ int ret = MTP_ERROR_NONE;
+ int data_modified = 0;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_objectinfo_get_date_modified(NEGATIVE_DEVICE, 1, &data_modified);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_COMM_ERROR);
+ return 0;
+}
+
+int utc_mtp_mtp_objectinfo_get_file_type_p(void)
+{
+ int ret = MTP_ERROR_NONE;
+ mtp_filetype_e file_type = MTP_FILETYPE_UNKNOWN;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_objectinfo_get_file_type(1, 1, &file_type);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_NONE);
+ return 0;
+}
+
+int utc_mtp_mtp_objectinfo_get_file_type_n1(void)
+{
+ int ret = MTP_ERROR_NONE;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_objectinfo_get_file_type(0, 0, NULL);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_INVALID_PARAMETER);
+ return 0;
+}
+
+int utc_mtp_mtp_objectinfo_get_file_type_n2(void)
+{
+ int ret = MTP_ERROR_NONE;
+ mtp_filetype_e file_type = MTP_FILETYPE_UNKNOWN;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_objectinfo_get_file_type(NEGATIVE_DEVICE, 1, &file_type);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_COMM_ERROR);
+ return 0;
+}
+
+int utc_mtp_mtp_objectinfo_get_image_bit_depth_p(void)
+{
+ int ret = MTP_ERROR_NONE;
+ int depth = 0;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_objectinfo_get_image_bit_depth(1, 1, &depth);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_NONE);
+ return 0;
+}
+
+int utc_mtp_mtp_objectinfo_get_image_bit_depth_n1(void)
+{
+ int ret = MTP_ERROR_NONE;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_objectinfo_get_image_bit_depth(0, 0, NULL);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_INVALID_PARAMETER);
+ return 0;
+}
+
+int utc_mtp_mtp_objectinfo_get_image_bit_depth_n2(void)
+{
+ int ret = MTP_ERROR_NONE;
+ int depth = 0;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_objectinfo_get_image_bit_depth(NEGATIVE_DEVICE, 1, &depth);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_COMM_ERROR);
+ return 0;
+}
+
+int utc_mtp_mtp_objectinfo_get_image_pix_width_p(void)
+{
+ int ret = MTP_ERROR_NONE;
+ int width = 0;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_objectinfo_get_image_pix_width(1, 1, &width);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_NONE);
+ return 0;
+}
+
+int utc_mtp_mtp_objectinfo_get_image_pix_width_n1(void)
+{
+ int ret = MTP_ERROR_NONE;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_objectinfo_get_image_pix_width(0, 0, NULL);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_INVALID_PARAMETER);
+ return 0;
+}
+
+int utc_mtp_mtp_objectinfo_get_image_pix_width_n2(void)
+{
+ int ret = MTP_ERROR_NONE;
+ int width = 0;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_objectinfo_get_image_pix_width(NEGATIVE_DEVICE, 1, &width);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_COMM_ERROR);
+ return 0;
+}
+
+int utc_mtp_mtp_objectinfo_get_image_pix_height_p(void)
+{
+ int ret = MTP_ERROR_NONE;
+ int height = 0;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_objectinfo_get_image_pix_height(1, 1, &height);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_NONE);
+ return 0;
+}
+
+int utc_mtp_mtp_objectinfo_get_image_pix_height_n1(void)
+{
+ int ret = MTP_ERROR_NONE;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_objectinfo_get_image_pix_height(0, 0, NULL);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_INVALID_PARAMETER);
+ return 0;
+}
+
+int utc_mtp_mtp_objectinfo_get_image_pix_height_n2(void)
+{
+ int ret = MTP_ERROR_NONE;
+ int height = 0;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_objectinfo_get_image_pix_height(NEGATIVE_DEVICE, 1, &height);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_COMM_ERROR);
+ return 0;
+}
+
+int utc_mtp_mtp_objectinfo_get_thumbnail_size_p(void)
+{
+ int ret = MTP_ERROR_NONE;
+ int size = 0;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_objectinfo_get_thumbnail_size(1, 1, &size);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_NONE);
+ return 0;
+}
+
+int utc_mtp_mtp_objectinfo_get_thumbnail_size_n1(void)
+{
+ int ret = MTP_ERROR_NONE;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_objectinfo_get_thumbnail_size(0, 0, NULL);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_INVALID_PARAMETER);
+ return 0;
+}
+
+int utc_mtp_mtp_objectinfo_get_thumbnail_size_n2(void)
+{
+ int ret = MTP_ERROR_NONE;
+ int size = 0;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_objectinfo_get_thumbnail_size(NEGATIVE_DEVICE, 1, &size);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_COMM_ERROR);
+ return 0;
+}
+
+int utc_mtp_mtp_objectinfo_get_thumbnail_file_type_p(void)
+{
+ int ret = MTP_ERROR_NONE;
+ mtp_filetype_e file_type = MTP_FILETYPE_UNKNOWN;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_objectinfo_get_thumbnail_file_type(1, 1, &file_type);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_NONE);
+ return 0;
+}
+
+int utc_mtp_mtp_objectinfo_get_thumbnail_file_type_n1(void)
+{
+ int ret = MTP_ERROR_NONE;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_objectinfo_get_thumbnail_file_type(0, 0, NULL);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_INVALID_PARAMETER);
+ return 0;
+}
+
+int utc_mtp_mtp_objectinfo_get_thumbnail_file_type_n2(void)
+{
+ int ret = MTP_ERROR_NONE;
+ mtp_filetype_e file_type = MTP_FILETYPE_UNKNOWN;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_objectinfo_get_thumbnail_file_type(NEGATIVE_DEVICE, 1, &file_type);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_COMM_ERROR);
+ return 0;
+}
+
+int utc_mtp_mtp_objectinfo_get_thumbnail_pix_height_p(void)
+{
+ int ret = MTP_ERROR_NONE;
+ int height = 0;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_objectinfo_get_thumbnail_pix_height(1, 1, &height);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_NONE);
+ return 0;
+}
+
+int utc_mtp_mtp_objectinfo_get_thumbnail_pix_height_n1(void)
+{
+ int ret = MTP_ERROR_NONE;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_objectinfo_get_thumbnail_pix_height(0, 0, NULL);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_INVALID_PARAMETER);
+ return 0;
+}
+
+int utc_mtp_mtp_objectinfo_get_thumbnail_pix_height_n2(void)
+{
+ int ret = MTP_ERROR_NONE;
+ int height = 0;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_objectinfo_get_thumbnail_pix_height(NEGATIVE_DEVICE, 1, &height);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_COMM_ERROR);
+ return 0;
+}
+
+int utc_mtp_mtp_objectinfo_get_thumbnail_pix_width_p(void)
+{
+ int ret = MTP_ERROR_NONE;
+ int width = 0;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_objectinfo_get_thumbnail_pix_width(1, 1, &width);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_NONE);
+ return 0;
+}
+
+int utc_mtp_mtp_objectinfo_get_thumbnail_pix_width_n1(void)
+{
+ int ret = MTP_ERROR_NONE;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_objectinfo_get_thumbnail_pix_width(0, 0, NULL);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_INVALID_PARAMETER);
+ return 0;
+}
+
+int utc_mtp_mtp_objectinfo_get_thumbnail_pix_width_n2(void)
+{
+ int ret = MTP_ERROR_NONE;
+ int width = 0;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_objectinfo_get_thumbnail_pix_width(NEGATIVE_DEVICE, 1, &width);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_COMM_ERROR);
+ return 0;
+}
+
+int utc_mtp_mtp_objectinfo_get_object_info_p(void)
+{
+ int ret = MTP_ERROR_NONE;
+ mtp_object_info *object_info = NULL;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_objectinfo_get_object_info(1, 1, &object_info);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_NONE);
+ return 0;
+}
+
+int utc_mtp_mtp_objectinfo_get_object_info_n1(void)
+{
+ int ret = MTP_ERROR_NONE;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_objectinfo_get_object_info(0, 0, NULL);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_INVALID_PARAMETER);
+ return 0;
+}
+
+int utc_mtp_mtp_objectinfo_get_object_info_n2(void)
+{
+ int ret = MTP_ERROR_NONE;
+ mtp_object_info *object_info = NULL;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_objectinfo_get_object_info(NEGATIVE_DEVICE, 1, &object_info);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_DB);
+ return 0;
+}
+
--- /dev/null
+//
+// Copyright (c) 2020 Samsung Electronics Co., Ltd.
+//
+// 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 "utc-mtp.h"
+
+#define NEGATIVE_DEVICE 5
+
+static int _init_state = MTP_ERROR_NONE;
+
+void utc_mtp_storageinfo_startup(void)
+{
+ _init_state = mtp_initialize();
+}
+
+void utc_mtp_storageinfo_cleanup(void)
+{
+ mtp_deinitialize();
+}
+
+int utc_mtp_mtp_storageinfo_get_description_p(void)
+{
+ int ret = MTP_ERROR_NONE;
+ char *description = NULL;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_storageinfo_get_description(1, 1, &description);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_NONE);
+ return 0;
+}
+
+int utc_mtp_mtp_storageinfo_get_description_n1(void)
+{
+ int ret = MTP_ERROR_NONE;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_storageinfo_get_description(0, 0, NULL);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_INVALID_PARAMETER);
+ return 0;
+}
+
+int utc_mtp_mtp_storageinfo_get_description_n2(void)
+{
+ int ret = MTP_ERROR_NONE;
+ char *description = NULL;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_storageinfo_get_description(NEGATIVE_DEVICE, 1, &description);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_COMM_ERROR);
+ return 0;
+}
+
+int utc_mtp_mtp_storageinfo_get_free_space_p(void)
+{
+ int ret = MTP_ERROR_NONE;
+ unsigned long long free_space = 0;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_storageinfo_get_free_space(1, 1, &free_space);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_NONE);
+ return 0;
+}
+
+int utc_mtp_mtp_storageinfo_get_free_space_n1(void)
+{
+ int ret = MTP_ERROR_NONE;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_storageinfo_get_free_space(0, 0, NULL);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_INVALID_PARAMETER);
+ return 0;
+}
+
+int utc_mtp_mtp_storageinfo_get_free_space_n2(void)
+{
+ int ret = MTP_ERROR_NONE;
+ unsigned long long free_space = 0;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_storageinfo_get_free_space(NEGATIVE_DEVICE, 1, &free_space);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_COMM_ERROR);
+ return 0;
+}
+
+int utc_mtp_mtp_storageinfo_get_max_capacity_p(void)
+{
+ int ret = MTP_ERROR_NONE;
+ unsigned long long max_capacity = 0;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_storageinfo_get_max_capacity(1, 1, &max_capacity);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_NONE);
+ return 0;
+}
+
+int utc_mtp_mtp_storageinfo_get_max_capacity_n1(void)
+{
+ int ret = MTP_ERROR_NONE;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_storageinfo_get_max_capacity(0, 0, NULL);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_INVALID_PARAMETER);
+ return 0;
+}
+
+int utc_mtp_mtp_storageinfo_get_max_capacity_n2(void)
+{
+ int ret = MTP_ERROR_NONE;
+ unsigned long long max_capacity = 0;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_storageinfo_get_max_capacity(NEGATIVE_DEVICE, 1, &max_capacity);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_COMM_ERROR);
+ return 0;
+}
+
+int utc_mtp_mtp_storageinfo_get_storage_type_p(void)
+{
+ int ret = MTP_ERROR_NONE;
+ mtp_storage_type_e storage_type = MTP_STORAGE_TYPE_UNDEFINED;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_storageinfo_get_storage_type(1, 1, &storage_type);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_NONE);
+ return 0;
+}
+
+int utc_mtp_mtp_storageinfo_get_storage_type_n1(void)
+{
+ int ret = MTP_ERROR_NONE;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_storageinfo_get_storage_type(0, 0, NULL);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_INVALID_PARAMETER);
+ return 0;
+}
+
+int utc_mtp_mtp_storageinfo_get_storage_type_n2(void)
+{
+ int ret = MTP_ERROR_NONE;
+ mtp_storage_type_e storage_type = MTP_STORAGE_TYPE_UNDEFINED;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_storageinfo_get_storage_type(NEGATIVE_DEVICE, 1, &storage_type);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_COMM_ERROR);
+ return 0;
+}
+
+int utc_mtp_mtp_storageinfo_get_volume_identifier_p(void)
+{
+ int ret = MTP_ERROR_NONE;
+ char *volume_identifier = NULL;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_storageinfo_get_volume_identifier(1, 1, &volume_identifier);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_NONE);
+ return 0;
+}
+
+int utc_mtp_mtp_storageinfo_get_volume_identifier_n1(void)
+{
+ int ret = MTP_ERROR_NONE;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_storageinfo_get_volume_identifier(0, 0, NULL);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_INVALID_PARAMETER);
+ return 0;
+}
+
+int utc_mtp_mtp_storageinfo_get_volume_identifier_n2(void)
+{
+ int ret = MTP_ERROR_NONE;
+ char *volume_identifier = NULL;
+ MTP_ASSERT(_init_state, MTP_ERROR_NONE);
+
+ // process start
+ ret = mtp_storageinfo_get_volume_identifier(NEGATIVE_DEVICE, 1, &volume_identifier);
+ // process end
+
+ MTP_ASSERT(ret, MTP_ERROR_COMM_ERROR);
+ return 0;
+}
+
--- /dev/null
+//
+// Copyright (c) 2020 Samsung Electronics Co., Ltd.
+//
+// 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 "assert_local.h"
+#include "utc-mtp.h"
+#include <system_info.h>
+
+#define MTP_FEATURE "http://tizen.org/feature/network.mtp"
+
+bool _is_support_mtp()
+{
+ bool is_supported_mtp = false;
+
+ system_info_get_platform_bool(MTP_FEATURE, &is_supported_mtp);
+
+ return is_supported_mtp;
+}
+
--- /dev/null
+//
+// Copyright (c) 2020 Samsung Electronics Co., Ltd.
+//
+// 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.
+//
+
+#ifndef __UTC_MTP_H__
+#define __UTC_MTP_H__
+
+#include "assert_local.h"
+#include <glib.h>
+#include <mtp.h>
+#include <mtp_internal.h>
+
+//& set: Smartcard
+bool _is_support_mtp();
+
+#define MTP_ASSERT(ret, errno) \
+do{\
+ {\
+ if (_is_support_mtp() == false) {\
+ assert_eq(ret, MTP_ERROR_NOT_SUPPORTED); \
+ } else { \
+ assert_eq(ret, errno); \
+ } \
+ } \
+}while(0);
+
+#endif