2 This file is part of GNUnet
3 (C) 2008--2013 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 3, 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 src/testbed/test_testbed_api_test.c
23 * @brief testing cases for testing notications via test master callback upon
24 * timeout while setting up testbed using functions
25 * GNUNET_TESTBED_test_run()
26 * @author Sree Harsha Totakura <sreeharsha@totakura.in>
30 #include "gnunet_common.h"
31 #include "gnunet_testbed_service.h"
35 * Generic logging shortcut
37 #define LOG(kind,...) \
38 GNUNET_log (kind, __VA_ARGS__)
41 * Number of peers we want to start
52 * shortcut to exit during failure
54 #define FAIL_TEST(cond) do { \
57 GNUNET_SCHEDULER_shutdown (); \
64 * Controller event callback
67 * @param event the controller event
70 controller_event_cb (void *cls,
71 const struct GNUNET_TESTBED_EventInformation *event)
78 * Signature of a main function for a testcase.
81 * @param num_peers number of peers in 'peers'
82 * @param peers- handle to peers run in the testbed
83 * @param links_succeeded the number of overlay link connection attempts that
85 * @param links_failed the number of overlay link connection attempts that
89 test_master (void *cls, unsigned int num_peers,
90 struct GNUNET_TESTBED_Peer **peers_,
91 unsigned int links_succeeded,
92 unsigned int links_failed)
94 FAIL_TEST (NULL == cls);
95 FAIL_TEST (0 == num_peers);
96 FAIL_TEST (NULL == peers_);
98 GNUNET_SCHEDULER_shutdown ();
106 main (int argc, char **argv)
110 result = GNUNET_SYSERR;
112 (void) GNUNET_TESTBED_test_run ("test_testbed_api_test",
113 "test_testbed_api_test_timeout.conf", NUM_PEERS,
114 event_mask, &controller_event_cb, NULL,
116 if (GNUNET_OK != result)
121 /* end of test_testbed_api_test.c */