gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r29966 - gnunet/src/util


From: gnunet
Subject: [GNUnet-SVN] r29966 - gnunet/src/util
Date: Tue, 8 Oct 2013 11:30:34 +0200

Author: LRN
Date: 2013-10-08 11:30:33 +0200 (Tue, 08 Oct 2013)
New Revision: 29966

Modified:
   gnunet/src/util/strings.c
   gnunet/src/util/test_strings.c
Log:
Update time conversion functions docs, test converting abs UTC time to string 
and back

Modified: gnunet/src/util/strings.c
===================================================================
--- gnunet/src/util/strings.c   2013-10-08 09:30:30 UTC (rev 29965)
+++ gnunet/src/util/strings.c   2013-10-08 09:30:33 UTC (rev 29966)
@@ -721,8 +721,8 @@
  * Note that the returned value will be overwritten if this function
  * is called again.
  *
- * @param t time to convert
- * @return absolute time in human-readable format
+ * @param t the absolute time to convert
+ * @return timestamp in human-readable form in local time
  */
 const char *
 GNUNET_STRINGS_absolute_time_to_string (struct GNUNET_TIME_Absolute t)

Modified: gnunet/src/util/test_strings.c
===================================================================
--- gnunet/src/util/test_strings.c      2013-10-08 09:30:30 UTC (rev 29965)
+++ gnunet/src/util/test_strings.c      2013-10-08 09:30:33 UTC (rev 29966)
@@ -106,6 +106,12 @@
                 GNUNET_STRINGS_fancy_time_to_absolute (bc, &atx));
   GNUNET_assert (atx.abs_value_us == at.abs_value_us);
 
+  at.abs_value_us = 50000000000;
+  bc = GNUNET_STRINGS_absolute_time_to_string (at);
+  GNUNET_assert (GNUNET_OK ==
+                GNUNET_STRINGS_fancy_time_to_absolute (bc, &atx));
+  GNUNET_assert (atx.abs_value_us == at.abs_value_us);
+
   GNUNET_log_skip (2, GNUNET_NO);
   b = GNUNET_STRINGS_to_utf8 ("TEST", 4, "unknown");
   GNUNET_log_skip (0, GNUNET_YES);




reply via email to

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