aboutsummaryrefslogtreecommitdiff
path: root/src/util/test_time.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/test_time.c')
-rw-r--r--src/util/test_time.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/src/util/test_time.c b/src/util/test_time.c
index 2ac93e01d..80c4e5337 100644
--- a/src/util/test_time.c
+++ b/src/util/test_time.c
@@ -1,6 +1,6 @@
1/* 1/*
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2001-2013 GNUnet e.V. 3 Copyright (C) 2001-2013, 2018 GNUnet e.V.
4 4
5 GNUnet is free software: you can redistribute it and/or modify it 5 GNUnet is free software: you can redistribute it and/or modify it
6 under the terms of the GNU Affero General Public License as published 6 under the terms of the GNU Affero General Public License as published
@@ -223,7 +223,28 @@ main (int argc, char *argv[])
223 /*check GNUNET_TIME_absolute_max */ 223 /*check GNUNET_TIME_absolute_max */
224 GNUNET_assert (now.abs_value_us == 224 GNUNET_assert (now.abs_value_us ==
225 GNUNET_TIME_absolute_max (now, last).abs_value_us); 225 GNUNET_TIME_absolute_max (now, last).abs_value_us);
226 226 for (unsigned int i=0;i<30;i++)
227 {
228 struct GNUNET_CONFIGURATION_Handle *cfg;
229
230 cfg = GNUNET_CONFIGURATION_create ();
231 last = GNUNET_TIME_absolute_get_monotonic (cfg);
232 now = GNUNET_TIME_absolute_get_monotonic (cfg);
233 GNUNET_assert (now.abs_value_us > last.abs_value_us);
234 (void) GNUNET_TIME_absolute_get_monotonic (NULL);
235 GNUNET_CONFIGURATION_set_value_string (cfg,
236 "util",
237 "MONOTONIC_TIME_FILENAME",
238 "monotonic-time.dat");
239 last = GNUNET_TIME_absolute_get_monotonic (cfg);
240 now = GNUNET_TIME_absolute_get_monotonic (cfg);
241 (void) GNUNET_TIME_absolute_get_monotonic (NULL);
242 GNUNET_assert (now.abs_value_us > last.abs_value_us);
243 GNUNET_CONFIGURATION_destroy (cfg);
244 }
245 GNUNET_break (GNUNET_OK ==
246 GNUNET_DISK_directory_remove ("monotonic-time.dat"));
247
227 return 0; 248 return 0;
228} 249}
229 250