gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r9121 - gnunet/src/hello


From: gnunet
Subject: [GNUnet-SVN] r9121 - gnunet/src/hello
Date: Mon, 5 Oct 2009 04:34:14 -0600

Author: grothoff
Date: 2009-10-05 04:34:14 -0600 (Mon, 05 Oct 2009)
New Revision: 9121

Modified:
   gnunet/src/hello/test_hello.c
Log:
be less verbose

Modified: gnunet/src/hello/test_hello.c
===================================================================
--- gnunet/src/hello/test_hello.c       2009-10-05 10:31:29 UTC (rev 9120)
+++ gnunet/src/hello/test_hello.c       2009-10-05 10:34:14 UTC (rev 9121)
@@ -25,8 +25,11 @@
 #include "platform.h"
 #include "gnunet_hello_lib.h"
 
-#define DEBUG 0
+#define DEBUG GNUNET_NO
 
+#define VERBOSE GNUNET_NO
+
+
 static size_t
 my_addr_gen (void *cls, size_t max, void *buf)
 {
@@ -103,49 +106,65 @@
   GNUNET_log_setup ("test-hello", "DEBUG", NULL);
   startup_time = GNUNET_TIME_absolute_get ();
   memset (&publicKey, 42, sizeof (publicKey));
+#if VERBOSE
   fprintf (stderr, "Testing HELLO creation (without addresses)...\n");
+#endif
   i = 0;
   msg1 = GNUNET_HELLO_create (&publicKey, &my_addr_gen, &i);
   GNUNET_assert (msg1 != NULL);
   GNUNET_assert (0 < GNUNET_HELLO_size (msg1));
 
+#if VERBOSE
   fprintf (stderr, "Testing address iteration (empty set)...\n");
+#endif
   GNUNET_assert (NULL ==
                  GNUNET_HELLO_iterate_addresses (msg1,
                                                  GNUNET_NO, &check_addr, &i));
 
+#if VERBOSE
   fprintf (stderr, "Testing HELLO creation (with one address)...\n");
+#endif
   i = 1;
   msg2 = GNUNET_HELLO_create (&publicKey, &my_addr_gen, &i);
   GNUNET_assert (msg2 != NULL);
   GNUNET_assert (GNUNET_HELLO_size (msg1) < GNUNET_HELLO_size (msg2));
 
+#if VERBOSE
   fprintf (stderr, "Testing address iteration (one address)...\n");
+#endif
   i = 1;
   GNUNET_assert (NULL ==
                  GNUNET_HELLO_iterate_addresses (msg2,
                                                  GNUNET_NO, &check_addr, &i));
   GNUNET_assert (i == 0);
 
+#if VERBOSE
   fprintf (stderr, "Testing get_key from HELLO...\n");
+#endif
   GNUNET_assert (GNUNET_OK == GNUNET_HELLO_get_key (msg2, &pk));
   GNUNET_assert (0 == memcmp (&publicKey, &pk, sizeof (pk)));
   GNUNET_free (msg1);
 
+#if VERBOSE
   fprintf (stderr, "Testing HELLO creation (with two addresses)...\n");
+#endif
   i = 2;
   msg3 = GNUNET_HELLO_create (&publicKey, &my_addr_gen, &i);
   GNUNET_assert (msg3 != NULL);
   GNUNET_assert (GNUNET_HELLO_size (msg2) < GNUNET_HELLO_size (msg3));
 
+#if VERBOSE
   fprintf (stderr, "Testing address iteration (two addresses)...\n");
+#endif
   i = 3;
   GNUNET_assert (NULL ==
                  GNUNET_HELLO_iterate_addresses (msg3,
                                                  GNUNET_NO, &check_addr, &i));
   GNUNET_assert (i == 0);
 
+#if VERBOSE
   fprintf (stderr, "Testing HELLO merge...\n");
+#endif
   msg1 = GNUNET_HELLO_merge (msg2, msg3);
   GNUNET_assert (GNUNET_HELLO_size (msg1) == GNUNET_HELLO_size (msg3));
 
@@ -156,7 +175,9 @@
   GNUNET_assert (i == 0);
   GNUNET_free (msg1);
 
+#if VERBOSE
   fprintf (stderr, "Testing address iteration to copy HELLO...\n");
+#endif
   i = 2;
   msg1 = GNUNET_HELLO_iterate_addresses (msg3, GNUNET_YES, &remove_some, &i);
   GNUNET_assert (msg1 != NULL);
@@ -168,7 +189,9 @@
   GNUNET_assert (i == 0);
   GNUNET_free (msg1);
 
+#if VERBOSE
   fprintf (stderr, "Testing delta address iteration...\n");
+#endif
   i = 2;
   GNUNET_HELLO_iterate_new_addresses (msg3,
                                       msg2, startup_time, &check_addr, &i);





reply via email to

[Prev in Thread] Current Thread [Next in Thread]