Add gtest for auto coverage 50/236250/4
authorJihoon Jung <jh8801.jung@samsung.com>
Tue, 16 Jun 2020 02:43:05 +0000 (11:43 +0900)
committerJihoon Jung <jh8801.jung@samsung.com>
Thu, 18 Jun 2020 07:03:44 +0000 (16:03 +0900)
[   12s] ==========================
[   12s] Success [ 117 /  117]
[   12s] Error   [   0 /  117]
[   12s] ==========================
[   12s] [       OK ] mtp.mtp (32 ms)
[   12s] [----------] 1 test from mtp (32 ms total)
[   12s]
[   12s] [----------] Global test environment tear-down
[   12s] [==========] 1 test from 1 test case ran. (34 ms total)
[   12s] [  PASSED  ] 1 test.

[   17s] Overall coverage rate:
[   17s]   lines......: 100.0% (824 of 824 lines)
[   17s]   functions..: 100.0% (77 of 77 functions)

Change-Id: I4403f6467860b11740ea30daf58d1f425a478718
Signed-off-by: Jihoon Jung <jh8801.jung@samsung.com>
27 files changed:
CMakeLists.txt
packaging/capi-network-mtp.spec
src/mtp.c
src/mtp_db.c
src/mtp_gdbus_deviceinfo.c
src/mtp_gdbus_manager.c
src/mtp_gdbus_objectinfo.c
src/mtp_gdbus_storageinfo.c
unittest/CMakeLists.txt [new file with mode: 0644]
unittest/include/assert_local.h [new file with mode: 0755]
unittest/include/tct_common.h [new file with mode: 0755]
unittest/include/testcase.h [new file with mode: 0755]
unittest/mock/mtp-mock-deviceinfo.c [new file with mode: 0755]
unittest/mock/mtp-mock-manager.c [new file with mode: 0755]
unittest/mock/mtp-mock-objectinfo.c [new file with mode: 0755]
unittest/mock/mtp-mock-sqlite3.c [new file with mode: 0755]
unittest/mock/mtp-mock-storageinfo.c [new file with mode: 0755]
unittest/mock/mtp-mock.c [new file with mode: 0755]
unittest/run_coverage.sh [new file with mode: 0755]
unittest/tct-mtp-core.cpp [new file with mode: 0755]
unittest/tct-mtp-core.h [new file with mode: 0755]
unittest/utc-mtp-deviceinfo.c [new file with mode: 0755]
unittest/utc-mtp-manager.c [new file with mode: 0755]
unittest/utc-mtp-objectinfo.c [new file with mode: 0755]
unittest/utc-mtp-storageinfo.c [new file with mode: 0755]
unittest/utc-mtp.c [new file with mode: 0755]
unittest/utc-mtp.h [new file with mode: 0755]

index b1d4acd7e83c04ff3fe7d7ee88c71d48a06f5b7c..c0257f6a2adc81781a473557064be327d598f28d 100755 (executable)
@@ -39,14 +39,18 @@ INCLUDE(FindPkgConfig)
 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")
@@ -92,3 +96,6 @@ INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc DESTINATION ${libdir}/pk
 
 ADD_SUBDIRECTORY(test)
 
+IF(BUILD_GCOV)
+       ADD_SUBDIRECTORY(unittest)
+ENDIF(BUILD_GCOV)
index 3b8fe85d5550056028a6be8c85c170b312d3a6c6..b07d64232c37aaf76c4adcf85271bc093aa5053d 100755 (executable)
@@ -17,6 +17,11 @@ Buildrequires:  pkgconfig(libtzplatform-config)
 BuildRequires:  python
 Buildrequires:  python-xml
 
+%if 0%{?gcov:1}
+BuildRequires:  gtest-devel
+BuildRequires:  lcov
+%endif
+
 Requires(post): /sbin/ldconfig
 Requires(postun): /sbin/ldconfig
 
@@ -72,6 +77,13 @@ mkdir -p %{buildroot}%{_datadir}/gcov/obj
 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
index 4771011ea2b7a1ae40af436353728c5df3f05f5b..32a78f645d4b2696c7de80b23b3d3bec37b407bc 100755 (executable)
--- a/src/mtp.c
+++ b/src/mtp.c
@@ -117,8 +117,6 @@ int mtp_get_devices(int **mtp_devices, int *device_count)
        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 */
