gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r16249 - in gnunet/src: include testing util


From: gnunet
Subject: [GNUnet-SVN] r16249 - in gnunet/src: include testing util
Date: Wed, 27 Jul 2011 17:49:02 +0200

Author: nevans
Date: 2011-07-27 17:49:02 +0200 (Wed, 27 Jul 2011)
New Revision: 16249

Modified:
   gnunet/src/include/gnunet_time_lib.h
   gnunet/src/testing/testing.c
   gnunet/src/util/time.c
Log:
use arm timeouts, bad GNUNET_TIME function that will probably get removed

Modified: gnunet/src/include/gnunet_time_lib.h
===================================================================
--- gnunet/src/include/gnunet_time_lib.h        2011-07-27 14:57:28 UTC (rev 
16248)
+++ gnunet/src/include/gnunet_time_lib.h        2011-07-27 15:49:02 UTC (rev 
16249)
@@ -422,6 +422,17 @@
                                                        a);
 
 /**
+ * Convert a relative time to a string.
+ * NOT reentrant!
+ *
+ * @param time the time to print
+ *
+ * @return string form of the time (as milliseconds)
+ */
+const char *
+GNUNET_TIME_relative_to_string (struct GNUNET_TIME_Relative time);
+
+/**
  * Set the timestamp offset for this instance.
  *
  * @param offset the offset to skew the locale time by

Modified: gnunet/src/testing/testing.c
===================================================================
--- gnunet/src/testing/testing.c        2011-07-27 14:57:28 UTC (rev 16248)
+++ gnunet/src/testing/testing.c        2011-07-27 15:49:02 UTC (rev 16249)
@@ -576,7 +576,7 @@
 #if DEBUG_TESTING
                                              "-L", "DEBUG",
 #endif
-                                             "-s", "-q", NULL);
+                                             "-s", "-q", "-T", 
GNUNET_TIME_relative_to_string(GNUNET_TIME_absolute_get_remaining(d->max_timeout)),
 NULL);
         }
       else
         {
@@ -602,6 +602,7 @@
                                                  "-L", "DEBUG",
 #endif
                                                  "-c", d->cfgfile, "-s", "-q",
+                                                 "-T", 
GNUNET_TIME_relative_to_string(GNUNET_TIME_absolute_get_remaining(d->max_timeout)),
                                                  NULL);
             }
           else
@@ -617,6 +618,7 @@
                                                  "-L", "DEBUG",
 #endif
                                                  "-c", d->cfgfile, "-s", "-q",
+                                                 "-T", 
GNUNET_TIME_relative_to_string(GNUNET_TIME_absolute_get_remaining(d->max_timeout)),
                                                  NULL);
             }
           GNUNET_free (dst);
@@ -1101,6 +1103,7 @@
                                          "-L", "DEBUG",
 #endif
                                          "-c", d->cfgfile, "-i", service, "-q",
+                                         "-T", 
GNUNET_TIME_relative_to_string(timeout),
                                          NULL);
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                   "Starting gnunet-arm with command ssh %s gnunet-arm -c %s -i 
%s -q\n",
@@ -1120,6 +1123,7 @@
                                          "-L", "DEBUG",
 #endif
                                          "-c", d->cfgfile, "-i", service, "-q",
+                                         "-T", 
GNUNET_TIME_relative_to_string(timeout),
                                          NULL);
     }
 
@@ -1180,6 +1184,7 @@
                                          "-L", "DEBUG",
 #endif
                                          "-c", d->cfgfile, "-i", service, "-q",
+                                         "-T", 
GNUNET_TIME_relative_to_string(timeout),
                                          NULL);
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                   "Starting gnunet-arm with command ssh %s gnunet-arm -c %s -i 
%s -q\n",
@@ -1199,6 +1204,7 @@
                                          "-L", "DEBUG",
 #endif
                                          "-c", d->cfgfile, "-i", service, "-q",
+                                         "-T", 
GNUNET_TIME_relative_to_string(timeout),
                                          NULL);
     }
 
@@ -1644,6 +1650,7 @@
                                          "-L", "DEBUG",
 #endif
                                          "-c", d->cfgfile, "-k", service, "-q",
+                                         "-T", 
GNUNET_TIME_relative_to_string(timeout),
                                          NULL);
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                   "Stopping gnunet-arm with command ssh %s gnunet-arm -c %s -k 
%s -q\n",
@@ -1663,6 +1670,7 @@
                                          "-L", "DEBUG",
 #endif
                                          "-c", d->cfgfile, "-k", service, "-q",
+                                         "-T", 
GNUNET_TIME_relative_to_string(timeout),
                                          NULL);
     }
 
@@ -1781,6 +1789,7 @@
                                          "-L", "DEBUG",
 #endif
                                          "-c", d->cfgfile, "-e", "-q",
+                                         "-T", 
GNUNET_TIME_relative_to_string(timeout),
                                          del_arg, NULL);
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                   "Stopping gnunet-arm with command ssh %s gnunet-arm -c %s -e 
-q %s\n",
@@ -1801,6 +1810,7 @@
                                          "-L", "DEBUG",
 #endif
                                          "-c", d->cfgfile, "-e", "-q",
+                                         "-T", 
GNUNET_TIME_relative_to_string(timeout),
                                          del_arg, NULL);
     }
 

Modified: gnunet/src/util/time.c
===================================================================
--- gnunet/src/util/time.c      2011-07-27 14:57:28 UTC (rev 16248)
+++ gnunet/src/util/time.c      2011-07-27 15:49:02 UTC (rev 16249)
@@ -486,6 +486,25 @@
 
 }
 
+/**
+ * Convert a relative time to a string.
+ * This is one of the very few calls in the entire API that is
+ * NOT reentrant!
+ *
+ * @param time the time to print
+ *
+ * @return string form of the time (as milliseconds)
+ */
+const char *
+GNUNET_TIME_relative_to_string (struct GNUNET_TIME_Relative time)
+{
+  static char time_string[21];
+  memset(time_string, 0, sizeof(time_string));
 
+  sprintf(time_string, "%lu", time.rel_value);
+  return (const char *) time_string;
+}
 
+
+
 /* end of time.c */




reply via email to

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