/*
This file is part of GNUnet.
- Copyright (C) 2009, 2010, 2011 Christian Grothoff (and other contributing authors)
+ Copyright (C) 2009, 2010, 2011 GNUnet e.V.
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
You should have received a copy of the GNU General Public License
along with GNUnet; see the file COPYING. If not, write to the
- Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA.
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
*/
/**
* @file transport/test_transport_address_switch.c
static struct GNUNET_TRANSPORT_TESTING_handle *tth;
-static GNUNET_TRANSPORT_TESTING_ConnectRequest cc;
+static struct GNUNET_TRANSPORT_TESTING_ConnectRequest * cc;
static int test_connected;
GNUNET_TRANSPORT_TESTING_stop_peer (tth, p2);
p2 = NULL;
}
-
}
if (p2_switch_success != p2_switch_attempts)
{
GNUNET_break (0);
- result ++;
+ result++;
}
}
else if (p2_addresses_avail > 1)
{
FPRINTF (stderr, "No data sent after switching!\n");
GNUNET_break (0);
- res ++;
+ res++;
}
if ( ((p1_switch_attempts > 0) || (p2_switch_attempts > 0)) &&
(bytes_recv_after_switch == 0) )
{
FPRINTF (stderr, "No data received after switching!\n");
GNUNET_break (0);
- res ++;
+ res++;
}
clean_up();
end_badly ()
{
die_task = NULL;
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Fail (timeout)! Stopping peers\n");
+ clean_up();
+ if (0 == p1_switch_attempts + p2_switch_attempts)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "Test did not work, as peers didn't switch (flawed testcase)!\n");
+ res = 0;
+ }
+ else
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Fail (timeout)! No transmission after switch! Stopping peers\n");
+ res = GNUNET_YES;
+ }
if (test_connected == GNUNET_YES)
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Peers got connected\n");
else
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Peers got NOT EVEN connected\n");
- clean_up();
- res = GNUNET_YES;
}
static void
-progress_indicator (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+progress_indicator (void *cls)
{
static int counter;