package version up to 1.7.7
[platform/core/uifw/libtdm.git] / ut / stubs / tdm_helper_stubs.h
1 #ifndef _TDM_HELPER_STUBS_H
2 #define _TDM_HELPER_STUBS_H
3
4 /* HELPER FUNCTIONS */
5
6 static int GETENV_ERROR;
7 static int SSCANF_ERROR;
8 static int FCNTL_ERROR;
9 static int DUP_ERROR;
10
11 static char *ut_getenv(const char *name)
12 {
13         if (GETENV_ERROR) {
14                 return NULL;
15         }
16
17         return "getenv";
18 }
19
20 static int ut_sscanf(const char *buf, const char *format, ...)
21 {
22         if (SSCANF_ERROR) {
23                 return -1;
24         }
25
26         return 0;
27 }
28
29 static int ut_fcntl(int fd, int cmd, ...)
30 {
31         if (FCNTL_ERROR) {
32                 return -1;
33         }
34
35         return 0;
36 }
37
38 static int ut_dup(int fd)
39 {
40         if (DUP_ERROR) {
41                 return -1;
42         }
43
44         return 2;
45 }
46
47 #endif /* _TDM_HELPER_STUBS_H */