diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-06-19 22:17:25 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-06-19 22:17:25 +0000 |
commit | 808ef8ab410b486c5cca7515389f608e965d53b1 (patch) | |
tree | 2a9476225227e3e550d95294db1c1b676bd23264 /src/namestore/test_namestore_api_remove_not_existing_record.c | |
parent | 50114769c42140782b3955e416d61837fe570d0b (diff) | |
download | gnunet-808ef8ab410b486c5cca7515389f608e965d53b1.tar.gz gnunet-808ef8ab410b486c5cca7515389f608e965d53b1.zip |
-fixing testcases with new expiration code
Diffstat (limited to 'src/namestore/test_namestore_api_remove_not_existing_record.c')
-rw-r--r-- | src/namestore/test_namestore_api_remove_not_existing_record.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/namestore/test_namestore_api_remove_not_existing_record.c b/src/namestore/test_namestore_api_remove_not_existing_record.c index 5dfe8e220..ab9095d91 100644 --- a/src/namestore/test_namestore_api_remove_not_existing_record.c +++ b/src/namestore/test_namestore_api_remove_not_existing_record.c | |||
@@ -137,7 +137,8 @@ put_cont (void *cls, int32_t success, const char *emsg) | |||
137 | 137 | ||
138 | struct GNUNET_NAMESTORE_RecordData rd; | 138 | struct GNUNET_NAMESTORE_RecordData rd; |
139 | char data[TEST_REMOVE_RECORD_DATALEN]; | 139 | char data[TEST_REMOVE_RECORD_DATALEN]; |
140 | rd.expiration = GNUNET_TIME_absolute_get(); | 140 | |
141 | rd.expiration_time = GNUNET_TIME_absolute_get().abs_value; | ||
141 | rd.record_type = TEST_REMOVE_RECORD_TYPE; | 142 | rd.record_type = TEST_REMOVE_RECORD_TYPE; |
142 | rd.data_size = TEST_REMOVE_RECORD_DATALEN; | 143 | rd.data_size = TEST_REMOVE_RECORD_DATALEN; |
143 | rd.data = &data; | 144 | rd.data = &data; |
@@ -154,15 +155,15 @@ put_cont (void *cls, int32_t success, const char *emsg) | |||
154 | 155 | ||
155 | 156 | ||
156 | static struct GNUNET_NAMESTORE_RecordData * | 157 | static struct GNUNET_NAMESTORE_RecordData * |
157 | create_record (int count) | 158 | create_record (unsigned int count) |
158 | { | 159 | { |
159 | int c; | 160 | unsigned int c; |
160 | struct GNUNET_NAMESTORE_RecordData * rd; | 161 | struct GNUNET_NAMESTORE_RecordData * rd; |
161 | 162 | ||
162 | rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData)); | 163 | rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData)); |
163 | for (c = 0; c < RECORDS; c++) | 164 | for (c = 0; c < count; c++) |
164 | { | 165 | { |
165 | rd[c].expiration = GNUNET_TIME_absolute_get(); | 166 | rd[c].expiration_time = GNUNET_TIME_absolute_get().abs_value; |
166 | rd[c].record_type = TEST_RECORD_TYPE; | 167 | rd[c].record_type = TEST_RECORD_TYPE; |
167 | rd[c].data_size = TEST_RECORD_DATALEN; | 168 | rd[c].data_size = TEST_RECORD_DATALEN; |
168 | rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN); | 169 | rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN); |
@@ -178,6 +179,7 @@ run (void *cls, | |||
178 | { | 179 | { |
179 | char *hostkey_file; | 180 | char *hostkey_file; |
180 | size_t rd_ser_len; | 181 | size_t rd_ser_len; |
182 | struct GNUNET_TIME_Absolute et; | ||
181 | 183 | ||
182 | endbadly_task = GNUNET_SCHEDULER_add_delayed(TIMEOUT,endbadly, NULL); | 184 | endbadly_task = GNUNET_SCHEDULER_add_delayed(TIMEOUT,endbadly, NULL); |
183 | 185 | ||
@@ -200,7 +202,8 @@ run (void *cls, | |||
200 | GNUNET_NAMESTORE_records_serialize(RECORDS, s_rd, rd_ser_len, rd_ser); | 202 | GNUNET_NAMESTORE_records_serialize(RECORDS, s_rd, rd_ser_len, rd_ser); |
201 | 203 | ||
202 | /* sign */ | 204 | /* sign */ |
203 | s_signature = GNUNET_NAMESTORE_create_signature(privkey, s_rd[0].expiration, s_name, s_rd, RECORDS); | 205 | et.abs_value = s_rd[0].expiration_time; |
206 | s_signature = GNUNET_NAMESTORE_create_signature(privkey, et, s_name, s_rd, RECORDS); | ||
204 | 207 | ||
205 | /* create random zone hash */ | 208 | /* create random zone hash */ |
206 | GNUNET_CRYPTO_hash (&pubkey, sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), &s_zone); | 209 | GNUNET_CRYPTO_hash (&pubkey, sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), &s_zone); |