aboutsummaryrefslogtreecommitdiff
path: root/tests/portable/asprintf-t.c
diff options
context:
space:
mode:
authorRuss Allbery <rra@stanford.edu>2008-04-24 02:02:49 +0000
committerRuss Allbery <rra@stanford.edu>2008-04-24 02:02:49 +0000
commit92ff7f21ad0b167f8d742a9d7b5f93704a57619c (patch)
tree7adae5f227b6463e07d5cd0f1dab82b7f1c6be47 /tests/portable/asprintf-t.c
parent34c58f9471b3df4fa8b719b3c3534940ba5cfe1b (diff)
Major coding style cleanup. Updated all shared code from my other
projects. The configure option requesting AFS kaserver support (and thus building kasetkey) is now --with-kaserver instead of --with-afs. If KRB5_CONFIG was explicitly set in the environment, don't use a different krb5-config based on --with-krb4 or --with-krb5. If krb5-config isn't executable, don't use it. This allows one to force library probing by setting KRB5_CONFIG to point to a nonexistent file. Sanity-check the results of krb5-config before proceeding and error out in configure if they don't work. Stop setting Stanford-specific compile-time defaults for the wallet server and port.
Diffstat (limited to 'tests/portable/asprintf-t.c')
-rw-r--r--tests/portable/asprintf-t.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/tests/portable/asprintf-t.c b/tests/portable/asprintf-t.c
index a79c7f4..d42e740 100644
--- a/tests/portable/asprintf-t.c
+++ b/tests/portable/asprintf-t.c
@@ -1,15 +1,21 @@
-/* $Id$ */
-/* asprintf and vasprintf test suite. */
-
-/* Written by Russ Allbery <rra@stanford.edu>
- Copyright 2006 Board of Trustees, Leland Stanford Jr. University
- See LICENSE for licensing terms. */
+/* $Id$
+ *
+ * asprintf and vasprintf test suite.
+ *
+ * Written by Russ Allbery <rra@stanford.edu>
+ * Copyright 2006, 2008 Board of Trustees, Leland Stanford Jr. University
+ *
+ * See LICENSE for licensing terms.
+ */
#include <config.h>
-#include <system.h>
+#include <portable/system.h>
#include <tests/libtest.h>
+int test_asprintf(char **, const char *, ...);
+int test_vasprintf(char **, const char *, va_list);
+
static int
vatest(char **result, const char *format, ...)
{
@@ -17,7 +23,7 @@ vatest(char **result, const char *format, ...)
int status;
va_start(args, format);
- status = vasprintf(result, format, args);
+ status = test_vasprintf(result, format, args);
va_end(args);
return status;
}
@@ -29,11 +35,11 @@ main(void)
test_init(12);
- ok_int(1, 7, asprintf(&result, "%s", "testing"));
+ ok_int(1, 7, test_asprintf(&result, "%s", "testing"));
ok_string(2, "testing", result);
free(result);
ok(3, 1);
- ok_int(4, 0, asprintf(&result, "%s", ""));
+ ok_int(4, 0, test_asprintf(&result, "%s", ""));
ok_string(5, "", result);
free(result);
ok(6, 1);