summaryrefslogtreecommitdiff
path: root/tests/util/messages-krb5-t.c
diff options
context:
space:
mode:
authorRuss Allbery <eagle@eyrie.org>2014-07-16 13:43:17 -0700
committerRuss Allbery <eagle@eyrie.org>2014-07-16 13:43:17 -0700
commit6409733ee3b7b1910dc1c166a392cc628834146c (patch)
treee9460f8f2ca0f3676afeed2a9dcf549acfc39b53 /tests/util/messages-krb5-t.c
parent334ed844cbb5c8f7ea82a94c701a3016dd6950b9 (diff)
parentf8963ceb19cd2b503b981f43a3f8c0f45649989f (diff)
Imported Upstream version 1.1
Diffstat (limited to 'tests/util/messages-krb5-t.c')
-rw-r--r--tests/util/messages-krb5-t.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/tests/util/messages-krb5-t.c b/tests/util/messages-krb5-t.c
index e3ffe75..c6de5a5 100644
--- a/tests/util/messages-krb5-t.c
+++ b/tests/util/messages-krb5-t.c
@@ -4,8 +4,8 @@
* The canonical version of this file is maintained in the rra-c-util package,
* which can be found at <http://www.eyrie.org/~eagle/software/rra-c-util/>.
*
- * Written by Russ Allbery <rra@stanford.edu>
- * Copyright 2010, 2011
+ * Written by Russ Allbery <eagle@eyrie.org>
+ * Copyright 2010, 2011, 2013, 2014
* The Board of Trustees of the Leland Stanford Junior University
*
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -28,17 +28,31 @@
*/
#include <config.h>
-#include <portable/krb5.h>
+#ifdef HAVE_KRB5
+# include <portable/krb5.h>
+#endif
#include <portable/system.h>
#include <tests/tap/basic.h>
#include <tests/tap/process.h>
#include <util/macros.h>
-#include <util/messages-krb5.h>
+#ifdef HAVE_KRB5
+# include <util/messages-krb5.h>
+#endif
#include <util/messages.h>
#include <util/xmalloc.h>
+/* Skip the whole test if not built with Kerberos support. */
+#ifndef HAVE_KRB5
+int
+main(void)
+{
+ skip_all("not built with Kerberos support");
+ return 0;
+}
+#else
+
/*
* Test functions.
*/
@@ -116,5 +130,9 @@ main(void)
message_handlers_die(0);
is_function_output(test_die, NULL, 1, "", "warn_krb5 with no handlers");
+ krb5_free_error_message(ctx, message);
+ krb5_free_context(ctx);
return 0;
}
+
+#endif /* HAVE_KRB5 */