summaryrefslogtreecommitdiff
path: root/TC/utc/utc_thumbnail_request_from_db_func.c
blob: a64f1b8e5cd8f7ca0981dc4ac4b9597f2f433c45 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/*
 * libmedia-thumbnail
 *
 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
 *
 * Contact: Hyunjun Ko <zzoon.ko@samsung.com>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

/**
* @file 	utc_thumbnail_request_from_db_func.c
* @brief 	This is a suit of unit test cases to test thumbnail_request_from_db API function
* @author
* @version 	Initial Creation Version 0.1
* @date 	2011-10-13
*/

#include "utc_thumbnail_request_from_db_func.h"


/**
* @brief	This tests int thumbnail_request_from_db() API with valid parameters
* @par ID	utc_thumbnail_request_from_db_func_01
* @param	[in] 
* @return	This function returns zero on success, or negative value with error code
*/
void utc_thumbnail_request_from_db_func_01()
{
	int ret = -1;
	 
	const char *origin_path = "/opt/media/Images and videos/Wallpapers/Home_default.png";
	char thumb_path[1024] = {0,};

	ret = thumbnail_request_from_db(origin_path, thumb_path, sizeof(thumb_path));
	
	if (ret < MEDIA_THUMB_ERROR_NONE) {
		UTC_THUMB_LOG( "unable to get thumbnail from thumb-daemon. error code->%d", ret);
		tet_result(TET_FAIL);
		return;
	} else {
		tet_result(TET_PASS);
	}
	
	return;
}


/**
* @brief 	This tests int thumbnail_request_from_db() API with invalid parameters
* @par ID	utc_thumbnail_request_from_db_func_02
* @param	[in] 
* @return	error code on success 
*/
void utc_thumbnail_request_from_db_func_02()
{	
	int ret = -1;

	const char *origin_path = NULL;
	char thumb_path[1024] = {0,};

	ret = thumbnail_request_from_db(origin_path, thumb_path, sizeof(thumb_path));

	if (ret < MEDIA_THUMB_ERROR_NONE) {
		UTC_THUMB_LOG("abnormal condition test for null, error code->%d", ret);
		tet_result(TET_PASS);
	} else {
		UTC_THUMB_LOG("Getting thumbnail from thumb-daemon should be failed because the origin_path is NULL");
		tet_result(TET_FAIL);
	}

	return ;
}