Tizen 2.0 Release
[platform/core/api/face.git] / TC / testcase / utc_uix_face_component_negative.c
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #include <stdio.h>
18 #include <tet_api.h>
19
20 #include <face.h>
21
22 static void startup(void);
23 static void cleanup(void);
24
25 void (*tet_startup)(void) = startup;
26 void (*tet_cleanup)(void) = cleanup;
27
28 static void startup(void)
29 {
30 // TODO : How to copy sample image????
31 }
32
33 static void cleanup(void)
34 {
35         /* end of TC */
36 }
37
38 static void utc_uix_face_component_create_negative(void)
39 {
40         static const char szFunc[] = "face_component_create";
41
42         int err = face_component_create(NULL);
43
44         dts_check_lt(szFunc, err, FACE_ERROR_NONE);
45 }
46
47
48
49 static void utc_uix_face_component_destroy_negative(void)
50 {
51         static const char szFunc[] = "face_component_destroy";
52
53         int err;
54
55         err = face_component_destroy(NULL);
56
57         dts_check_lt(szFunc, err, FACE_ERROR_NONE);
58
59 }
60
61
62 static void utc_uix_face_component_get_face_rect_negative(void)
63 {
64         static const char szFunc[] = "face_component_get_face_rect";
65
66         int err;
67
68         face_component_h face_component;
69
70     err = face_component_create(&face_component);
71
72         face_rect_s face;
73
74         err = face_component_get_face_rect(NULL, &face);
75
76         dts_check_lt(szFunc, err, FACE_ERROR_NONE);
77
78         err = face_component_destroy(face_component);
79 }
80
81
82 static void utc_uix_face_component_get_left_eye_point_negative(void)
83 {
84         static const char szFunc[] = "face_component_get_left_eye_point";
85
86         int err;
87
88         face_component_h face_component;
89
90     err = face_component_create(&face_component);
91
92         face_point_s point;
93
94         err = face_component_get_left_eye_point(NULL, &point);
95
96         dts_check_lt(szFunc, err, FACE_ERROR_NONE);
97
98         err = face_component_get_left_eye_point(face_component, NULL);
99
100         dts_check_lt(szFunc, err, FACE_ERROR_NONE);
101
102         err = face_component_destroy(face_component);
103 }
104
105 static void utc_uix_face_component_get_right_eye_point_negative(void)
106 {
107         static const char szFunc[] = "face_component_get_right_eye_point";
108
109         int err;
110
111         face_component_h face_component;
112
113     err = face_component_create(&face_component);
114
115         face_point_s point;
116
117         err = face_component_get_right_eye_point(NULL, &point);
118
119         dts_check_lt(szFunc, err, FACE_ERROR_NONE);
120
121         err = face_component_get_right_eye_point(face_component, NULL);
122
123         dts_check_lt(szFunc, err, FACE_ERROR_NONE);
124
125         err = face_component_destroy(face_component);
126 }
127
128 static void utc_uix_face_component_get_mouth_rect_negative(void)
129 {
130         static const char szFunc[] = "face_component_get_mouth_rect";
131
132         int err;
133
134         face_component_h face_component;
135
136     err = face_component_create(&face_component);
137
138         face_rect_s mouth;
139
140         err = face_component_get_mouth_rect(face_component, NULL);
141
142         dts_check_lt(szFunc, err, FACE_ERROR_NONE);
143
144         err = face_component_get_mouth_rect(NULL, &mouth);
145
146         dts_check_lt(szFunc, err, FACE_ERROR_NONE);
147
148         err = face_component_destroy(face_component);
149 }
150
151
152 struct tet_testlist tet_testlist[] = {
153     { utc_uix_face_component_create_negative, 1},
154         { utc_uix_face_component_destroy_negative, 2},
155         { utc_uix_face_component_get_face_rect_negative, 3},
156         { utc_uix_face_component_get_left_eye_point_negative, 4},
157         { utc_uix_face_component_get_right_eye_point_negative, 5},
158         { utc_uix_face_component_get_mouth_rect_negative, 6},
159         { NULL, 0},
160 };
161
162