aboutsummaryrefslogtreecommitdiff
path: root/src/namestore/perf_namestore_api_import.c
diff options
context:
space:
mode:
authorMartin Schanzenbach <schanzen@gnunet.org>2022-10-04 22:59:17 +0900
committerMartin Schanzenbach <schanzen@gnunet.org>2022-10-04 22:59:17 +0900
commitc2d49b07850e1306d0ce45c63ad726ae4543e6f6 (patch)
tree7cd99c014bbbd854faae4e6f07f60cbe771c1e56 /src/namestore/perf_namestore_api_import.c
parente2cb3bd7489244c4d31fd7cdad0a54b7602227b5 (diff)
downloadgnunet-c2d49b07850e1306d0ce45c63ad726ae4543e6f6.tar.gz
gnunet-c2d49b07850e1306d0ce45c63ad726ae4543e6f6.zip
-fix test
Diffstat (limited to 'src/namestore/perf_namestore_api_import.c')
-rw-r--r--src/namestore/perf_namestore_api_import.c30
1 files changed, 10 insertions, 20 deletions
diff --git a/src/namestore/perf_namestore_api_import.c b/src/namestore/perf_namestore_api_import.c
index 5822eb920..369b29600 100644
--- a/src/namestore/perf_namestore_api_import.c
+++ b/src/namestore/perf_namestore_api_import.c
@@ -82,11 +82,7 @@ static uint8_t seen[1 + BENCHMARK_SIZE / 8];
82 82
83static struct GNUNET_TIME_Absolute start; 83static struct GNUNET_TIME_Absolute start;
84 84
85const struct GNUNET_GNSRECORD_Data *a_rd[TEST_RECORD_COUNT]; 85struct GNUNET_NAMESTORE_RecordInfo ri[TEST_RECORD_COUNT];
86
87unsigned int a_rd_count[TEST_RECORD_COUNT];
88
89const char *a_label[TEST_RECORD_COUNT];
90 86
91int single_put_pos; 87int single_put_pos;
92 88
@@ -239,9 +235,7 @@ publish_records_bulk_tx (void *cls)
239 qe = GNUNET_NAMESTORE_records_store2 (nsh, 235 qe = GNUNET_NAMESTORE_records_store2 (nsh,
240 &privkey, 236 &privkey,
241 TEST_BATCH_SIZE, 237 TEST_BATCH_SIZE,
242 &a_label[bulk_count * TEST_BATCH_SIZE], 238 &ri[bulk_count * TEST_BATCH_SIZE],
243 &a_rd_count[bulk_count * TEST_BATCH_SIZE],
244 &a_rd[bulk_count * TEST_BATCH_SIZE],
245 (bulk_count == TEST_BATCH_COUNT - 1) ? &put_cont_bulk_tx : 239 (bulk_count == TEST_BATCH_COUNT - 1) ? &put_cont_bulk_tx :
246 &reput_cont_bulk_tx, 240 &reput_cont_bulk_tx,
247 NULL); 241 NULL);
@@ -258,9 +252,7 @@ begin_cont (void *cls,
258 qe = GNUNET_NAMESTORE_records_store2 (nsh, 252 qe = GNUNET_NAMESTORE_records_store2 (nsh,
259 &privkey, 253 &privkey,
260 TEST_BATCH_SIZE, 254 TEST_BATCH_SIZE,
261 &a_label[bulk_count * TEST_BATCH_SIZE], 255 &ri[bulk_count * TEST_BATCH_SIZE],
262 &a_rd_count[bulk_count * TEST_BATCH_SIZE],
263 &a_rd[bulk_count * TEST_BATCH_SIZE],
264 (bulk_count == TEST_BATCH_COUNT - 1) ? &put_cont_bulk_tx : 256 (bulk_count == TEST_BATCH_COUNT - 1) ? &put_cont_bulk_tx :
265 &reput_cont_bulk_tx, 257 &reput_cont_bulk_tx,
266 NULL); 258 NULL);
@@ -327,9 +319,7 @@ publish_records_bulk (void *cls)
327 qe = GNUNET_NAMESTORE_records_store2 (nsh, 319 qe = GNUNET_NAMESTORE_records_store2 (nsh,
328 &privkey, 320 &privkey,
329 TEST_BATCH_SIZE, 321 TEST_BATCH_SIZE,
330 &a_label[bulk_count * TEST_BATCH_SIZE], 322 &ri[bulk_count * TEST_BATCH_SIZE],
331 &a_rd_count[bulk_count * TEST_BATCH_SIZE],
332 &a_rd[bulk_count * TEST_BATCH_SIZE],
333 (bulk_count == TEST_BATCH_COUNT - 1) ? &put_cont_bulk : 323 (bulk_count == TEST_BATCH_COUNT - 1) ? &put_cont_bulk :
334 &reput_cont_bulk, 324 &reput_cont_bulk,
335 NULL); 325 NULL);
@@ -391,9 +381,9 @@ publish_records_single (void *cls)
391 } 381 }
392 qe = GNUNET_NAMESTORE_records_store (nsh, 382 qe = GNUNET_NAMESTORE_records_store (nsh,
393 &privkey, 383 &privkey,
394 a_label[single_put_pos], 384 ri[single_put_pos].a_label,
395 a_rd_count[single_put_pos], 385 ri[single_put_pos].a_rd_count,
396 a_rd[single_put_pos], 386 ri[single_put_pos].a_rd,
397 &put_cont_single, 387 &put_cont_single,
398 NULL); 388 NULL);
399 GNUNET_free (label); 389 GNUNET_free (label);
@@ -409,9 +399,9 @@ run (void *cls,
409 399
410 for (int i = 0; i < TEST_RECORD_COUNT; i++) 400 for (int i = 0; i < TEST_RECORD_COUNT; i++)
411 { 401 {
412 a_rd[i] = create_record (1); 402 ri[i].a_rd = create_record (1);
413 a_rd_count[i] = 1; 403 ri[i].a_rd_count = 1;
414 GNUNET_asprintf ((char**) &a_label[i], "label_%d", i); 404 GNUNET_asprintf ((char**) &ri[i].a_label, "label_%d", i);
415 } 405 }
416 GNUNET_SCHEDULER_add_shutdown (&end, 406 GNUNET_SCHEDULER_add_shutdown (&end,
417 NULL); 407 NULL);