aboutsummaryrefslogtreecommitdiff
path: root/src/namestore/test_namestore_api_lookup.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-06-19 22:17:25 +0000
committerChristian Grothoff <christian@grothoff.org>2012-06-19 22:17:25 +0000
commit808ef8ab410b486c5cca7515389f608e965d53b1 (patch)
tree2a9476225227e3e550d95294db1c1b676bd23264 /src/namestore/test_namestore_api_lookup.c
parent50114769c42140782b3955e416d61837fe570d0b (diff)
downloadgnunet-808ef8ab410b486c5cca7515389f608e965d53b1.tar.gz
gnunet-808ef8ab410b486c5cca7515389f608e965d53b1.zip
-fixing testcases with new expiration code
Diffstat (limited to 'src/namestore/test_namestore_api_lookup.c')
-rw-r--r--src/namestore/test_namestore_api_lookup.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/namestore/test_namestore_api_lookup.c b/src/namestore/test_namestore_api_lookup.c
index 1cf9ec864..d74b1dcf7 100644
--- a/src/namestore/test_namestore_api_lookup.c
+++ b/src/namestore/test_namestore_api_lookup.c
@@ -176,21 +176,20 @@ put_cont (void *cls, int32_t success, const char *emsg)
176 176
177 177
178static struct GNUNET_NAMESTORE_RecordData * 178static struct GNUNET_NAMESTORE_RecordData *
179create_record (int count) 179create_record (unsigned int count)
180{ 180{
181 int c; 181 unsigned int c;
182 struct GNUNET_NAMESTORE_RecordData * rd; 182 struct GNUNET_NAMESTORE_RecordData * rd;
183 rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData));
184 183
185 for (c = 0; c < RECORDS; c++) 184 rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData));
185 for (c = 0; c < count; c++)
186 { 186 {
187 rd[c].expiration = GNUNET_TIME_absolute_get(); 187 rd[c].expiration_time = GNUNET_TIME_absolute_get().abs_value;
188 rd[c].record_type = TEST_RECORD_TYPE; 188 rd[c].record_type = TEST_RECORD_TYPE;
189 rd[c].data_size = TEST_RECORD_DATALEN; 189 rd[c].data_size = TEST_RECORD_DATALEN;
190 rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN); 190 rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN);
191 memset ((char *) rd[c].data, TEST_RECORD_DATA, TEST_RECORD_DATALEN); 191 memset ((char *) rd[c].data, TEST_RECORD_DATA, TEST_RECORD_DATALEN);
192 } 192 }
193
194 return rd; 193 return rd;
195} 194}
196 195
@@ -200,6 +199,7 @@ run (void *cls,
200 const struct GNUNET_CONFIGURATION_Handle *cfg) 199 const struct GNUNET_CONFIGURATION_Handle *cfg)
201{ 200{
202 size_t rd_ser_len; 201 size_t rd_ser_len;
202 struct GNUNET_TIME_Absolute et;
203 203
204 endbadly_task = GNUNET_SCHEDULER_add_delayed(TIMEOUT,endbadly, NULL); 204 endbadly_task = GNUNET_SCHEDULER_add_delayed(TIMEOUT,endbadly, NULL);
205 205
@@ -218,8 +218,9 @@ run (void *cls,
218 GNUNET_NAMESTORE_records_serialize(RECORDS, s_rd, rd_ser_len, rd_ser); 218 GNUNET_NAMESTORE_records_serialize(RECORDS, s_rd, rd_ser_len, rd_ser);
219 219
220 /* sign */ 220 /* sign */
221 s_signature = GNUNET_NAMESTORE_create_signature(privkey, s_rd[0].expiration, s_name, s_rd, RECORDS); 221 et.abs_value = s_rd[0].expiration_time;
222 222 s_signature = GNUNET_NAMESTORE_create_signature(privkey, et, s_name, s_rd, RECORDS);
223
223 /* create random zone hash */ 224 /* create random zone hash */
224 GNUNET_CRYPTO_short_hash (&pubkey, sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), &s_zone); 225 GNUNET_CRYPTO_short_hash (&pubkey, sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), &s_zone);
225 nsh = GNUNET_NAMESTORE_connect (cfg); 226 nsh = GNUNET_NAMESTORE_connect (cfg);