@@ -130,7 +128,6 @@ int mtp_get_devices(int **mtp_devices, int *device_count)
        _END();
 
        return ret;
-       /* LCOV_EXCL_STOP */
 }
 
 int mtp_get_storages(int mtp_device, int **mtp_storages, int* storage_count)
@@ -146,7 +143,6 @@ 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);
 
@@ -159,7 +155,6 @@ int mtp_get_storages(int mtp_device, int **mtp_storages, int* storage_count)
        _END();
 
        return ret;
-       /* LCOV_EXCL_STOP */
 }
 
 int mtp_get_object_handles(int mtp_device, int mtp_storage, mtp_filetype_e file_type,
@@ -175,8 +170,6 @@ int mtp_get_object_handles(int mtp_device, int mtp_storage, mtp_filetype_e file_
        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);
@@ -189,10 +182,8 @@ int mtp_get_object_handles(int mtp_device, int mtp_storage, mtp_filetype_e file_
        _END();
 
        return ret;
-       /* LCOV_EXCL_STOP */
 }
 
-/* LCOV_EXCL_START */
 int mtp_delete_object(int mtp_device, int object_handle)
 {
        int ret = MTP_ERROR_NONE;
@@ -215,7 +206,6 @@ int mtp_delete_object(int mtp_device, int object_handle)
 
        return ret;
 }
-/* LCOV_EXCL_STOP */
 
 int mtp_get_object(int mtp_device, int object_handle, char *dest_path)
 {
@@ -229,8 +219,6 @@ 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 */
@@ -240,7 +228,6 @@ int mtp_get_object(int mtp_device, int object_handle, char *dest_path)
        _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)
@@ -257,8 +244,6 @@ int mtp_get_partial_object(int mtp_device, int object_handle, char *dest_path, i
        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 */
@@ -268,7 +253,6 @@ int mtp_get_partial_object(int mtp_device, int object_handle, char *dest_path, i
        _END();
 
        return ret;
-       /* LCOV_EXCL_STOP */
 }
 
 int mtp_get_thumbnail(int mtp_device, int object_handle, char *dest_path)
@@ -283,8 +267,6 @@ 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 */
@@ -294,7 +276,6 @@ int mtp_get_thumbnail(int mtp_device, int object_handle, char *dest_path)
        _END();
 
        return ret;
-       /* LCOV_EXCL_STOP */
 }
 
 int mtp_add_mtp_event_cb(mtp_event_cb callback, void *user_data)
@@ -385,7 +366,6 @@ int mtp_deviceinfo_get_manufacturer_name(int mtp_device, char **manufacturer_nam
 
        /* precondition check end */
 
-       /* LCOV_EXCL_START */
        ret = mtp_gdbus_deviceinfo_get_manufacturer_name(mtp_device, manufacturer_name);
 
        TC_PRT("manufacturername %s", *manufacturer_name);
@@ -393,7 +373,6 @@ int mtp_deviceinfo_get_manufacturer_name(int mtp_device, char **manufacturer_nam
        _END();
 
        return ret;
-       /* LCOV_EXCL_STOP */
 }
 
 int mtp_deviceinfo_get_model_name(int mtp_device, char **model_name)
@@ -411,7 +390,6 @@ 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);
@@ -419,7 +397,6 @@ int mtp_deviceinfo_get_model_name(int mtp_device, char **model_name)
        _END();
 
        return ret;
-       /* LCOV_EXCL_STOP */
 }
 
 int mtp_deviceinfo_get_serial_number(int mtp_device, char **serial_number)
@@ -437,7 +414,6 @@ 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);
@@ -445,7 +421,6 @@ int mtp_deviceinfo_get_serial_number(int mtp_device, char **serial_number)
        _END();
 
        return ret;
-       /* LCOV_EXCL_STOP */
 }
 
 int mtp_deviceinfo_get_device_version(int mtp_device, char **device_version)
