diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2012-10-09 19:49:13 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2012-10-09 19:49:13 +0200 |
commit | 546930508edce93729d41c87901b20b2eb3631fc (patch) | |
tree | 9004f690667d2e8ae2ae30a0d63cbdb9b27bdd2d /tests/Test_tree.c | |
parent | d154578295f0fda35cf0a1ec78648f7ec581bbed (diff) | |
download | libtasn1-546930508edce93729d41c87901b20b2eb3631fc.tar.gz libtasn1-546930508edce93729d41c87901b20b2eb3631fc.tar.bz2 libtasn1-546930508edce93729d41c87901b20b2eb3631fc.zip |
Silence tests.
Diffstat (limited to 'tests/Test_tree.c')
-rw-r--r-- | tests/Test_tree.c | 44 |
1 files changed, 29 insertions, 15 deletions
diff --git a/tests/Test_tree.c b/tests/Test_tree.c index 32c57e1..70b6df4 100644 --- a/tests/Test_tree.c +++ b/tests/Test_tree.c @@ -442,17 +442,23 @@ main (int argc, char *argv[]) unsigned char value[1024], der[1024]; int valueLen, tag = 0, class = 0; int k; - int start, end; + int start, end, verbose = 0; const char *str_p = NULL; const char *treefile = getenv ("ASN1TREE"); + + if (argc > 1) + verbose = 1; if (!treefile) treefile = "Test_tree.asn"; - printf ("\n\n/****************************************/\n"); - printf ("/* Test sequence : Test_tree */\n"); - printf ("/****************************************/\n\n"); - printf ("ASN1TREE: %s\n", treefile); + if (verbose != 0) + { + printf ("\n\n/****************************************/\n"); + printf ("/* Test sequence : Test_tree */\n"); + printf ("/****************************************/\n\n"); + printf ("ASN1TREE: %s\n", treefile); + } /* Check version */ if (asn1_check_version ("0.2.11") == NULL) @@ -571,16 +577,22 @@ main (int argc, char *argv[]) str_p = asn1_find_structure_from_oid (definitions, test->par1); break; case ACT_VISIT: - asn1_print_structure (out, asn1_element, test->par1, test->par3); - fprintf (out, "\n"); + if (verbose) + { + asn1_print_structure (out, asn1_element, test->par1, test->par3); + fprintf (out, "\n"); + } result = ASN1_SUCCESS; break; case ACT_PRINT_DER: - printf ("DER encoding len:%i\n", der_len); - printf ("DER encoding: "); - for (k = 0; k < der_len; k++) - printf ("%02x ", der[k]); - printf ("\n\n"); + if (verbose) + { + printf ("DER encoding len:%i\n", der_len); + printf ("DER encoding: "); + for (k = 0; k < der_len; k++) + printf ("%02x ", der[k]); + printf ("\n\n"); + } result = ASN1_SUCCESS; break; case ACT_SET_DER: @@ -757,9 +769,11 @@ main (int argc, char *argv[]) } - printf ("Total tests : %d\n", testCounter); - printf ("Total errors: %d\n", errorCounter); - + if (verbose != 0) + { + printf ("Total tests : %d\n", testCounter); + printf ("Total errors: %d\n", errorCounter); + } /* Clear the definition structures */ asn1_delete_structure (&definitions); |