diff options
author | Christian Grothoff <christian@grothoff.org> | 2019-10-05 15:09:28 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2019-10-05 15:09:28 +0200 |
commit | c4e9ba925ffd758aaa3feee2ccfc0b76f26fe207 (patch) | |
tree | cac3ce030d77b4cbe7c7dc62ed58cfe6d24f73e1 /src/gnsrecord/test_gnsrecord_block_expiration.c | |
parent | fbb71d527c7d6babf269a8fefce1db291b9f7068 (diff) | |
download | gnunet-c4e9ba925ffd758aaa3feee2ccfc0b76f26fe207.tar.gz gnunet-c4e9ba925ffd758aaa3feee2ccfc0b76f26fe207.zip |
global reindent, now with uncrustify hook enabled
Diffstat (limited to 'src/gnsrecord/test_gnsrecord_block_expiration.c')
-rw-r--r-- | src/gnsrecord/test_gnsrecord_block_expiration.c | 39 |
1 files changed, 22 insertions, 17 deletions
diff --git a/src/gnsrecord/test_gnsrecord_block_expiration.c b/src/gnsrecord/test_gnsrecord_block_expiration.c index 24aa3d921..9672c2ffb 100644 --- a/src/gnsrecord/test_gnsrecord_block_expiration.c +++ b/src/gnsrecord/test_gnsrecord_block_expiration.c | |||
@@ -44,49 +44,53 @@ static int res; | |||
44 | 44 | ||
45 | 45 | ||
46 | static void | 46 | static void |
47 | run(void *cls, char *const *args, const char *cfgfile, | 47 | run (void *cls, char *const *args, const char *cfgfile, |
48 | const struct GNUNET_CONFIGURATION_Handle *cfg) | 48 | const struct GNUNET_CONFIGURATION_Handle *cfg) |
49 | { | 49 | { |
50 | struct GNUNET_GNSRECORD_Data rd[2]; | 50 | struct GNUNET_GNSRECORD_Data rd[2]; |
51 | struct GNUNET_TIME_Absolute expiration_abs; | 51 | struct GNUNET_TIME_Absolute expiration_abs; |
52 | struct GNUNET_TIME_Absolute expiration_abs_shadow; | 52 | struct GNUNET_TIME_Absolute expiration_abs_shadow; |
53 | 53 | ||
54 | expiration_abs.abs_value_us = GNUNET_TIME_absolute_get().abs_value_us + | 54 | expiration_abs.abs_value_us = GNUNET_TIME_absolute_get ().abs_value_us |
55 | GNUNET_TIME_UNIT_SECONDS.rel_value_us; | 55 | + GNUNET_TIME_UNIT_SECONDS.rel_value_us; |
56 | expiration_abs_shadow.abs_value_us = GNUNET_TIME_absolute_get().abs_value_us + | 56 | expiration_abs_shadow.abs_value_us = GNUNET_TIME_absolute_get ().abs_value_us |
57 | GNUNET_TIME_UNIT_MINUTES.rel_value_us; | 57 | + GNUNET_TIME_UNIT_MINUTES.rel_value_us; |
58 | 58 | ||
59 | /* create record */ | 59 | /* create record */ |
60 | rd[0].expiration_time = expiration_abs.abs_value_us; | 60 | rd[0].expiration_time = expiration_abs.abs_value_us; |
61 | rd[0].record_type = TEST_RECORD_TYPE; | 61 | rd[0].record_type = TEST_RECORD_TYPE; |
62 | rd[0].data_size = TEST_RECORD_DATALEN; | 62 | rd[0].data_size = TEST_RECORD_DATALEN; |
63 | rd[0].data = GNUNET_malloc(TEST_RECORD_DATALEN); | 63 | rd[0].data = GNUNET_malloc (TEST_RECORD_DATALEN); |
64 | rd[0].flags = GNUNET_GNSRECORD_RF_NONE; | 64 | rd[0].flags = GNUNET_GNSRECORD_RF_NONE; |
65 | memset((char *)rd[0].data, TEST_RECORD_DATA, TEST_RECORD_DATALEN); | 65 | memset ((char *) rd[0].data, TEST_RECORD_DATA, TEST_RECORD_DATALEN); |
66 | 66 | ||
67 | rd[1].expiration_time = expiration_abs.abs_value_us; | 67 | rd[1].expiration_time = expiration_abs.abs_value_us; |
68 | rd[1].record_type = TEST_RECORD_TYPE; | 68 | rd[1].record_type = TEST_RECORD_TYPE; |
69 | rd[1].data_size = TEST_RECORD_DATALEN; | 69 | rd[1].data_size = TEST_RECORD_DATALEN; |
70 | rd[1].data = GNUNET_malloc(TEST_RECORD_DATALEN); | 70 | rd[1].data = GNUNET_malloc (TEST_RECORD_DATALEN); |
71 | rd[1].flags = GNUNET_GNSRECORD_RF_NONE; | 71 | rd[1].flags = GNUNET_GNSRECORD_RF_NONE; |
72 | memset((char *)rd[1].data, TEST_RECORD_DATA, TEST_RECORD_DATALEN); | 72 | memset ((char *) rd[1].data, TEST_RECORD_DATA, TEST_RECORD_DATALEN); |
73 | 73 | ||
74 | GNUNET_assert(expiration_abs.abs_value_us == GNUNET_GNSRECORD_record_get_expiration_time(2, rd).abs_value_us); | 74 | GNUNET_assert (expiration_abs.abs_value_us == |
75 | GNUNET_GNSRECORD_record_get_expiration_time (2, | ||
76 | rd).abs_value_us); | ||
75 | 77 | ||
76 | rd[1].expiration_time = expiration_abs_shadow.abs_value_us; | 78 | rd[1].expiration_time = expiration_abs_shadow.abs_value_us; |
77 | rd[1].record_type = TEST_RECORD_TYPE; | 79 | rd[1].record_type = TEST_RECORD_TYPE; |
78 | rd[1].data_size = TEST_RECORD_DATALEN; | 80 | rd[1].data_size = TEST_RECORD_DATALEN; |
79 | rd[1].data = GNUNET_malloc(TEST_RECORD_DATALEN); | 81 | rd[1].data = GNUNET_malloc (TEST_RECORD_DATALEN); |
80 | rd[1].flags = GNUNET_GNSRECORD_RF_SHADOW_RECORD; | 82 | rd[1].flags = GNUNET_GNSRECORD_RF_SHADOW_RECORD; |
81 | memset((char *)rd[1].data, TEST_RECORD_DATA, TEST_RECORD_DATALEN); | 83 | memset ((char *) rd[1].data, TEST_RECORD_DATA, TEST_RECORD_DATALEN); |
82 | 84 | ||
83 | GNUNET_assert(expiration_abs_shadow.abs_value_us == GNUNET_GNSRECORD_record_get_expiration_time(2, rd).abs_value_us); | 85 | GNUNET_assert (expiration_abs_shadow.abs_value_us == |
86 | GNUNET_GNSRECORD_record_get_expiration_time (2, | ||
87 | rd).abs_value_us); | ||
84 | res = 0; | 88 | res = 0; |
85 | } | 89 | } |
86 | 90 | ||
87 | 91 | ||
88 | int | 92 | int |
89 | main(int argc, char *argv[]) | 93 | main (int argc, char *argv[]) |
90 | { | 94 | { |
91 | static char *const argvx[] = { "test-gnsrecord-crypto", | 95 | static char *const argvx[] = { "test-gnsrecord-crypto", |
92 | NULL }; | 96 | NULL }; |
@@ -95,8 +99,9 @@ main(int argc, char *argv[]) | |||
95 | }; | 99 | }; |
96 | 100 | ||
97 | res = 1; | 101 | res = 1; |
98 | GNUNET_PROGRAM_run((sizeof(argvx) / sizeof(char *)) - 1, argvx, "test-namestore-api", | 102 | GNUNET_PROGRAM_run ((sizeof(argvx) / sizeof(char *)) - 1, argvx, |
99 | "nohelp", options, &run, &res); | 103 | "test-namestore-api", |
104 | "nohelp", options, &run, &res); | ||
100 | return res; | 105 | return res; |
101 | } | 106 | } |
102 | 107 | ||