@@ -463,7 +438,6 @@ 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);
@@ -471,10 +445,8 @@ int mtp_deviceinfo_get_device_version(int mtp_device, char **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;
@@ -550,7 +522,6 @@ int mtp_deviceinfo_get_stitching_engine_version(mtp_device_h mtp_device,
        return ret;
 }
 
-/* LCOV_EXCL_STOP */
 
 /* Storage Info */
 int mtp_storageinfo_get_description(int mtp_device, int mtp_storage, char **description)
@@ -565,8 +536,6 @@ int mtp_storageinfo_get_description(int mtp_device, int mtp_storage, char **desc
        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 */
@@ -578,7 +547,6 @@ int mtp_storageinfo_get_description(int mtp_device, int mtp_storage, char **desc
        _END();
 
        return ret;
-       /* LCOV_EXCL_STOP */
 }
 
 int mtp_storageinfo_get_free_space(int mtp_device, int mtp_storage, unsigned long long *free_space)
@@ -593,8 +561,6 @@ int mtp_storageinfo_get_free_space(int mtp_device, int mtp_storage, unsigned lon
        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 */
@@ -606,7 +572,6 @@ int mtp_storageinfo_get_free_space(int mtp_device, int mtp_storage, unsigned lon
        _END();
 
        return ret;
-       /* LCOV_EXCL_STOP */
 }
 
 int mtp_storageinfo_get_max_capacity(int mtp_device, int mtp_storage, unsigned long long *max_capacity)
@@ -621,8 +586,6 @@ int mtp_storageinfo_get_max_capacity(int mtp_device, int mtp_storage, unsigned l
        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 */
@@ -634,7 +597,6 @@ int mtp_storageinfo_get_max_capacity(int mtp_device, int mtp_storage, unsigned l
        _END();
 
        return ret;
-       /* LCOV_EXCL_STOP */
 }
 
 int mtp_storageinfo_get_storage_type(int mtp_device, int mtp_storage, mtp_storage_type_e *storage_type)
@@ -649,8 +611,6 @@ int mtp_storageinfo_get_storage_type(int mtp_device, int mtp_storage, mtp_storag
        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 */
@@ -662,7 +622,6 @@ int mtp_storageinfo_get_storage_type(int mtp_device, int mtp_storage, mtp_storag
        _END();
 
        return ret;
-       /* LCOV_EXCL_STOP */
 }
 
 int mtp_storageinfo_get_volume_identifier(int mtp_device, int mtp_storage, char **volume_identifier)
@@ -677,8 +636,6 @@ int mtp_storageinfo_get_volume_identifier(int mtp_device, int mtp_storage, char
        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 */
@@ -690,7 +647,6 @@ int mtp_storageinfo_get_volume_identifier(int mtp_device, int mtp_storage, char
        _END();
 
        return ret;
-       /* LCOV_EXCL_STOP */
 }
 
 /* Object Info */
@@ -710,7 +666,6 @@ int mtp_objectinfo_get_parent_object_handle(int mtp_device, int object_handle,
 
        /* precondition check end */
 
-       /* LCOV_EXCL_START */
        ret = mtp_gdbus_objectinfo_get_property(mtp_device,
                object_handle, MTP_PROPERTY_PARENT_OBJECT_HANDLE, parent_object_handle);
 
@@ -719,7 +674,6 @@ int mtp_objectinfo_get_parent_object_handle(int mtp_device, int object_handle,
        _END();
 
        return ret;
-       /* LCOV_EXCL_STOP */
 }
 
 int mtp_objectinfo_get_storage(int mtp_device, int object_handle,
@@ -738,14 +692,12 @@ 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,
@@ -764,14 +716,12 @@ 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,
@@ -790,14 +740,12 @@ 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)
@@ -815,14 +763,12 @@ 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,
@@ -841,14 +787,12 @@ 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,
@@ -867,14 +811,12 @@ 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)
@@ -892,14 +834,12 @@ int mtp_objectinfo_get_file_type(int mtp_device, int object_handle, mtp_filetype
 
        /* 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,
@@ -918,14 +858,12 @@ 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,
@@ -944,14 +882,12 @@ 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,
@@ -970,14 +906,12 @@ 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,
@@ -996,14 +930,12 @@ 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,
@@ -1022,14 +954,12 @@ 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,
@@ -1048,14 +978,12 @@ 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,
@@ -1074,14 +1002,12 @@ 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,
@@ -1100,14 +1026,12 @@ 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,
@@ -1126,17 +1050,14 @@ 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)
 {
@@ -1159,5 +1080,4 @@ int mtp_objectinfo_get_object_info(int mtp_device,
 
        return ret;
 }
-/* LCOV_EXCL_STOP */
 
index 1b0923c935793f239c1af12c92827474eed0c9e1..f0c9613830b55f4288d0f0a7b59ecbef7af4c1ed 100755 (executable)
@@ -29,7 +29,6 @@
 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;
@@ -42,7 +41,7 @@ mtp_error_e mtp_db_init()
                        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;
@@ -62,8 +61,8 @@ mtp_error_e mtp_db_get_object_info(int mtp_device, int object_handle, mtp_object
        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));
@@ -129,7 +128,7 @@ mtp_error_e mtp_db_deinit()
                sql_ret = sqlite3_close(db);
 
                if (sql_ret != SQLITE_OK)
-                       ret = MTP_ERROR_DB;
+                       ret = MTP_ERROR_DB; /* LCOV_EXCL_LINE */
 
                db = NULL;
        }
@@ -137,5 +136,4 @@ mtp_error_e mtp_db_deinit()
        MTP_DB_UNLOCK;
 
        return ret;
-}
-/* LCOV_EXCL_STOP */
\ No newline at end of file
+}
\ No newline at end of file
index a27845533dad081b2375945ba14a2d6ef0a90880..5089a9293d5b3f25a6c840fc10a0c8e4864ae992 100755 (executable)
@@ -34,7 +34,6 @@ void mtp_gdbus_deviceinfo_proxy_deinit(void)
        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;
@@ -189,6 +188,3 @@ mtp_error_e mtp_gdbus_deviceinfo_get_stitching_engine_version(int mtp_device,
 
        return result;
 }
-
-/* LCOV_EXCL_STOP */
-
index e4223336a26f5d44b0928e811f8e4d2b1f5d57f0..f1254c453ad67fbd686e48b719af1fff51617a86 100755 (executable)
@@ -122,7 +122,6 @@ mtp_error_e mtp_gdbus_manager_initialize(void)
        return result;
 }
 
-/* LCOV_EXCL_START */
 mtp_error_e mtp_gdbus_manager_get_devices(int **mtp_devices, int *device_num)
 {
        GVariant *va = NULL;
@@ -396,7 +395,6 @@ mtp_error_e mtp_gdbus_manager_get_thumbnail(int mtp_device,
 
        return result;
 }
-/* LCOV_EXCL_STOP */
 
 mtp_error_e mtp_gdbus_manager_deinitialize(void)
 {
index de27bef056820073b13079719f2944dd1c102479..c5382ff9c23258b5a12dfd95674ee5d2c06151b6 100755 (executable)
@@ -34,7 +34,6 @@ void mtp_gdbus_objectinfo_proxy_deinit(void)
        objectinfo_proxy = NULL;
 }
 
-/* LCOV_EXCL_START */
 int mtp_gdbus_objectinfo_get_property(int mtp_device,
        int object_handle, int property, int *property_value)
 {
@@ -84,5 +83,4 @@ int mtp_gdbus_objectinfo_get_property_string(int mtp_device,
 
        return result;
 }
-/* LCOV_EXCL_STOP */
 
index 29cf370ba426ddb599b8aa77adeb371799140548..6a0b64da7ab42debbcc6d11e8a61bb0b2f675b6a 100755 (executable)
@@ -34,7 +34,6 @@ void mtp_gdbus_storageinfo_proxy_deinit(void)
        storageinfo_proxy = NULL;
 }
 
-/* LCOV_EXCL_START */
 mtp_error_e mtp_gdbus_storageinfo_get_description(int mtp_device,
        int mtp_storage, char **description)
 {
@@ -154,5 +153,4 @@ mtp_error_e mtp_gdbus_storageinfo_get_volume_identifier(int mtp_device,
 
        return result;
 }
-/* LCOV_EXCL_STOP */
 
diff --git a/unittest/CMakeLists.txt b/unittest/CMakeLists.txt
new file mode 100644 (file)
index 0000000..47e421d
--- /dev/null
@@ -0,0 +1,55 @@
+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})
diff --git a/unittest/include/assert_local.h b/unittest/include/assert_local.h
new file mode 100755 (executable)
index 0000000..7c88a02
--- /dev/null
@@ -0,0 +1,118 @@
+//
+// 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_
diff --git a/unittest/include/tct_common.h b/unittest/include/tct_common.h
new file mode 100755 (executable)
index 0000000..5617478
--- /dev/null
@@ -0,0 +1,216 @@
+//
+// 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_
diff --git a/unittest/include/testcase.h b/unittest/include/testcase.h
new file mode 100755 (executable)
index 0000000..febac28
--- /dev/null
@@ -0,0 +1,40 @@
+//
+// 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_
diff --git a/unittest/mock/mtp-mock-deviceinfo.c b/unittest/mock/mtp-mock-deviceinfo.c
new file mode 100755 (executable)
index 0000000..677c0d0
--- /dev/null
@@ -0,0 +1,223 @@
+//
+// 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;
+}
diff --git a/unittest/mock/mtp-mock-manager.c b/unittest/mock/mtp-mock-manager.c
new file mode 100755 (executable)
index 0000000..07cf357
--- /dev/null
@@ -0,0 +1,258 @@
+//
+// 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;
+}
diff --git a/unittest/mock/mtp-mock-objectinfo.c b/unittest/mock/mtp-mock-objectinfo.c
new file mode 100755 (executable)
index 0000000..43d7b5c
--- /dev/null
@@ -0,0 +1,106 @@
+//
+// 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;
+}
diff --git a/unittest/mock/mtp-mock-sqlite3.c b/unittest/mock/mtp-mock-sqlite3.c
new file mode 100755 (executable)
index 0000000..ecdb32f
--- /dev/null
@@ -0,0 +1,99 @@
+//
+// 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");
+}
diff --git a/unittest/mock/mtp-mock-storageinfo.c b/unittest/mock/mtp-mock-storageinfo.c
new file mode 100755 (executable)
index 0000000..b59b2e9
--- /dev/null
@@ -0,0 +1,184 @@
+//
+// 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;
+}
diff --git a/unittest/mock/mtp-mock.c b/unittest/mock/mtp-mock.c
new file mode 100755 (executable)
index 0000000..226d5e3
--- /dev/null
@@ -0,0 +1,64 @@
+//
+// 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;
+}
diff --git a/unittest/run_coverage.sh b/unittest/run_coverage.sh
new file mode 100755 (executable)
index 0000000..6b97bf3
--- /dev/null
@@ -0,0 +1,36 @@
+#!/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
diff --git a/unittest/tct-mtp-core.cpp b/unittest/tct-mtp-core.cpp
new file mode 100755 (executable)
index 0000000..2d682cb
--- /dev/null
@@ -0,0 +1,93 @@
+//
+// 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();
+}
diff --git a/unittest/tct-mtp-core.h b/unittest/tct-mtp-core.h
new file mode 100755 (executable)
index 0000000..b59e5f2
--- /dev/null
@@ -0,0 +1,276 @@
+//
+// 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__
diff --git a/unittest/utc-mtp-deviceinfo.c b/unittest/utc-mtp-deviceinfo.c
new file mode 100755 (executable)
index 0000000..9e1e309
--- /dev/null
@@ -0,0 +1,329 @@
+//
+// 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;
+}
diff --git a/unittest/utc-mtp-manager.c b/unittest/utc-mtp-manager.c
new file mode 100755 (executable)
index 0000000..9496c64
--- /dev/null
@@ -0,0 +1,399 @@
+//
+// 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;
+}
diff --git a/unittest/utc-mtp-objectinfo.c b/unittest/utc-mtp-objectinfo.c
new file mode 100755 (executable)
index 0000000..8f14992
--- /dev/null
@@ -0,0 +1,770 @@
+//
+// 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;
+}
+
diff --git a/unittest/utc-mtp-storageinfo.c b/unittest/utc-mtp-storageinfo.c
new file mode 100755 (executable)
index 0000000..8928543
--- /dev/null
@@ -0,0 +1,237 @@
+//
+// 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;
+}
+
diff --git a/unittest/utc-mtp.c b/unittest/utc-mtp.c
new file mode 100755 (executable)
index 0000000..8480134
--- /dev/null
@@ -0,0 +1,30 @@
+//
+// 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;
+}
+
diff --git a/unittest/utc-mtp.h b/unittest/utc-mtp.h
new file mode 100755 (executable)
index 0000000..0ad6fb3
--- /dev/null
@@ -0,0 +1,39 @@
+//
+// 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