diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-06-25 09:24:26 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-06-25 09:24:26 +0000 |
commit | 28ee0c77c5cd31f45e413e200426cb79370988c3 (patch) | |
tree | cbf87d080518e72c58f42da670e1ebb99f91ab3c /src/util/test_mq.c | |
parent | 52456fbad2ee611f08a43d517f3bd65970bd5b5b (diff) | |
download | gnunet-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.c | 14 |
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 | ||
38 | GNUNET_NETWORK_STRUCT_END | 38 | GNUNET_NETWORK_STRUCT_END |
39 | 39 | ||
40 | void | 40 | |
41 | test1 (void) | 41 | static void |
42 | test1 () | ||
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 | ||
57 | void | 58 | static void |
58 | test2 (void) | 59 | test2 () |
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 | ||
74 | int | 76 | int |
75 | main (int argc, char **argv) | 77 | main (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 | ||