summaryrefslogtreecommitdiff
path: root/tests/simple.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/simple.c')
-rw-r--r--tests/simple.c118
1 files changed, 62 insertions, 56 deletions
diff --git a/tests/simple.c b/tests/simple.c
index 8a9481376a..f249bfae41 100644
--- a/tests/simple.c
+++ b/tests/simple.c
@@ -28,72 +28,78 @@
#include "utils.h"
-void
-doit (void)
+void doit(void)
{
- if (debug)
- {
- printf ("GnuTLS header version %s.\n", GNUTLS_VERSION);
- printf ("GnuTLS library version %s.\n", gnutls_check_version (NULL));
- }
+ if (debug) {
+ printf("GnuTLS header version %s.\n", GNUTLS_VERSION);
+ printf("GnuTLS library version %s.\n",
+ gnutls_check_version(NULL));
+ }
- if (!gnutls_check_version (GNUTLS_VERSION))
- fail ("gnutls_check_version ERROR\n");
+ if (!gnutls_check_version(GNUTLS_VERSION))
+ fail("gnutls_check_version ERROR\n");
- {
- const gnutls_pk_algorithm_t *algs;
- size_t i;
- int pk;
+ {
+ const gnutls_pk_algorithm_t *algs;
+ size_t i;
+ int pk;
- algs = gnutls_pk_list ();
- if (!algs)
- fail ("gnutls_pk_list return NULL\n");
+ algs = gnutls_pk_list();
+ if (!algs)
+ fail("gnutls_pk_list return NULL\n");
- for (i = 0; algs[i]; i++)
- {
- if (debug)
- printf ("pk_list[%d] = %d = %s = %d\n", (int) i, algs[i],
- gnutls_pk_algorithm_get_name (algs[i]),
- gnutls_pk_get_id (gnutls_pk_algorithm_get_name (algs[i])));
- if (gnutls_pk_get_id (gnutls_pk_algorithm_get_name (algs[i]))
- != algs[i])
- fail ("gnutls_pk id's doesn't match\n");
- }
+ for (i = 0; algs[i]; i++) {
+ if (debug)
+ printf("pk_list[%d] = %d = %s = %d\n",
+ (int) i, algs[i],
+ gnutls_pk_algorithm_get_name(algs
+ [i]),
+ gnutls_pk_get_id
+ (gnutls_pk_algorithm_get_name
+ (algs[i])));
+ if (gnutls_pk_get_id
+ (gnutls_pk_algorithm_get_name(algs[i]))
+ != algs[i])
+ fail("gnutls_pk id's doesn't match\n");
+ }
- pk = gnutls_pk_get_id ("foo");
- if (pk != GNUTLS_PK_UNKNOWN)
- fail ("gnutls_pk unknown test failed (%d)\n", pk);
+ pk = gnutls_pk_get_id("foo");
+ if (pk != GNUTLS_PK_UNKNOWN)
+ fail("gnutls_pk unknown test failed (%d)\n", pk);
- if (debug)
- success ("gnutls_pk_list ok\n");
- }
+ if (debug)
+ success("gnutls_pk_list ok\n");
+ }
- {
- const gnutls_sign_algorithm_t *algs;
- size_t i;
- int pk;
+ {
+ const gnutls_sign_algorithm_t *algs;
+ size_t i;
+ int pk;
- algs = gnutls_sign_list ();
- if (!algs)
- fail ("gnutls_sign_list return NULL\n");
+ algs = gnutls_sign_list();
+ if (!algs)
+ fail("gnutls_sign_list return NULL\n");
- for (i = 0; algs[i]; i++)
- {
- if (debug)
- printf ("sign_list[%d] = %d = %s = %d\n", (int) i, algs[i],
- gnutls_sign_algorithm_get_name (algs[i]),
- gnutls_sign_get_id (gnutls_sign_algorithm_get_name
- (algs[i])));
- if (gnutls_sign_get_id (gnutls_sign_algorithm_get_name (algs[i])) !=
- algs[i])
- fail ("gnutls_sign id's doesn't match\n");
- }
+ for (i = 0; algs[i]; i++) {
+ if (debug)
+ printf("sign_list[%d] = %d = %s = %d\n",
+ (int) i, algs[i],
+ gnutls_sign_algorithm_get_name(algs
+ [i]),
+ gnutls_sign_get_id
+ (gnutls_sign_algorithm_get_name
+ (algs[i])));
+ if (gnutls_sign_get_id
+ (gnutls_sign_algorithm_get_name(algs[i])) !=
+ algs[i])
+ fail("gnutls_sign id's doesn't match\n");
+ }
- pk = gnutls_sign_get_id ("foo");
- if (pk != GNUTLS_PK_UNKNOWN)
- fail ("gnutls_sign unknown test failed (%d)\n", pk);
+ pk = gnutls_sign_get_id("foo");
+ if (pk != GNUTLS_PK_UNKNOWN)
+ fail("gnutls_sign unknown test failed (%d)\n", pk);
- if (debug)
- success ("gnutls_sign_list ok\n");
- }
+ if (debug)
+ success("gnutls_sign_list ok\n");
+ }
}