aboutsummaryrefslogtreecommitdiff
path: root/src/util/test_mq.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-06-25 09:24:26 +0000
committerChristian Grothoff <christian@grothoff.org>2013-06-25 09:24:26 +0000
commit28ee0c77c5cd31f45e413e200426cb79370988c3 (patch)
treecbf87d080518e72c58f42da670e1ebb99f91ab3c /src/util/test_mq.c
parent52456fbad2ee611f08a43d517f3bd65970bd5b5b (diff)
downloadgnunet-28ee0c77c5cd31f45e413e200426cb79370988c3.tar.gz
gnunet-28ee0c77c5cd31f45e413e200426cb79370988c3.zip
-cleanup leaky test code
Diffstat (limited to 'src/util/test_mq.c')
-rw-r--r--src/util/test_mq.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/util/test_mq.c b/src/util/test_mq.c
index 45bba0a6b..1ec4c37f8 100644
--- a/src/util/test_mq.c
+++ b/src/util/test_mq.c
@@ -19,7 +19,7 @@
19*/ 19*/
20 20
21/** 21/**
22 * @file set/test_mq.c 22 * @file util/test_mq.c
23 * @brief simple tests for mq 23 * @brief simple tests for mq
24 */ 24 */
25#include "platform.h" 25#include "platform.h"
@@ -37,8 +37,9 @@ struct MyMessage
37 37
38GNUNET_NETWORK_STRUCT_END 38GNUNET_NETWORK_STRUCT_END
39 39
40void 40
41test1 (void) 41static void
42test1 ()
42{ 43{
43 struct GNUNET_MQ_Envelope *mqm; 44 struct GNUNET_MQ_Envelope *mqm;
44 struct MyMessage *mm; 45 struct MyMessage *mm;
@@ -54,8 +55,8 @@ test1 (void)
54} 55}
55 56
56 57
57void 58static void
58test2 (void) 59test2 ()
59{ 60{
60 struct GNUNET_MQ_Envelope *mqm; 61 struct GNUNET_MQ_Envelope *mqm;
61 struct GNUNET_MessageHeader *mh; 62 struct GNUNET_MessageHeader *mh;
@@ -68,17 +69,16 @@ test2 (void)
68 mqm = GNUNET_MQ_msg_header_extra (mh, 20, 42); 69 mqm = GNUNET_MQ_msg_header_extra (mh, 20, 42);
69 GNUNET_assert (42 == ntohs (mh->type)); 70 GNUNET_assert (42 == ntohs (mh->type));
70 GNUNET_assert (sizeof (struct GNUNET_MessageHeader) + 20 == ntohs (mh->size)); 71 GNUNET_assert (sizeof (struct GNUNET_MessageHeader) + 20 == ntohs (mh->size));
72 GNUNET_MQ_discard (mqm);
71} 73}
72 74
73 75
74int 76int
75main (int argc, char **argv) 77main (int argc, char **argv)
76{ 78{
77
78 GNUNET_log_setup ("test-mq", "INFO", NULL); 79 GNUNET_log_setup ("test-mq", "INFO", NULL);
79 test1 (); 80 test1 ();
80 test2 (); 81 test2 ();
81
82 return 0; 82 return 0;
83} 83}
84 84