/*
This file is part of GNUnet
- (C) 2008--2013 Christian Grothoff (and other contributing authors)
+ Copyright (C) 2008--2013 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 testbed/testbed_api_sd.c
* @brief test cases for calculating standard deviation
- * @author Sree Harsha Totakura <sreeharsha@totakura.in>
+ * @author Sree Harsha Totakura <sreeharsha@totakura.in>
*/
#include "platform.h"
-#include "gnunet_common.h"
#include "gnunet_util_lib.h"
#include "testbed_api_sd.h"
const struct GNUNET_CONFIGURATION_Handle *config)
{
struct SDHandle *h = GNUNET_TESTBED_SD_init_ (20);
+ int sd;
ret = 0;
GNUNET_TESTBED_SD_add_data_ (h, 40);
- if (GNUNET_SYSERR != GNUNET_TESTBED_SD_deviation_factor_ (h, 10))
+ if (GNUNET_SYSERR != GNUNET_TESTBED_SD_deviation_factor_ (h, 10, &sd))
{
GNUNET_break (0);
ret = 1;
goto err;
}
- GNUNET_TESTBED_SD_add_data_ (h, 30);
- if (GNUNET_SYSERR == GNUNET_TESTBED_SD_deviation_factor_ (h, 80))
+ GNUNET_TESTBED_SD_add_data_ (h, 30);
+ if (GNUNET_SYSERR == GNUNET_TESTBED_SD_deviation_factor_ (h, 80, &sd))
{
GNUNET_break (0);
ret = 1;
goto err;
}
GNUNET_TESTBED_SD_add_data_ (h, 40);
- if (0 != GNUNET_TESTBED_SD_deviation_factor_ (h, 10))
+ if ((GNUNET_SYSERR == GNUNET_TESTBED_SD_deviation_factor_ (h, 30, &sd))
+ || (-2 != sd))
{
GNUNET_break (0);
ret = 1;
}
GNUNET_TESTBED_SD_add_data_ (h, 10);
GNUNET_TESTBED_SD_add_data_ (h, 30);
- if (3 != GNUNET_TESTBED_SD_deviation_factor_ (h, 60))
+ if ((GNUNET_SYSERR == GNUNET_TESTBED_SD_deviation_factor_ (h, 60, &sd))
+ || (3 != sd))
{
GNUNET_break (0);
ret = 1;