summaryrefslogtreecommitdiffstats
path: root/src/ccapi/test/test_ccapi_log.c
diff options
context:
space:
mode:
authorAlexandra Ellwood <lxs@mit.edu>2007-05-31 21:06:54 +0000
committerAlexandra Ellwood <lxs@mit.edu>2007-05-31 21:06:54 +0000
commitd45eeb7f708d5be2e9fbdbc54a04655776074f6c (patch)
tree5ab3d7e31f285ac4d6900d3abc647cbb53a05f8d /src/ccapi/test/test_ccapi_log.c
parent66bd29f512b9bdd5e808d645118862112973d2d6 (diff)
downloadkrb5-d45eeb7f708d5be2e9fbdbc54a04655776074f6c.tar.gz
krb5-d45eeb7f708d5be2e9fbdbc54a04655776074f6c.tar.xz
krb5-d45eeb7f708d5be2e9fbdbc54a04655776074f6c.zip
Move CCAPI sources to krb5 repository
ticket: new status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19564 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/ccapi/test/test_ccapi_log.c')
-rw-r--r--src/ccapi/test/test_ccapi_log.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/ccapi/test/test_ccapi_log.c b/src/ccapi/test/test_ccapi_log.c
new file mode 100644
index 000000000..95a467ad6
--- /dev/null
+++ b/src/ccapi/test/test_ccapi_log.c
@@ -0,0 +1,45 @@
+#ifndef _TEST_CCAPI_LOG_C_
+#define _TEST_CCAPI_LOG_C_
+
+#include "test_ccapi_log.h"
+
+void _log_error_v(const char *file, int line, const char *format, va_list ap)
+{
+ fprintf(stdout, "\n\t%s:%d: ", file, line);
+ if (!format) {
+ fprintf(stdout, "An unknown error occurred", file, line);
+ } else {
+ vfprintf(stdout, format, ap);
+ }
+ fflush(stdout);
+}
+
+void _log_error(const char *file, int line, const char *format, ...)
+{
+ va_list ap;
+ va_start(ap, format);
+ _log_error_v(file, line, format, ap);
+ va_end(ap);
+}
+
+void test_header(const char *msg) {
+ if (msg != NULL) {
+ fprintf(stdout, "\nChecking %s... ", msg);
+ fflush(stdout);
+ }
+}
+
+void test_footer(const char *msg, int err) {
+ if (msg != NULL) {
+ if (!err) {
+ fprintf(stdout, "OK\n");
+ }
+ else {
+ fprintf(stdout, "\n*** %d failure%s in %s ***\n", err, (err == 1) ? "" : "s", msg);
+ }
+ }
+}
+
+
+
+#endif /* _TEST_CCAPI_LOG_C_ */