gnunet-svn
[Top][All Lists]
Advanced

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

[gnunet] branch master updated: assert run is non-null for most cmds, e


From: gnunet
Subject: [gnunet] branch master updated: assert run is non-null for most cmds, except end
Date: Tue, 15 Aug 2023 20:27:05 +0200

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

grothoff pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new c13296860 assert run is non-null for most cmds, except end
c13296860 is described below

commit c132968605dd3e824765e4c1154840f9659a3e70
Author: Christian Grothoff <grothoff@gnunet.org>
AuthorDate: Tue Aug 15 20:27:00 2023 +0200

    assert run is non-null for most cmds, except end
---
 src/testing/Makefile.am           |  1 -
 src/testing/testing_api_cmd_end.c | 37 -------------------------------------
 src/testing/testing_api_loop.c    | 18 +++++++++++++++---
 3 files changed, 15 insertions(+), 41 deletions(-)

diff --git a/src/testing/Makefile.am b/src/testing/Makefile.am
index 1f6ccc15b..649128d4d 100644
--- a/src/testing/Makefile.am
+++ b/src/testing/Makefile.am
@@ -31,7 +31,6 @@ gnunet_cmds_helper_LDADD = $(XLIB) \
 libgnunettesting_la_SOURCES = \
   testing_api_cmd_barrier.c \
   testing_api_cmd_barrier_reached.c \
-  testing_api_cmd_end.c \
   testing_api_cmd_finish.c \
   testing_api_cmd_local_test_prepared.c \
   testing_api_cmd_send_peer_ready.c \
diff --git a/src/testing/testing_api_cmd_end.c 
b/src/testing/testing_api_cmd_end.c
deleted file mode 100644
index 085420f81..000000000
--- a/src/testing/testing_api_cmd_end.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
-      This file is part of GNUnet
-      Copyright (C) 2021 GNUnet e.V.
-
-      GNUnet is free software: you can redistribute it and/or modify it
-      under the terms of the GNU Affero General Public License as published
-      by the Free Software Foundation, either version 3 of the License,
-      or (at your option) any later version.
-
-      GNUnet is distributed in the hope that it will be useful, but
-      WITHOUT ANY WARRANTY; without even the implied warranty of
-      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-      Affero General Public License for more details.
-
-      You should have received a copy of the GNU Affero General Public License
-      along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-     SPDX-License-Identifier: AGPL3.0-or-later
- */
-/**
- * @file testing/testing_api_cmd_end.c
- * @brief command to end a command array
- */
-#include "platform.h"
-#include "gnunet_util_lib.h"
-#include "gnunet_testing_ng_lib.h"
-
-
-struct GNUNET_TESTING_Command
-GNUNET_TESTING_cmd_end (void)
-{
-  return GNUNET_TESTING_command_new (NULL, NULL,
-                                     NULL, NULL,
-                                     NULL, NULL);
-}
-
-
diff --git a/src/testing/testing_api_loop.c b/src/testing/testing_api_loop.c
index f53e1ecdb..0110f2cc9 100644
--- a/src/testing/testing_api_loop.c
+++ b/src/testing/testing_api_loop.c
@@ -611,12 +611,24 @@ GNUNET_TESTING_command_new (void *cls,
     .cleanup = cleanup,
     .traits = traits
   };
-  memset (&cmd.label, 0, sizeof (cmd.label));
-  if (NULL != label)
-    strncpy (cmd.label, label, GNUNET_TESTING_CMD_MAX_LABEL_LENGTH);
 
+  GNUNET_assert (NULL != run);
+  if (NULL != label)
+    strncpy (cmd.label,
+             label,
+             GNUNET_TESTING_CMD_MAX_LABEL_LENGTH);
   return cmd;
+}
+
+
+struct GNUNET_TESTING_Command
+GNUNET_TESTING_cmd_end (void)
+{
+  struct GNUNET_TESTING_Command cmd = {
+    .run = NULL
+  };
 
+  return cmd;
 }
 
 

-- 
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]