diff options
author | Martin Schanzenbach <schanzen@gnunet.org> | 2023-07-03 17:32:32 +0200 |
---|---|---|
committer | Martin Schanzenbach <schanzen@gnunet.org> | 2023-07-03 17:32:32 +0200 |
commit | 13f7a47b9fed4ec7e5192ef5280624c26028173c (patch) | |
tree | d9309b6a31347f753adb6fb5db52c8e3d1c37866 /src/gnsrecord | |
parent | d8ea5adc3bbd828e70104ea38ac18bbe2f6840be (diff) | |
download | gnunet-13f7a47b9fed4ec7e5192ef5280624c26028173c.tar.gz gnunet-13f7a47b9fed4ec7e5192ef5280624c26028173c.zip |
GNS: Fix tests
Diffstat (limited to 'src/gnsrecord')
-rw-r--r-- | src/gnsrecord/test_gnsrecord_testvectors.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/gnsrecord/test_gnsrecord_testvectors.c b/src/gnsrecord/test_gnsrecord_testvectors.c index 0f07c64b3..35f8003f2 100644 --- a/src/gnsrecord/test_gnsrecord_testvectors.c +++ b/src/gnsrecord/test_gnsrecord_testvectors.c | |||
@@ -362,6 +362,8 @@ main () | |||
362 | struct GNUNET_IDENTITY_PublicKey pub; | 362 | struct GNUNET_IDENTITY_PublicKey pub; |
363 | struct GNUNET_IDENTITY_PublicKey pub_parsed; | 363 | struct GNUNET_IDENTITY_PublicKey pub_parsed; |
364 | struct GNUNET_GNSRECORD_Block *rrblock; | 364 | struct GNUNET_GNSRECORD_Block *rrblock; |
365 | struct GNUNET_HashCode query; | ||
366 | struct GNUNET_HashCode expected_query; | ||
365 | char label[128]; | 367 | char label[128]; |
366 | char rdata[8096]; | 368 | char rdata[8096]; |
367 | 369 | ||
@@ -384,6 +386,11 @@ main () | |||
384 | parsehex (tvs[i].rrblock, (char*) rrblock, 0, 0); | 386 | parsehex (tvs[i].rrblock, (char*) rrblock, 0, 0); |
385 | parsehex (tvs[i].label, (char*) label, 0, 0); | 387 | parsehex (tvs[i].label, (char*) label, 0, 0); |
386 | printf ("Got label: %s\n", label); | 388 | printf ("Got label: %s\n", label); |
389 | parsehex (tvs[i].q, (char*) &query, 0, 0); | ||
390 | GNUNET_GNSRECORD_query_from_public_key (&pub_parsed, | ||
391 | label, | ||
392 | &expected_query); | ||
393 | GNUNET_assert (0 == GNUNET_memcmp (&query, &expected_query)); | ||
387 | int len = parsehex (tvs[i].rdata, (char*) rdata, 0, 0); | 394 | int len = parsehex (tvs[i].rdata, (char*) rdata, 0, 0); |
388 | tvs[i].expected_rd_count = GNUNET_GNSRECORD_records_deserialize_get_size ( | 395 | tvs[i].expected_rd_count = GNUNET_GNSRECORD_records_deserialize_get_size ( |
389 | len, | 396 | len, |
@@ -395,11 +402,11 @@ main () | |||
395 | tvs[i]. | 402 | tvs[i]. |
396 | expected_rd_count, | 403 | expected_rd_count, |
397 | tvs[i].expected_rd)); | 404 | tvs[i].expected_rd)); |
398 | GNUNET_GNSRECORD_block_decrypt (rrblock, | 405 | GNUNET_assert (GNUNET_OK == GNUNET_GNSRECORD_block_decrypt (rrblock, |
399 | &pub_parsed, | 406 | &pub_parsed, |
400 | label, | 407 | label, |
401 | &res_checker, | 408 | &res_checker, |
402 | &tvs[i]); | 409 | &tvs[i])); |
403 | } | 410 | } |
404 | return 0; | 411 | return 0; |
405 | } | 412 | } |