gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet] branch master updated: -fix more test issues


From: gnunet
Subject: [gnunet] branch master updated: -fix more test issues
Date: Tue, 06 Dec 2022 05:52:07 +0100

This is an automated email from the git hooks/post-receive script.

martin-schanzenbach pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new 69e6c0b89 -fix more test issues
69e6c0b89 is described below

commit 69e6c0b893b0b642f969ac8a134d043a51e393a3
Author: Martin Schanzenbach <schanzen@gnunet.org>
AuthorDate: Tue Dec 6 13:52:01 2022 +0900

    -fix more test issues
---
 src/namestore/test_namestore_api_edit_records.c |   9 +-
 src/transport/Makefile.am                       |   1 +
 src/util/test_bio.c                             | 110 +-----------------------
 3 files changed, 7 insertions(+), 113 deletions(-)

diff --git a/src/namestore/test_namestore_api_edit_records.c 
b/src/namestore/test_namestore_api_edit_records.c
index ee05f498a..fb588f0e1 100644
--- a/src/namestore/test_namestore_api_edit_records.c
+++ b/src/namestore/test_namestore_api_edit_records.c
@@ -24,7 +24,6 @@
 #include "platform.h"
 #include "gnunet_namestore_service.h"
 #include "gnunet_testing_lib.h"
-#include "gnunet_dnsparser_lib.h"
 
 #define TEST_RECORD_TYPE GNUNET_DNSPARSER_TYPE_TXT
 
@@ -187,7 +186,7 @@ commit_cont_a (void *cls,
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Name store added record for `%s': %s\n",
               name,
-              (success == GNUNET_OK) ? "SUCCESS" : "FAIL");
+              (GNUNET_EC_NONE == ec) ? "SUCCESS" : "FAIL");
   /**
    * Try again for B
    */
@@ -263,7 +262,7 @@ begin_cont (void *cls,
 {
   const char *name = cls;
 
-  GNUNET_assert (success == GNUNET_YES);
+  GNUNET_assert (GNUNET_EC_NONE == ec);
   nsqe = GNUNET_NAMESTORE_records_edit (nsh,
                                         &privkey,
                                         name,
@@ -288,7 +287,7 @@ preload_cont (void *cls,
     GNUNET_break (0);
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                 "Namestore could not store record: `%s'\n",
-                GNUNET_ErroCode_get_hint (ec));
+                GNUNET_ErrorCode_get_hint (ec));
     if (endbadly_task != NULL)
       GNUNET_SCHEDULER_cancel (endbadly_task);
     endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
