netatalk  4.4.0dev
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
testhelper.h
Go to the documentation of this file.
1/* -------------------------------- */
2#ifndef TESTHELPER_H
3#define TESTHELPER_H
4
5/* Macros */
6#define FAIL(a) \
7 if ((a)) { \
8 if (!Quiet) { \
9 if (Color) { \
10 fprintf(stdout, ANSI_BRED"[%s:%d] " #a "\n" ANSI_NORMAL, __FILE__, __LINE__);\
11 } else {\
12 fprintf(stdout, "[%s:%d] " #a "\n", __FILE__, __LINE__); \
13 } \
14 } \
15 test_failed(); \
16 }
17
18#define FAILEXIT(a, label) if ((a)) { test_failed(); goto label;}
19#define STATIC
20
21#define ENTER_TESTSET \
22 fprintf(stdout,"===================\n"); \
23 fprintf(stdout,"Executing testset: %s\n", __func__); \
24
25#define ENTER_TEST \
26 if (!Quiet) { \
27 fprintf(stdout, "############## entering %s ##############\n", __func__); \
28 } \
29 enter_test(); \
30
31/* Skipped test status codes */
32#define T_CONN2 1
33#define T_PATH 2
34#define T_AFP3 3
35#define T_AFP3_CONN2 4
36#if 0
37#define T_MAC_PATH 5
38#endif
39#define T_UNIX_PREV 6
40#define T_UTF8 7
41#define T_VOL2 8
42#if 0
43#define T_LOCKING 9
44#endif
45#define T_VOL_SMALL 10
46#define T_ID 11
47#define T_AFP2 12
48#define T_MAC 13
49#define T_ACL 14
50#define T_EA 15
51#define T_UNIX_GROUP 16
52#define T_ADEA 17
53#define T_NOSYML 18
54#define T_ADV2 19
55#define T_AFP30 20
56#define T_NO_UNIX_PREV 21
57#define T_SINGLE 22
58#define T_VOL_BIG 23
59#if 0
60#define T_EXCLUDE 24
61#endif
62#define T_MANUAL 25
63#define T_AFP31 26
64#define T_AFP32 27
65#define T_NONDETERM 28
66#define T_BIGENDIAN 29
67#define T_CRED 30
68
69/* Define ansi colors */
70#define ANSI_RED "\033[0;31m"
71#define ANSI_GREEN "\033[0;32m"
72#define ANSI_YELLOW "\033[0;33m"
73#define ANSI_BLUE "\033[0;34m"
74#define ANSI_MAGENTA "\033[0;35m"
75#define ANSI_CYAN "\033[0;36m"
76#define ANSI_GREY "\033[0;37m"
77#define ANSI_DARKGREY "\033[01;30m"
78#define ANSI_BRED "\033[01;31m"
79#define ANSI_BGREEN "\033[01;32m"
80#define ANSI_BYELLOW "\033[01;33m"
81#define ANSI_BBLUE "\033[01;34m"
82#define ANSI_BMAGENTA "\033[01;35m"
83#define ANSI_BCYAN "\033[01;36m"
84#define ANSI_WHITE "\033[01;37m"
85#define ANSI_NORMAL "\033[0m"
86#define ANSI_BOLD "\033[1m"
87
88/* Function declarations */
89extern void test_failed(void);
90extern void test_skipped(int why);
91extern void test_nottested(void);
92extern void enter_test(void);
93extern void exit_test(char *name);
94
95/* Types */
96enum adouble {
97 AD_EA = 1,
99};
100
101/* Global variables */
102extern uint16_t VolID;
103extern int Mac;
104extern int ExitCode;
105extern enum adouble adouble;
106
107extern char Data[];
108extern char FailedTests[1024][256];
109extern char NotTestedTests[1024][256];
110extern char SkippedTests[1024][256];
111
112extern char *Vol;
113extern char *Vol2;
114extern char *Path;
115extern char *User;
116extern char *Test;
117
118extern int Version;
119extern int Verbose;
120extern int Quiet;
121extern int Locking;
122extern int Loglevel;
123extern int Color;
124extern int Interactive;
125extern int Throttle;
126extern int Bigendian;
127extern int EmptyVol;
128
129extern int PassCount;
130extern int FailCount;
131extern int SkipCount;
132extern int NotTestedCount;
133
134#endif
uint16_t VolID
Definition afparg.c:38
char * User
Definition afparg.c:48
int SkipCount
Definition afparg.c:63
int PassCount
Definition afparg.c:61
char * Test
Definition afparg.c:51
char SkippedTests[1024][256]
Definition afparg.c:67
char * Vol
Definition afparg.c:47
int Version
Definition afparg.c:49
int EmptyVol
Definition afparg.c:59
char Data[1]
Definition afparg.c:60
char NotTestedTests[1024][256]
Definition afparg.c:66
int Mac
Definition afparg.c:58
int NotTestedCount
Definition afparg.c:64
int ExitCode
Definition afparg.c:37
int FailCount
Definition afparg.c:62
char FailedTests[1024][256]
Definition afparg.c:65
int Throttle
Definition afpclient.c:7
int Bigendian
Definition afpclient.c:13
int Quiet
Definition afpclient.c:10
int Interactive
Definition afpclient.c:9
int Color
Definition afpclient.c:12
int Verbose
Definition afpclient.c:11
int Loglevel
Definition afphelper.c:14
char * Path
Definition lantest.c:107
char * Vol2
Definition spectest.c:327
int Locking
Definition spectest.c:335
Definition adouble.h:191
void test_skipped(int why)
Definition testhelper.c:20
void test_failed(void)
Definition testhelper.c:149
void exit_test(char *name)
Definition testhelper.c:189
@ AD_EA
Definition testhelper.h:97
@ AD_V2
Definition testhelper.h:98
void enter_test(void)
Definition testhelper.c:174
void test_nottested(void)
Definition testhelper.c:160