aboutsummaryrefslogtreecommitdiff
path: root/src/testing/testing_api_cmd_local_test_prepared.c
diff options
context:
space:
mode:
authorMartin Schanzenbach <schanzen@gnunet.org>2022-12-08 20:51:35 +0900
committerMartin Schanzenbach <schanzen@gnunet.org>2022-12-08 20:51:35 +0900
commit7768a7a75ee959b53cf7a7acdfa0a8c7b17de99e (patch)
treeaaabeaa4b8e8a0afe82d8d7538d271525105da48 /src/testing/testing_api_cmd_local_test_prepared.c
parentdccf4142eaac44711692c295d81e0103c8042cd2 (diff)
downloadgnunet-7768a7a75ee959b53cf7a7acdfa0a8c7b17de99e.tar.gz
gnunet-7768a7a75ee959b53cf7a7acdfa0a8c7b17de99e.zip
TESTING: Sanitize API. Add new GNUNET_TESTING_command_new API
This commit changes the label member of GNUNET_TRANSPORT_Command to a static, fixed length buffer allocated with the struct itself. The check for the end of a command array should be done by checking the run command instead of the label.
Diffstat (limited to 'src/testing/testing_api_cmd_local_test_prepared.c')
-rw-r--r--src/testing/testing_api_cmd_local_test_prepared.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/testing/testing_api_cmd_local_test_prepared.c b/src/testing/testing_api_cmd_local_test_prepared.c
index a4082f0e3..3f976f554 100644
--- a/src/testing/testing_api_cmd_local_test_prepared.c
+++ b/src/testing/testing_api_cmd_local_test_prepared.c
@@ -102,14 +102,9 @@ GNUNET_TESTING_cmd_local_test_prepared (const char *label,
102 lfs = GNUNET_new (struct LocalPreparedState); 102 lfs = GNUNET_new (struct LocalPreparedState);
103 lfs->write_message = write_message; 103 lfs->write_message = write_message;
104 104
105 struct GNUNET_TESTING_Command cmd = { 105 return GNUNET_TESTING_command_new (lfs, label,
106 .cls = lfs, 106 &local_test_prepared_run,
107 .label = GNUNET_strdup (label), 107 &local_test_prepared_cleanup,
108 .run = &local_test_prepared_run, 108 &local_test_prepared_traits,
109 .ac = &lfs->ac, 109 &lfs->ac);
110 .cleanup = &local_test_prepared_cleanup,
111 .traits = &local_test_prepared_traits
112 };
113
114 return cmd;
115} 110}