diff options
Diffstat (limited to 'src/util/test_server_mst_interrupt.c')
-rw-r--r-- | src/util/test_server_mst_interrupt.c | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/src/util/test_server_mst_interrupt.c b/src/util/test_server_mst_interrupt.c deleted file mode 100644 index 3141a75bd..000000000 --- a/src/util/test_server_mst_interrupt.c +++ /dev/null | |||
@@ -1,60 +0,0 @@ | |||
1 | /* | ||
2 | This file is part of GNUnet. | ||
3 | Copyright (C) 2009, 2010 GNUnet e.V. | ||
4 | |||
5 | GNUnet is free software; you can redistribute it and/or modify | ||
6 | it under the terms of the GNU General Public License as published | ||
7 | by the Free Software Foundation; either version 3, or (at your | ||
8 | option) any later version. | ||
9 | |||
10 | GNUnet is distributed in the hope that it will be useful, but | ||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU General Public License | ||
16 | along with GNUnet; see the file COPYING. If not, write to the | ||
17 | Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
18 | Boston, MA 02110-1301, USA. | ||
19 | */ | ||
20 | /** | ||
21 | * @file util/test_server_mst_interrupt.c | ||
22 | * @brief test for interrupt message processing in server_mst.c | ||
23 | */ | ||
24 | #include "platform.h" | ||
25 | #include "gnunet_protocols.h" | ||
26 | #include "gnunet_util_lib.h" | ||
27 | |||
28 | static struct GNUNET_SERVER_MessageStreamTokenizer * mst; | ||
29 | |||
30 | |||
31 | /* Callback destroying mst with data in buffer */ | ||
32 | static int | ||
33 | mst_cb (void *cls, void *client, | ||
34 | const struct GNUNET_MessageHeader * message) | ||
35 | { | ||
36 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "MST gave me message, destroying\n"); | ||
37 | GNUNET_SERVER_mst_destroy (mst); | ||
38 | return GNUNET_SYSERR; | ||
39 | } | ||
40 | |||
41 | |||
42 | int | ||
43 | main (int argc, char *argv[]) | ||
44 | { | ||
45 | struct GNUNET_PeerIdentity id; | ||
46 | struct GNUNET_MessageHeader msg[2]; | ||
47 | |||
48 | GNUNET_log_setup ("test_server_mst_interrupt", "WARNING", NULL); | ||
49 | memset (&id, 0, sizeof (id)); | ||
50 | msg[0].size = htons (sizeof (msg)); | ||
51 | msg[0].type = htons (sizeof (GNUNET_MESSAGE_TYPE_DUMMY)); | ||
52 | mst = GNUNET_SERVER_mst_create(mst_cb, NULL); | ||
53 | GNUNET_SERVER_mst_receive (mst, &id, | ||
54 | (const char *) &msg, 2 * sizeof (msg), | ||
55 | GNUNET_NO, GNUNET_NO); | ||
56 | /* If we reach this line, it did not crash */ | ||
57 | return 0; | ||
58 | } | ||
59 | |||
60 | /* end of test_server_mst_interrupt.c */ | ||