Initialize Tizen 2.3
[framework/appfw/pkgmgr-info.git] / TC / unit / utc_ApplicationFW_pkgmgrinfo_appinfo_filter_create_func.c
1 /*
2  *  slp-pkgmgr
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>,
7  * Jaeho Lee <jaeho81.lee@samsung.com>, Shobhit Srivastava <shobhit.s@samsung.com>
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  *
21  */
22 #include <tet_api.h>
23 #include <pkgmgr-info.h>
24
25 static void startup(void);
26 static void cleanup(void);
27
28 void (*tet_startup) (void) = startup;
29 void (*tet_cleanup) (void) = cleanup;
30
31 static void utc_ApplicationFW_pkgmgrinfo_appinfo_filter_create_func_01(void);
32 static void utc_ApplicationFW_pkgmgrinfo_appinfo_filter_create_func_02(void);
33
34
35 enum {
36         POSITIVE_TC_IDX = 0x01,
37         NEGATIVE_TC_IDX,
38 };
39
40 struct tet_testlist tet_testlist[] = {
41         {utc_ApplicationFW_pkgmgrinfo_appinfo_filter_create_func_01, POSITIVE_TC_IDX},
42         {utc_ApplicationFW_pkgmgrinfo_appinfo_filter_create_func_02, NEGATIVE_TC_IDX},
43         {NULL, 0},
44 };
45
46 static void startup(void)
47 {
48 }
49
50 static void cleanup(void)
51 {
52 }
53
54 /**
55  * @brief Positive test case of pkgmgrinfo_appinfo_filter_create()
56  */
57 static void utc_ApplicationFW_pkgmgrinfo_appinfo_filter_create_func_01(void)
58 {
59         int r = 0;
60         pkgmgrinfo_appinfo_filter_h handle;
61         r = pkgmgrinfo_appinfo_filter_create(&handle);
62         if (r != PMINFO_R_OK) {
63                 tet_infoline
64                     ("pkgmgrinfo_appinfo_filter_create() failed in positive test case");
65                 tet_result(TET_FAIL);
66                 return;
67         }
68         pkgmgrinfo_appinfo_filter_destroy(handle);
69         tet_result(TET_PASS);
70 }
71
72 /**
73  * @brief Negative test case of pkgmgrinfo_appinfo_filter_create()
74  */
75 static void utc_ApplicationFW_pkgmgrinfo_appinfo_filter_create_func_02(void)
76 {
77         int r = 0;
78         r = pkgmgrinfo_appinfo_filter_create(NULL);
79         if (r == PMINFO_R_OK) {
80                 tet_infoline
81                     ("pkgmgrinfo_appinfo_filter_create() failed in negative test case");
82                 tet_result(TET_FAIL);
83                 return;
84         }
85         tet_result(TET_PASS);
86 }