Browse code
remove silly test support
Showing 1 changed files
1 | 1 |
deleted file mode 100644 |
... | ... |
@@ -1,59 +0,0 @@ |
1 |
-/* Copyright (C) CJ Affiliate |
|
2 |
- * |
|
3 |
- * You may use, distribute and modify this code under the |
|
4 |
- * terms of the GNU General Public License version 2 or |
|
5 |
- * later. |
|
6 |
- * |
|
7 |
- * You should have received a copy of the license with this |
|
8 |
- * file. If not, you will find a copy in the "LICENSE" file |
|
9 |
- * at https://github.com/cjdev/dual-control. |
|
10 |
- */ |
|
11 |
- |
|
12 |
-/* Include this in a module that will be under test coverage |
|
13 |
- * |
|
14 |
- */ |
|
15 |
- |
|
16 |
-#ifndef _TEST_SUPPORT_H |
|
17 |
-#define _TEST_SUPPORT_H |
|
18 |
-#include <cstdlib> |
|
19 |
-#include <cstdio> |
|
20 |
-#include <pwd.h> |
|
21 |
-#include <sys/stat.h> |
|
22 |
-// SYSLOG |
|
23 |
-void fake_openlog (const char *ident, int logopt, int facility); |
|
24 |
-void fake_syslog (int priority, const char *format, ...); |
|
25 |
-void fake_closelog (void); |
|
26 |
- |
|
27 |
-// PWD |
|
28 |
-int fake_getpwnam_r (const char *nam, struct passwd *pwd, char *buffer, |
|
29 |
- size_t bufsize, struct passwd **result); |
|
30 |
- |
|
31 |
-// SYS_STAT |
|
32 |
-int fake_stat (const char *path, struct stat *stat); |
|
33 |
- |
|
34 |
-// STDIO |
|
35 |
-FILE *fake_fopen (const char *path, const char *mode); |
|
36 |
-char *fake_fgets (char *buf, int n, FILE *fp); |
|
37 |
-int fake_fclose (FILE *fp); |
|
38 |
- |
|
39 |
-#ifdef UNIT_TEST |
|
40 |
-// SYSLOG |
|
41 |
-#define openlog(IDENT, LOGOPT, FACILITY) fake_openlog(IDENT, LOGOPT, FACILITY) |
|
42 |
-#define syslog(PRIORITY, ...) fake_syslog(PRIORITY, __VA_ARGS__) |
|
43 |
-#define closelog() fake_closelog() |
|
44 |
- |
|
45 |
-// PWD |
|
46 |
-#define getpwnam_r(USER, PASSWD, BUFFER, BUFSIZE, PRESULT) fake_getpwnam_r(USER, PASSWD, BUFFER, BUFSIZE, PRESULT) |
|
47 |
- |
|
48 |
-// SYS_STAT |
|
49 |
-#define stat(PATH, STRUCT) fake_stat(PATH, STRUCT) |
|
50 |
- |
|
51 |
-// STDIO |
|
52 |
-#define fopen(PATH, MODE) fake_fopen(PATH, MODE) |
|
53 |
-#define fgets(DEST, DEST_SIZE, FILE_HANDLE) fake_fgets(DEST, DEST_SIZE, FILE_HANDLE) |
|
54 |
-#define fclose(FILE_HANDLE) fake_fclose(FILE_HANDLE) |
|
55 |
- |
|
56 |
-#endif |
|
57 |
- |
|
58 |
-#endif |
|
59 |
- |