@@ -298,7 +297,7 @@ preload_cont (void *cls,
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Name store added record for `%s': %s\n",
               name,
-              (success == GNUNET_OK) ? "SUCCESS" : "FAIL");
+              (GNUNET_EC_NONE == ec) ? "SUCCESS" : "FAIL");
   /* We start transaction for A */
   nsqe = GNUNET_NAMESTORE_transaction_begin (nsh, begin_cont, (void *) name);
 
diff --git a/src/transport/Makefile.am b/src/transport/Makefile.am
index 363f8b199..9d372f184 100644
--- a/src/transport/Makefile.am
+++ b/src/transport/Makefile.am
@@ -1495,6 +1495,7 @@ test_transport_simple_send.sh \
 test_transport_simple_send_broadcast.sh \
 test_transport_udp_backchannel.sh \
 test_transport_simple_send_dv_circle.sh \
+test_transport_simple_send_dv_inverse.sh \
 gnunet-transport-certificate-creation.in \
 communicator-unix.conf \
 test_plugin_hostkey \
diff --git a/src/util/test_bio.c b/src/util/test_bio.c
index 0b76bbb43..90f0121d4 100644
--- a/src/util/test_bio.c
+++ b/src/util/test_bio.c
@@ -40,8 +40,6 @@ test_normal_rw (void)
   void *buffer;
   size_t buffer_size = 0;
   char *filename = GNUNET_DISK_mktemp ("gnunet-bio");
-  struct GNUNET_CONTAINER_MetaData *mdW;
-  struct GNUNET_CONTAINER_MetaData *mdR = NULL;
   char *rString = NULL;
   int64_t wNum = TESTNUMBER64;
   int64_t rNum = 0;
@@ -188,41 +186,6 @@ test_bigstring_rw (void)
 }
 
 
-static int
-test_bigmeta_rw (void)
-{
-  static char meta[1024 * 1024 * 10];
-  struct GNUNET_BIO_WriteHandle *wh;
-  struct GNUNET_BIO_ReadHandle *rh;
-  char *filename = GNUNET_DISK_mktemp ("gnunet_bio");
-  struct GNUNET_CONTAINER_MetaData *mdR = NULL;
-
-  memset (meta, 'b', sizeof (meta));
-  meta[sizeof (meta) - 1] = '\0';
-
-  wh = GNUNET_BIO_write_open_file (filename);
-  GNUNET_assert (NULL != wh);
-  GNUNET_assert (GNUNET_OK == GNUNET_BIO_write_int32 (wh,
-                                                      "test-bigmeta-rw-int32",
-                                                      sizeof (meta)));
-  GNUNET_assert (GNUNET_OK == GNUNET_BIO_write (wh,
-                                                "test-bigmeta-rw-bytes",
-                                                meta,
-                                                sizeof (meta)));
-  GNUNET_assert (GNUNET_OK == GNUNET_BIO_write_close (wh, NULL));
-
-  rh = GNUNET_BIO_read_open_file (filename);
-  GNUNET_assert (NULL != rh);
-  GNUNET_assert (GNUNET_SYSERR == GNUNET_BIO_read_close (rh, NULL));
-
-  GNUNET_assert (NULL == mdR);
-
-  GNUNET_assert (GNUNET_OK == GNUNET_DISK_directory_remove (filename));
-  GNUNET_free (filename);
-  return 0;
-}
-
-
 static int
 test_directory_r (void)
 {
@@ -252,12 +215,12 @@ test_nullfile_rw (void)
   memset (filename, 'a', sizeof (filename));
   filename[sizeof (filename) - 1] = '\0';
 
-  GNUNET_log_skip (2, GNUNET_NO);
+  GNUNET_log_skip (1, GNUNET_NO);
   wh = GNUNET_BIO_write_open_file (filename);
   GNUNET_log_skip (0, GNUNET_YES);
   GNUNET_assert (NULL == wh);
 
-  GNUNET_log_skip (2, GNUNET_NO);
+  GNUNET_log_skip (1, GNUNET_NO);
   rh = GNUNET_BIO_read_open_file (filename);
   GNUNET_log_skip (0, GNUNET_YES);
   GNUNET_assert (NULL == rh);
@@ -275,8 +238,6 @@ test_fullfile_rw (void)
   struct GNUNET_BIO_ReadHandle *rh;
   char *rString = NULL;
   char rResult[200];
-  struct GNUNET_CONTAINER_MetaData *mdW;
-  struct GNUNET_CONTAINER_MetaData *mdR = NULL;
 
   struct GNUNET_BIO_WriteSpec ws[] = {
     GNUNET_BIO_write_spec_object ("test-fullfile-rw-bytes",
@@ -308,7 +269,6 @@ test_fullfile_rw (void)
   GNUNET_assert (GNUNET_SYSERR == GNUNET_BIO_read_close (rh, NULL));
 
   GNUNET_assert (NULL == rString);
-  GNUNET_assert (NULL == mdR);
 #endif
   return 0;
 }
@@ -345,61 +305,6 @@ test_fakestring_rw (void)
 }
 
 
-static int
-test_fakemeta_rw (void)
-{
-  struct GNUNET_BIO_WriteHandle *wh;
-  struct GNUNET_BIO_ReadHandle *rh;
-  char *filename = GNUNET_DISK_mktemp ("gnunet_bio");
-  struct GNUNET_CONTAINER_MetaData *mdR = NULL;
-
-  wh = GNUNET_BIO_write_open_file (filename);
-  GNUNET_assert (NULL != wh);
-  GNUNET_assert (GNUNET_OK == GNUNET_BIO_write_int32 (wh,
-                                                      
"test-fakestring-rw-int32",
-                                                      2));
-  GNUNET_assert (GNUNET_OK == GNUNET_BIO_write_close (wh, NULL));
-
-  rh = GNUNET_BIO_read_open_file (filename);
-  GNUNET_assert (NULL != rh);
-  GNUNET_assert (GNUNET_SYSERR == GNUNET_BIO_read_close (rh, NULL));
-
-  GNUNET_assert (NULL == mdR);
-
-  GNUNET_assert (GNUNET_OK == GNUNET_DISK_directory_remove (filename));
-  GNUNET_free (filename);
-  return 0;
-}
-
-
-static int
-test_fakebigmeta_rw (void)
-{
-  struct GNUNET_BIO_WriteHandle *wh;
-  struct GNUNET_BIO_ReadHandle *rh;
-  char *filename = GNUNET_DISK_mktemp ("gnunet_bio");
-  struct GNUNET_CONTAINER_MetaData *mdR = NULL;
-  int32_t wNum = 1024 * 1024 * 10;
-
-  wh = GNUNET_BIO_write_open_file (filename);
-  GNUNET_assert (NULL != wh);
-  GNUNET_assert (GNUNET_OK == GNUNET_BIO_write_int32 (wh,
-                                                      
"test-fakebigmeta-rw-int32",
-                                                      wNum));
-  GNUNET_assert (GNUNET_OK == GNUNET_BIO_write_close (wh, NULL));
-
-  rh = GNUNET_BIO_read_open_file (filename);
-  GNUNET_assert (NULL != rh);
-  GNUNET_assert (GNUNET_SYSERR == GNUNET_BIO_read_close (rh, NULL));
-
-  GNUNET_assert (NULL == mdR);
-
-  GNUNET_assert (GNUNET_OK == GNUNET_DISK_directory_remove (filename));
-  GNUNET_free (filename);
-  return 0;
-}
-
-
 static int
 check_string_rw (void)
 {
@@ -411,16 +316,6 @@ check_string_rw (void)
 }
 
 
-static int
-check_metadata_rw (void)
-{
-  GNUNET_assert (0 == test_fakebigmeta_rw ());
-  GNUNET_assert (0 == test_fakemeta_rw ());
-  GNUNET_assert (0 == test_bigmeta_rw ());
-  return 0;
-}
-
-
 static int
 check_file_rw (void)
 {
@@ -437,7 +332,6 @@ main (int argc, char *argv[])
 {
   GNUNET_log_setup ("test-bio", "WARNING", NULL);
   GNUNET_assert (0 == check_file_rw ());
-  GNUNET_assert (0 == check_metadata_rw ());
   GNUNET_assert (0 == check_string_rw ());
   return 0;
 }

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]