summaryrefslogtreecommitdiffstats
path: root/src/ccapi/test/test_ccapi_globals.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ccapi/test/test_ccapi_globals.h')
-rw-r--r--src/ccapi/test/test_ccapi_globals.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/ccapi/test/test_ccapi_globals.h b/src/ccapi/test/test_ccapi_globals.h
new file mode 100644
index 0000000000..cebfb63d87
--- /dev/null
+++ b/src/ccapi/test/test_ccapi_globals.h
@@ -0,0 +1,47 @@
+#ifndef _TEST_CCAPI_GLOBALS_H_
+#define _TEST_CCAPI_GLOBALS_H_
+
+#include <Kerberos/CredentialsCache.h>
+
+/* GLOBALS */
+extern unsigned int total_failure_count;
+extern unsigned int failure_count;
+
+extern const char *current_test_name;
+extern const char *current_test_activity;
+
+extern const char * ccapi_error_strings[30];
+
+const char *translate_ccapi_error(cc_int32 err);
+
+#define T_CCAPI_INIT \
+ do { \
+ current_test_name = NULL; \
+ current_test_activity = NULL; \
+ } while( 0 )
+
+#define BEGIN_TEST(name) \
+ do { \
+ current_test_name = name; \
+ failure_count = 0; \
+ test_header(current_test_name); \
+ } while( 0 )
+
+#define BEGIN_CHECK_ONCE(x) \
+ do { \
+ if (x) { \
+ current_test_activity = x; \
+ } \
+ } while( 0 )
+
+#define END_CHECK_ONCE \
+ do { \
+ current_test_activity = NULL; \
+ } while( 0 )
+
+#define END_TEST_AND_RETURN \
+ test_footer(current_test_name, failure_count); \
+ total_failure_count += failure_count; \
+ return failure_count;
+
+#endif /* _TEST_CCAPI_GLOBALS_H_ */