2 This file is part of GNUnet.
3 (C) 2004, 2005, 2006 Christian Grothoff (and other contributing authors)
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 2, or (at your
8 option) any later version.
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.
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., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
22 * @file applications/fs/fsui/fsui_start_stop_test.c
23 * @brief testcase for fsui (start-stop only)
24 * @author Christian Grothoff
28 #include "gnunet_util.h"
29 #include "gnunet_fsui_lib.h"
31 #define CHECK(a) if (!(a)) { ok = GNUNET_NO; GNUNET_GE_BREAK(NULL, 0); goto FAILURE; }
34 static struct GNUNET_FSUI_Context *ctx;
37 eventCallback (void *cls, const GNUNET_FSUI_Event * event)
42 #define START_DAEMON 1
45 main (int argc, char *argv[])
51 struct GNUNET_GC_Configuration *cfg;
53 cfg = GNUNET_GC_create ();
54 if (-1 == GNUNET_GC_parse_configuration (cfg, "check.conf"))
60 daemon = GNUNET_daemon_start (NULL, cfg, "peer.conf", GNUNET_NO);
61 GNUNET_GE_ASSERT (NULL, daemon > 0);
63 GNUNET_wait_for_daemon_running (NULL, cfg,
64 60 * GNUNET_CRON_SECONDS));
67 GNUNET_thread_sleep (5 * GNUNET_CRON_SECONDS); /* give apps time to start */
69 /* ACTUAL TEST CODE */
70 ctx = GNUNET_FSUI_start (NULL, cfg, "fsui_start_stop_test", 32, GNUNET_YES, /* do resume! */
71 &eventCallback, NULL);
73 GNUNET_FSUI_stop (ctx);
75 GNUNET_FSUI_start (NULL, cfg, "fsui_start_stop_test", 32, GNUNET_YES,
76 &eventCallback, NULL);
80 GNUNET_FSUI_stop (ctx);
82 GNUNET_GE_ASSERT (NULL, GNUNET_OK == GNUNET_daemon_stop (NULL, daemon));
86 return (ok == GNUNET_YES) ? 0 : 1;
89 /* end of fsui_start_stop_test.c */