/**
* @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;