+++ /dev/null
-/*
- * utc-capi-service-adaptor-storage
- *
- * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved.
- *
- * PROPRIETARY/CONFIDENTIAL
- *
- * This software is the confidential and proprietary information of SAMSUNG ELECTRONICS
- * ("Confidential Information"). You agree and acknowledge that this software is owned by
- * Samsung and you shall not disclose such Confidential Information and shall use it only in
- * accordance with the terms of the license agreement you entered into with SAMSUNG
- * ELECTRONICS.SAMSUNG make no representations or warranties about the suitability of
- * the software, either express or implied, including but not limited to the implied warranties
- * of merchantability, fitness for a particular purpose, or non-infringement.SAMSUNG shall not
- * be liable for any damages suffered by licensee arising out of or related to this software.
- *
- */
-/*****************************************************************************/
-
-#include <stdbool.h>
-#include <service_adaptor_client.h>
-
-#include "log.h"
-#include "assert.h"
-
-#define IS_NULL(x) (NULL == x)
-#define NOT_NULL(x) (!IS_NULL(x))
-#define NOT_USED(x)
-
-static service_plugin_h service_plugin = NULL;
-static service_adaptor_error_e result = SERVICE_ADAPTOR_ERROR_NONE;
-
-static service_storage_cloud_file_h file = NULL;
-
-static const char *service_plugin_uri = "org.tizen.service-plugin-sample";
-
-static bool _service_storage_cloud_file_cb(int result, service_storage_cloud_file_h file, void *user_data)
-{
- NOT_USED(result);
- NOT_USED(file);
- NOT_USED(user_data);
-
- return true;
-}
-
-/**
- * @function utc_service_storage_startup
- * @description Called before each test
- * @parameter NA
- * @return NA
- */
-void utc_service_storage_startup(void)
-{
- log_debug_func("STARTUP");
-
- result = SERVICE_ADAPTOR_ERROR_UNKNOWN;
- service_plugin = NULL;
-
- service_adaptor_connect();
-
- result = service_plugin_create(service_plugin_uri,
- &service_plugin);
-
- /* TODO: login aync function */
- result = service_plugin_start_all(service_plugin);
-}
-
-/**
- * @function utc_service_storage_cleanup
- * @description Called after each test
- * @parameter NA
- * @return NA
- */
-void utc_service_storage_cleanup(void)
-{
- log_debug_func("CLEANUP");
-
- if (NOT_NULL(file))
- {
- service_storage_cloud_file_destroy(file);
- file = NULL;
- }
-
- if (NOT_NULL(service_plugin))
- {
- service_plugin_stop(service_plugin);
- service_plugin_destroy(service_plugin);
- service_plugin = NULL;
- }
-
- service_adaptor_disconnect();
-}
-
-/************************ Positive tests *************************************/
-
-/**
- * Check proper function service_storage_cloud_file_create with basic input
- */
-/**
- * @testcase utc_service_storage_cloud_file_create_p
- * @since_tizen 2.3
- * @description
- */
-int utc_service_storage_cloud_file_create_p(void)
-{
- startfunc;
-
- result = service_storage_cloud_file_create(service_plugin, &file);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_storage_cloud_file_clone with basic input
- */
-/**
- * @testcase utc_service_storage_cloud_file_clone_p
- * @since_tizen 2.3
- * @description
- */
-int utc_service_storage_cloud_file_clone_p(void)
-{
- startfunc;
-
- result = service_storage_cloud_file_create(service_plugin, &file);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- service_storage_cloud_file_h clone_file = NULL;
- result = service_storage_cloud_file_clone(file, &clone_file);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_storage_cloud_file_destroy with basic input
- */
-/**
- * @testcase utc_service_storage_cloud_file_destroy_p
- * @since_tizen 2.3
- * @description
- */
-int utc_service_storage_cloud_file_destroy_p(void)
-{
- startfunc;
-
- result = service_storage_cloud_file_create(service_plugin, &file);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- result = service_storage_cloud_file_destroy(file);
- file = NULL;
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_storage_cloud_file_set_callback with basic input
- */
-/**
- * @testcase utc_service_storage_cloud_file_set_callback_p
- * @since_tizen 2.3
- * @description
- */
-int utc_service_storage_cloud_file_set_callback_p(void)
-{
- startfunc;
-
- result = service_storage_cloud_file_create(service_plugin, &file);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- result = service_storage_cloud_file_set_callback(file, _service_storage_cloud_file_cb, NULL);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_storage_cloud_file_unset_callback with basic input
- */
-/**
- * @testcase utc_service_storage_cloud_file_unset_callback_p
- * @since_tizen 2.3
- * @description
- */
-int utc_service_storage_cloud_file_unset_callback_p(void)
-{
- startfunc;
-
- result = service_storage_cloud_file_create(service_plugin, &file);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- result = service_storage_cloud_file_unset_callback(file);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_storage_cloud_file_set_cloud_path with basic input
- */
-/**
- * @testcase utc_service_storage_cloud_file_set_cloud_path_p
- * @since_tizen 2.3
- * @description
- */
-int utc_service_storage_cloud_file_set_cloud_path_p(void)
-{
- startfunc;
-
- result = service_storage_cloud_file_create(service_plugin, &file);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- char *cloud_path = "/root/tct";
- result = service_storage_cloud_file_set_cloud_path(file, cloud_path);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_storage_cloud_file_get_cloud_path with basic input
- */
-/**
- * @testcase utc_service_storage_cloud_file_get_cloud_path_p
- * @since_tizen 2.3
- * @description
- */
-int utc_service_storage_cloud_file_get_cloud_path_p(void)
-{
- startfunc;
-
- result = service_storage_cloud_file_create(service_plugin, &file);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- char *cloud_path = NULL;
- result = service_storage_cloud_file_get_cloud_path(file, &cloud_path);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_storage_cloud_file_set_local_path with basic input
- */
-/**
- * @testcase utc_service_storage_cloud_file_set_local_path_p
- * @since_tizen 2.3
- * @description
- */
-int utc_service_storage_cloud_file_set_local_path_p(void)
-{
- startfunc;
-
- result = service_storage_cloud_file_create(service_plugin, &file);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- char *local_path = "/root/tct";
- result = service_storage_cloud_file_set_local_path(file, local_path);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_storage_cloud_file_get_local_path with basic input
- */
-/**
- * @testcase utc_service_storage_cloud_file_get_local_path_p
- * @since_tizen 2.3
- * @description
- */
-int utc_service_storage_cloud_file_get_local_path_p(void)
-{
- startfunc;
-
- result = service_storage_cloud_file_create(service_plugin, &file);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- char *local_path = NULL;
- result = service_storage_cloud_file_get_local_path(file, &local_path);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_storage_cloud_file_set_size with basic input
- */
-/**
- * @testcase utc_service_storage_cloud_file_set_size_p
- * @since_tizen 2.3
- * @description
- */
-int utc_service_storage_cloud_file_set_size_p(void)
-{
- startfunc;
-
- result = service_storage_cloud_file_create(service_plugin, &file);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- unsigned long long size = 100;
- result = service_storage_cloud_file_set_size(file, size);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_storage_cloud_file_get_size with basic input
- */
-/**
- * @testcase utc_service_storage_cloud_file_get_size_p
- * @since_tizen 2.3
- * @description
- */
-int utc_service_storage_cloud_file_get_size_p(void)
-{
- startfunc;
-
- result = service_storage_cloud_file_create(service_plugin, &file);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- unsigned long long size = 0;
- result = service_storage_cloud_file_get_size(file, &size);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_storage_cloud_file_set_operation with basic input
- */
-/**
- * @testcase utc_service_storage_cloud_file_set_operation_p
- * @since_tizen 2.3
- * @description
- */
-int utc_service_storage_cloud_file_set_operation_p(void)
-{
- startfunc;
-
- result = service_storage_cloud_file_create(service_plugin, &file);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- result = service_storage_cloud_file_set_operation(file, SERVICE_STORAGE_CLOUD_REMOVE_FILE_URI);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_storage_cloud_file_get_operation with basic input
- */
-/**
- * @testcase utc_service_storage_cloud_file_get_operation_p
- * @since_tizen 2.3
- * @description
- */
-int utc_service_storage_cloud_file_get_operation_p(void)
-{
- startfunc;
-
- result = service_storage_cloud_file_create(service_plugin, &file);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- char *operation = NULL;
- result = service_storage_cloud_file_get_operation(file, &operation);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_storage_cloud_file_is_directory with basic input
- */
-/**
- * @testcase utc_service_storage_cloud_file_is_directory_p
- * @since_tizen 2.3
- * @description
- */
-int utc_service_storage_cloud_file_is_directory_p(void)
-{
- startfunc;
-
- result = service_storage_cloud_file_create(service_plugin, &file);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- bool is_dir = false;
- result = service_storage_cloud_file_is_directory(file, &is_dir);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_storage_cloud_file_foreach_file with basic input
- */
-/**
- * @testcase utc_service_storage_cloud_file_foreach_file_p
- * @since_tizen 2.3
- * @description
- */
-int utc_service_storage_cloud_file_foreach_file_p(void)
-{
- startfunc;
-
- result = service_storage_cloud_file_create(service_plugin, &file);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- result = service_storage_cloud_file_foreach_file(file, _service_storage_cloud_file_cb, NULL);
- if (SERVICE_ADAPTOR_ERROR_NO_DATA == result) {
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NO_DATA);
- } else {
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
- }
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_storage_cloud_file_create_task with basic input
- */
-/**
- * @testcase utc_service_storage_cloud_file_create_task_p
- * @since_tizen 2.3
- * @description
- */
-int utc_service_storage_cloud_file_create_task_p(void)
-{
- startfunc;
-
- result = service_storage_cloud_file_create(service_plugin, &file);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- service_task_h task = NULL;
- result = service_storage_cloud_file_create_task(file, &task);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_storage_cloud_file_destroy_task with basic input
- */
-/**
- * @testcase utc_service_storage_cloud_file_destroy_task_p
- * @since_tizen 2.3
- * @description
- */
-int utc_service_storage_cloud_file_destroy_task_p(void)
-{
- startfunc;
-
- result = service_storage_cloud_file_create(service_plugin, &file);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- service_task_h task = NULL;
- result = service_storage_cloud_file_create_task(file, &task);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- result = service_storage_cloud_file_destroy_task(task);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- endfunc;
-
- return 0;
-}
-
-/************************ Negative tests *************************************/
-
-/**
- * Check proper function service_storage_cloud_file_create with basic input
- */
-/**
- * @testcase utc_service_storage_cloud_file_create_n
- * @since_tizen 2.3
- * @description
- */
-int utc_service_storage_cloud_file_create_n(void)
-{
- startfunc;
-
- result = service_storage_cloud_file_create(NULL, &file);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_storage_cloud_file_create with basic input
- */
-/**
- * @testcase utc_service_storage_cloud_file_create_n2
- * @since_tizen 2.3
- * @description
- */
-int utc_service_storage_cloud_file_create_n2(void)
-{
- startfunc;
-
- result = service_storage_cloud_file_create(service_plugin, NULL);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_storage_cloud_file_clone with basic input
- */
-/**
- * @testcase utc_service_storage_cloud_file_clone_n
- * @since_tizen 2.3
- * @description
- */
-int utc_service_storage_cloud_file_clone_n(void)
-{
- startfunc;
-
- result = service_storage_cloud_file_create(service_plugin, &file);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- service_storage_cloud_file_h clone_file = NULL;
- result = service_storage_cloud_file_clone(NULL, &clone_file);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_storage_cloud_file_clone with basic input
- */
-/**
- * @testcase utc_service_storage_cloud_file_clone_n2
- * @since_tizen 2.3
- * @description
- */
-int utc_service_storage_cloud_file_clone_n2(void)
-{
- startfunc;
-
- result = service_storage_cloud_file_create(service_plugin, &file);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- result = service_storage_cloud_file_clone(file, NULL);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_storage_cloud_file_destroy with basic input
- */
-/**
- * @testcase utc_service_storage_cloud_file_destroy_n
- * @since_tizen 2.3
- * @description
- */
-int utc_service_storage_cloud_file_destroy_n(void)
-{
- startfunc;
-
- result = service_storage_cloud_file_create(service_plugin, &file);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- result = service_storage_cloud_file_destroy(NULL);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_storage_cloud_file_set_callback with basic input
- */
-/**
- * @testcase utc_service_storage_cloud_file_set_callback_n
- * @since_tizen 2.3
- * @description
- */
-int utc_service_storage_cloud_file_set_callback_n(void)
-{
- startfunc;
-
- result = service_storage_cloud_file_create(service_plugin, &file);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- result = service_storage_cloud_file_set_callback(NULL, _service_storage_cloud_file_cb, NULL);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_storage_cloud_file_set_callback with basic input
- */
-/**
- * @testcase utc_service_storage_cloud_file_set_callback_n2
- * @since_tizen 2.3
- * @description
- */
-int utc_service_storage_cloud_file_set_callback_n2(void)
-{
- startfunc;
-
- result = service_storage_cloud_file_create(service_plugin, &file);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- result = service_storage_cloud_file_set_callback(file, NULL, NULL);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_storage_cloud_file_unset_callback with basic input
- */
-/**
- * @testcase utc_service_storage_cloud_file_unset_callback_n
- * @since_tizen 2.3
- * @description
- */
-int utc_service_storage_cloud_file_unset_callback_n(void)
-{
- startfunc;
-
- result = service_storage_cloud_file_create(service_plugin, &file);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- result = service_storage_cloud_file_unset_callback(NULL);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_storage_cloud_file_set_cloud_path with basic input
- */
-/**
- * @testcase utc_service_storage_cloud_file_set_cloud_path_n
- * @since_tizen 2.3
- * @description
- */
-int utc_service_storage_cloud_file_set_cloud_path_n(void)
-{
- startfunc;
-
- result = service_storage_cloud_file_create(service_plugin, &file);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- char *cloud_path = "/root/tct";
- result = service_storage_cloud_file_set_cloud_path(NULL, cloud_path);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_storage_cloud_file_set_cloud_path with basic input
- */
-/**
- * @testcase utc_service_storage_cloud_file_set_cloud_path_n2
- * @since_tizen 2.3
- * @description
- */
-int utc_service_storage_cloud_file_set_cloud_path_n2(void)
-{
- startfunc;
-
- result = service_storage_cloud_file_create(service_plugin, &file);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- result = service_storage_cloud_file_set_cloud_path(file, NULL);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_storage_cloud_file_get_cloud_path with basic input
- */
-/**
- * @testcase utc_service_storage_cloud_file_get_cloud_path_n
- * @since_tizen 2.3
- * @description
- */
-int utc_service_storage_cloud_file_get_cloud_path_n(void)
-{
- startfunc;
-
- result = service_storage_cloud_file_create(service_plugin, &file);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- char *cloud_path = NULL;
- result = service_storage_cloud_file_get_cloud_path(NULL, &cloud_path);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_storage_cloud_file_get_cloud_path with basic input
- */
-/**
- * @testcase utc_service_storage_cloud_file_get_cloud_path_n2
- * @since_tizen 2.3
- * @description
- */
-int utc_service_storage_cloud_file_get_cloud_path_n2(void)
-{
- startfunc;
-
- result = service_storage_cloud_file_create(service_plugin, &file);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- result = service_storage_cloud_file_get_cloud_path(file, NULL);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_storage_cloud_file_set_local_path with basic input
- */
-/**
- * @testcase utc_service_storage_cloud_file_set_local_path_n
- * @since_tizen 2.3
- * @description
- */
-int utc_service_storage_cloud_file_set_local_path_n(void)
-{
- startfunc;
-
- result = service_storage_cloud_file_create(service_plugin, &file);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- char *local_path = "/root/tct";
- result = service_storage_cloud_file_set_local_path(NULL, local_path);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_storage_cloud_file_set_local_path with basic input
- */
-/**
- * @testcase utc_service_storage_cloud_file_set_local_path_n2
- * @since_tizen 2.3
- * @description
- */
-int utc_service_storage_cloud_file_set_local_path_n2(void)
-{
- startfunc;
-
- result = service_storage_cloud_file_create(service_plugin, &file);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- result = service_storage_cloud_file_set_local_path(file, NULL);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_storage_cloud_file_get_local_path with basic input
- */
-/**
- * @testcase utc_service_storage_cloud_file_get_local_path_n
- * @since_tizen 2.3
- * @description
- */
-int utc_service_storage_cloud_file_get_local_path_n(void)
-{
- startfunc;
-
- result = service_storage_cloud_file_create(service_plugin, &file);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- char *local_path = NULL;
- result = service_storage_cloud_file_get_local_path(NULL, &local_path);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_storage_cloud_file_get_local_path with basic input
- */
-/**
- * @testcase utc_service_storage_cloud_file_get_local_path_n2
- * @since_tizen 2.3
- * @description
- */
-int utc_service_storage_cloud_file_get_local_path_n2(void)
-{
- startfunc;
-
- result = service_storage_cloud_file_create(service_plugin, &file);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- result = service_storage_cloud_file_get_local_path(file, NULL);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_storage_cloud_file_set_size with basic input
- */
-/**
- * @testcase utc_service_storage_cloud_file_set_size_n
- * @since_tizen 2.3
- * @description
- */
-int utc_service_storage_cloud_file_set_size_n(void)
-{
- startfunc;
-
- result = service_storage_cloud_file_create(service_plugin, &file);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- unsigned long long size = 100;
- result = service_storage_cloud_file_set_size(NULL, size);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_storage_cloud_file_get_size with basic input
- */
-/**
- * @testcase utc_service_storage_cloud_file_get_size_n
- * @since_tizen 2.3
- * @description
- */
-int utc_service_storage_cloud_file_get_size_n(void)
-{
- startfunc;
-
- result = service_storage_cloud_file_create(service_plugin, &file);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- unsigned long long size = 0;
- result = service_storage_cloud_file_get_size(NULL, &size);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_storage_cloud_file_get_size with basic input
- */
-/**
- * @testcase utc_service_storage_cloud_file_get_size_n2
- * @since_tizen 2.3
- * @description
- */
-int utc_service_storage_cloud_file_get_size_n2(void)
-{
- startfunc;
-
- result = service_storage_cloud_file_create(service_plugin, &file);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- result = service_storage_cloud_file_get_size(file, NULL);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_storage_cloud_file_set_operation with basic input
- */
-/**
- * @testcase utc_service_storage_cloud_file_set_operation_n
- * @since_tizen 2.3
- * @description
- */
-int utc_service_storage_cloud_file_set_operation_n(void)
-{
- startfunc;
-
- result = service_storage_cloud_file_create(service_plugin, &file);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- result = service_storage_cloud_file_set_operation(NULL, SERVICE_STORAGE_CLOUD_REMOVE_FILE_URI);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_storage_cloud_file_set_operation with basic input
- */
-/**
- * @testcase utc_service_storage_cloud_file_set_operation_n2
- * @since_tizen 2.3
- * @description
- */
-int utc_service_storage_cloud_file_set_operation_n2(void)
-{
- startfunc;
-
- result = service_storage_cloud_file_create(service_plugin, &file);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- result = service_storage_cloud_file_set_operation(file, NULL);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_storage_cloud_file_get_operation with basic input
- */
-/**
- * @testcase utc_service_storage_cloud_file_get_operation_n
- * @since_tizen 2.3
- * @description
- */
-int utc_service_storage_cloud_file_get_operation_n(void)
-{
- startfunc;
-
- result = service_storage_cloud_file_create(service_plugin, &file);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- char *operation = NULL;
- result = service_storage_cloud_file_get_operation(NULL, &operation);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_storage_cloud_file_get_operation with basic input
- */
-/**
- * @testcase utc_service_storage_cloud_file_get_operation_n2
- * @since_tizen 2.3
- * @description
- */
-int utc_service_storage_cloud_file_get_operation_n2(void)
-{
- startfunc;
-
- result = service_storage_cloud_file_create(service_plugin, &file);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- result = service_storage_cloud_file_get_operation(file, NULL);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_storage_cloud_file_is_directory with basic input
- */
-/**
- * @testcase utc_service_storage_cloud_file_is_directory_n
- * @since_tizen 2.3
- * @description
- */
-int utc_service_storage_cloud_file_is_directory_n(void)
-{
- startfunc;
-
- result = service_storage_cloud_file_create(service_plugin, &file);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- bool is_dir = false;
- result = service_storage_cloud_file_is_directory(NULL, &is_dir);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_storage_cloud_file_is_directory with basic input
- */
-/**
- * @testcase utc_service_storage_cloud_file_is_directory_n2
- * @since_tizen 2.3
- * @description
- */
-int utc_service_storage_cloud_file_is_directory_n2(void)
-{
- startfunc;
-
- result = service_storage_cloud_file_create(service_plugin, &file);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- result = service_storage_cloud_file_is_directory(file, NULL);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_storage_cloud_file_foreach_file with basic input
- */
-/**
- * @testcase utc_service_storage_cloud_file_foreach_file_n
- * @since_tizen 2.3
- * @description
- */
-int utc_service_storage_cloud_file_foreach_file_n(void)
-{
- startfunc;
-
- result = service_storage_cloud_file_create(service_plugin, &file);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- result = service_storage_cloud_file_foreach_file(NULL, _service_storage_cloud_file_cb, NULL);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_storage_cloud_file_foreach_file with basic input
- */
-/**
- * @testcase utc_service_storage_cloud_file_foreach_file_n2
- * @since_tizen 2.3
- * @description
- */
-int utc_service_storage_cloud_file_foreach_file_n2(void)
-{
- startfunc;
-
- result = service_storage_cloud_file_create(service_plugin, &file);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- result = service_storage_cloud_file_foreach_file(file, NULL, NULL);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_storage_cloud_file_create_task with basic input
- */
-/**
- * @testcase utc_service_storage_cloud_file_create_task_n
- * @since_tizen 2.3
- * @description
- */
-int utc_service_storage_cloud_file_create_task_n(void)
-{
- startfunc;
-
- result = service_storage_cloud_file_create(service_plugin, &file);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- service_task_h task = NULL;
- result = service_storage_cloud_file_create_task(NULL, &task);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_storage_cloud_file_create_task with basic input
- */
-/**
- * @testcase utc_service_storage_cloud_file_create_task_n2
- * @since_tizen 2.3
- * @description
- */
-int utc_service_storage_cloud_file_create_task_n2(void)
-{
- startfunc;
-
- result = service_storage_cloud_file_create(service_plugin, &file);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- result = service_storage_cloud_file_create_task(file, NULL);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_storage_cloud_file_destroy_task with basic input
- */
-/**
- * @testcase utc_service_storage_cloud_file_destroy_task_n
- * @since_tizen 2.3
- * @description
- */
-int utc_service_storage_cloud_file_destroy_task_n(void)
-{
- startfunc;
-
- result = service_storage_cloud_file_create(service_plugin, &file);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- service_task_h task = NULL;
- result = service_storage_cloud_file_create_task(file, &task);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- result = service_storage_cloud_file_destroy_task(NULL);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER);
-
- endfunc;
-
- return 0;
-}
+++ /dev/null
-/*
- * utc-capi-service-adaptor-task
- *
- * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved.
- *
- * PROPRIETARY/CONFIDENTIAL
- *
- * This software is the confidential and proprietary information of SAMSUNG ELECTRONICS
- * ("Confidential Information"). You agree and acknowledge that this software is owned by
- * Samsung and you shall not disclose such Confidential Information and shall use it only in
- * accordance with the terms of the license agreement you entered into with SAMSUNG
- * ELECTRONICS.SAMSUNG make no representations or warranties about the suitability of
- * the software, either express or implied, including but not limited to the implied warranties
- * of merchantability, fitness for a particular purpose, or non-infringement.SAMSUNG shall not
- * be liable for any damages suffered by licensee arising out of or related to this software.
- *
- */
-/*****************************************************************************/
-
-#include <stdbool.h>
-#include <service_adaptor_client.h>
-
-#include "log.h"
-#include "assert.h"
-
-#define IS_NULL(x) (NULL == x)
-#define NOT_NULL(x) (!IS_NULL(x))
-#define NOT_USED(x)
-
-static service_task_h task = NULL;
-static service_plugin_h service_plugin = NULL;
-static service_adaptor_error_e result = SERVICE_ADAPTOR_ERROR_NONE;
-
-static service_storage_cloud_file_h file = NULL;
-
-static const char *service_plugin_uri = "org.tizen.service-plugin-sample";
-static bool task_started = false;
-
-static void _service_task_progress_cb(service_task_h task, unsigned long long progress,
- unsigned long long total,
- void *user_data)
-{
- NOT_USED(task);
- NOT_USED(progress);
- NOT_USED(total);
- NOT_USED(user_data);
-}
-
-static void _service_task_state_changed_cb(service_task_h task, service_task_state_e state,
- void *user_data)
-{
- NOT_USED(task);
- NOT_USED(state);
- NOT_USED(user_data);
-}
-
-static bool _service_storage_cloud_file_cb(int result, service_storage_cloud_file_h file, void *user_data)
-{
- NOT_USED(result);
- NOT_USED(file);
- NOT_USED(user_data);
-
- return true;
-}
-
-/**
- * @function utc_service_task_startup
- * @description Called before each test
- * @parameter NA
- * @return NA
- */
-void utc_service_task_startup(void)
-{
- log_debug_func("STARTUP");
-
- result = SERVICE_ADAPTOR_ERROR_UNKNOWN;
- service_plugin = NULL;
- task_started = false;
-
- service_adaptor_connect();
-
- result = service_plugin_create(service_plugin_uri,
- &service_plugin);
-
- /* TODO: login aync function */
- result = service_plugin_start_all(service_plugin);
- result = service_storage_cloud_file_create(service_plugin, &file);
- result = service_storage_cloud_file_set_callback(file, _service_storage_cloud_file_cb, NULL);
- result = service_storage_cloud_file_set_cloud_path(file, "/root/cloud");
- result = service_storage_cloud_file_set_operation(file, SERVICE_STORAGE_CLOUD_REMOVE_FILE_URI);
- result = service_storage_cloud_file_create_task(file, &task);
-}
-
-/**
- * @function utc_service_task_cleanup
- * @description Called after each test
- * @parameter NA
- * @return NA
- */
-void utc_service_task_cleanup(void)
-{
- log_debug_func("CLEANUP");
-
- if (NOT_NULL(task))
- {
- if (task_started) {
- service_task_stop(task);
- task_started = false;
- }
- service_storage_cloud_file_destroy_task(task);
- task = NULL;
- }
-
- if (NOT_NULL(service_plugin))
- {
- service_plugin_stop(service_plugin);
- service_plugin_destroy(service_plugin);
- service_plugin = NULL;
- }
-
- service_adaptor_disconnect();
-}
-
-/************************ Positive tests *************************************/
-
-/**
- * Check proper function service_task_start with basic input
- */
-/**
- * @testcase utc_service_task_start_p
- * @since_tizen 2.3
- * @description
- */
-int utc_service_task_start_p(void)
-{
- startfunc;
-
- result = service_task_start(task);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
- task_started = true;
- sleep(1);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_task_stop with basic input
- */
-/**
- * @testcase utc_service_task_stop_p
- * @since_tizen 2.3
- * @description
- */
-int utc_service_task_stop_p(void)
-{
- startfunc;
-
- result = service_task_stop(task);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_task_set_uri with basic input
- */
-/**
- * @testcase utc_service_task_set_uri_p
- * @since_tizen 2.3
- * @description
- */
-int utc_service_task_set_uri_p(void)
-{
- startfunc;
-
- char *uri = "tct";
- result = service_task_set_uri(task, uri);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_task_get_uri with basic input
- */
-/**
- * @testcase utc_service_task_get_uri_p
- * @since_tizen 2.3
- * @description
- */
-int utc_service_task_get_uri_p(void)
-{
- startfunc;
-
- char *uri = NULL;
- result = service_task_get_uri(task, &uri);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_task_set_progress_callback with basic input
- */
-/**
- * @testcase utc_service_task_set_progress_callback_p
- * @since_tizen 2.3
- * @description
- */
-int utc_service_task_set_progress_callback_p(void)
-{
- startfunc;
-
- result = service_task_set_progress_callback(task, _service_task_progress_cb, NULL);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_task_unset_progress_callback with basic input
- */
-/**
- * @testcase utc_service_task_unset_progress_callback_p
- * @since_tizen 2.3
- * @description
- */
-int utc_service_task_unset_progress_callback_p(void)
-{
- startfunc;
-
- result = service_task_unset_progress_callback(task);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_task_set_state_changed_callback with basic input
- */
-/**
- * @testcase utc_service_task_set_state_changed_callback_p
- * @since_tizen 2.3
- * @description
- */
-int utc_service_task_set_state_changed_callback_p(void)
-{
- startfunc;
-
- result = service_task_set_state_changed_callback(task, _service_task_state_changed_cb, NULL);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_task_unset_state_changed_callback with basic input
- */
-/**
- * @testcase utc_service_task_unset_state_changed_callback_p
- * @since_tizen 2.3
- * @description
- */
-int utc_service_task_unset_state_changed_callback_p(void)
-{
- startfunc;
-
- result = service_task_unset_state_changed_callback(task);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_NONE);
-
- endfunc;
-
- return 0;
-}
-
-/************************ Negative tests *************************************/
-
-/**
- * Check proper function service_task_start with basic input
- */
-/**
- * @testcase utc_service_task_start_n
- * @since_tizen 2.3
- * @description
- */
-int utc_service_task_start_n(void)
-{
- startfunc;
-
- result = service_task_start(NULL);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_task_stop with basic input
- */
-/**
- * @testcase utc_service_task_stop_n
- * @since_tizen 2.3
- * @description
- */
-int utc_service_task_stop_n(void)
-{
- startfunc;
-
- result = service_task_stop(NULL);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_task_set_uri with basic input
- */
-/**
- * @testcase utc_service_task_set_uri_n
- * @since_tizen 2.3
- * @description
- */
-int utc_service_task_set_uri_n(void)
-{
- startfunc;
-
- char *uri = "tct";
- result = service_task_set_uri(NULL, uri);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_task_set_uri with basic input
- */
-/**
- * @testcase utc_service_task_set_uri_n2
- * @since_tizen 2.3
- * @description
- */
-int utc_service_task_set_uri_n2(void)
-{
- startfunc;
-
- result = service_task_set_uri(task, NULL);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_task_get_uri with basic input
- */
-/**
- * @testcase utc_service_task_get_uri_n
- * @since_tizen 2.3
- * @description
- */
-int utc_service_task_get_uri_n(void)
-{
- startfunc;
-
- char *uri = NULL;
- result = service_task_get_uri(NULL, &uri);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_task_get_uri with basic input
- */
-/**
- * @testcase utc_service_task_get_uri_n2
- * @since_tizen 2.3
- * @description
- */
-int utc_service_task_get_uri_n2(void)
-{
- startfunc;
-
- result = service_task_get_uri(task, NULL);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_task_set_progress_callback with basic input
- */
-/**
- * @testcase utc_service_task_set_progress_callback_n
- * @since_tizen 2.3
- * @description
- */
-int utc_service_task_set_progress_callback_n(void)
-{
- startfunc;
-
- result = service_task_set_progress_callback(NULL, _service_task_progress_cb, NULL);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_task_set_progress_callback with basic input
- */
-/**
- * @testcase utc_service_task_set_progress_callback_n2
- * @since_tizen 2.3
- * @description
- */
-int utc_service_task_set_progress_callback_n2(void)
-{
- startfunc;
-
- result = service_task_set_progress_callback(task, NULL, NULL);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_task_unset_progress_callback with basic input
- */
-/**
- * @testcase utc_service_task_unset_progress_callback_n
- * @since_tizen 2.3
- * @description
- */
-int utc_service_task_unset_progress_callback_n(void)
-{
- startfunc;
-
- result = service_task_unset_progress_callback(NULL);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_task_set_state_changed_callback with basic input
- */
-/**
- * @testcase utc_service_task_set_state_changed_callback_n
- * @since_tizen 2.3
- * @description
- */
-int utc_service_task_set_state_changed_callback_n(void)
-{
- startfunc;
-
- result = service_task_set_state_changed_callback(NULL, _service_task_state_changed_cb, NULL);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_task_set_state_changed_callback with basic input
- */
-/**
- * @testcase utc_service_task_set_state_changed_callback_n2
- * @since_tizen 2.3
- * @description
- */
-int utc_service_task_set_state_changed_callback_n2(void)
-{
- startfunc;
-
- result = service_task_set_state_changed_callback(task, NULL, NULL);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER);
-
- endfunc;
-
- return 0;
-}
-
-/**
- * Check proper function service_task_unset_state_changed_callback with basic input
- */
-/**
- * @testcase utc_service_task_unset_state_changed_callback_n
- * @since_tizen 2.3
- * @description
- */
-int utc_service_task_unset_state_changed_callback_n(void)
-{
- startfunc;
-
- result = service_task_unset_state_changed_callback(NULL);
- assert_eq(result, SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER);
-
- endfunc;
-
- return 0;
-}