diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-06-29 22:12:58 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-06-29 22:12:58 +0000 |
commit | f501080b97356351732aee8302de888e89a1b502 (patch) | |
tree | b33cd3fbcd059c2692d2e304dc20e32b5ba93cc4 /src/util/test_strings.c | |
parent | 54dca55c614ddacaacdef0e025e6c9429901b7a0 (diff) | |
download | gnunet-f501080b97356351732aee8302de888e89a1b502.tar.gz gnunet-f501080b97356351732aee8302de888e89a1b502.zip |
-better time conversion code
Diffstat (limited to 'src/util/test_strings.c')
-rw-r--r-- | src/util/test_strings.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/util/test_strings.c b/src/util/test_strings.c index 45dd904f4..749650589 100644 --- a/src/util/test_strings.c +++ b/src/util/test_strings.c | |||
@@ -36,6 +36,7 @@ main (int argc, char *argv[]) | |||
36 | char *r; | 36 | char *r; |
37 | char *b; | 37 | char *b; |
38 | struct GNUNET_TIME_Absolute at; | 38 | struct GNUNET_TIME_Absolute at; |
39 | struct GNUNET_TIME_Absolute atx; | ||
39 | const char *hdir; | 40 | const char *hdir; |
40 | 41 | ||
41 | GNUNET_log_setup ("test_strings", "ERROR", NULL); | 42 | GNUNET_log_setup ("test_strings", "ERROR", NULL); |
@@ -97,6 +98,14 @@ main (int argc, char *argv[]) | |||
97 | GNUNET_free (r); | 98 | GNUNET_free (r); |
98 | b = GNUNET_STRINGS_to_utf8 ("TEST", 4, "ASCII"); | 99 | b = GNUNET_STRINGS_to_utf8 ("TEST", 4, "ASCII"); |
99 | WANT ("TEST", b); | 100 | WANT ("TEST", b); |
101 | |||
102 | at = GNUNET_TIME_UNIT_FOREVER_ABS; | ||
103 | b = GNUNET_STRINGS_absolute_time_to_string (at); | ||
104 | GNUNET_assert (GNUNET_OK == | ||
105 | GNUNET_STRINGS_fancy_time_to_absolute (b, &atx)); | ||
106 | GNUNET_assert (atx.abs_value == at.abs_value); | ||
107 | GNUNET_free (b); | ||
108 | |||
100 | #if ENABLE_NLS && HAVE_ICONV | 109 | #if ENABLE_NLS && HAVE_ICONV |
101 | GNUNET_log_skip (2, GNUNET_NO); | 110 | GNUNET_log_skip (2, GNUNET_NO); |
102 | b = GNUNET_STRINGS_to_utf8 ("TEST", 4, "unknown"); | 111 | b = GNUNET_STRINGS_to_utf8 ("TEST", 4, "unknown"); |