diff options
author | LRN <lrn1986@gmail.com> | 2013-03-04 08:28:19 +0000 |
---|---|---|
committer | LRN <lrn1986@gmail.com> | 2013-03-04 08:28:19 +0000 |
commit | 4775c35078e2a2223509089ccd5aec80e0008080 (patch) | |
tree | 5b0094eafdb9a7d439757f27baa1eef3dfccb840 /src/util/test_strings.c | |
parent | 05f231d254655e988f0c111ab3b86df1266df7d8 (diff) | |
download | gnunet-4775c35078e2a2223509089ccd5aec80e0008080.tar.gz gnunet-4775c35078e2a2223509089ccd5aec80e0008080.zip |
Accept time strings where number and unit are not separated by a space
Fixes #2806
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 bc4169421..e5247ad91 100644 --- a/src/util/test_strings.c +++ b/src/util/test_strings.c | |||
@@ -39,6 +39,8 @@ main (int argc, char *argv[]) | |||
39 | const char *bc; | 39 | const char *bc; |
40 | struct GNUNET_TIME_Absolute at; | 40 | struct GNUNET_TIME_Absolute at; |
41 | struct GNUNET_TIME_Absolute atx; | 41 | struct GNUNET_TIME_Absolute atx; |
42 | struct GNUNET_TIME_Relative rt; | ||
43 | struct GNUNET_TIME_Relative rtx; | ||
42 | const char *hdir; | 44 | const char *hdir; |
43 | 45 | ||
44 | GNUNET_log_setup ("test_strings", "ERROR", NULL); | 46 | GNUNET_log_setup ("test_strings", "ERROR", NULL); |
@@ -109,6 +111,13 @@ main (int argc, char *argv[]) | |||
109 | b = GNUNET_STRINGS_to_utf8 ("TEST", 4, "unknown"); | 111 | b = GNUNET_STRINGS_to_utf8 ("TEST", 4, "unknown"); |
110 | GNUNET_log_skip (0, GNUNET_YES); | 112 | GNUNET_log_skip (0, GNUNET_YES); |
111 | WANT ("TEST", b); | 113 | WANT ("TEST", b); |
114 | |||
115 | GNUNET_assert (GNUNET_OK == | ||
116 | GNUNET_STRINGS_fancy_time_to_relative ("15m", &rt)); | ||
117 | GNUNET_assert (GNUNET_OK == | ||
118 | GNUNET_STRINGS_fancy_time_to_relative ("15 m", &rtx)); | ||
119 | GNUNET_assert (rt.rel_value == rtx.rel_value); | ||
120 | |||
112 | return 0; | 121 | return 0; |
113 | } | 122 | } |
114 | 123 | ||