ats_ril: - removed some redundantly saved plugin environment attributes
[oweals/gnunet.git] / src / ats / test_ats_api_scheduling_check_min_bw_alt.c
index ccb100b5ddfed4fc449a523cc3d32ecdbbde5b44..c42feaa2f9f930925b98e24251d75de14e442d45 100644 (file)
@@ -32,7 +32,7 @@
  */
 #include "platform.h"
 #include "gnunet_ats_service.h"
-#include "gnunet_testing_lib-new.h"
+#include "gnunet_testing_lib.h"
 #include "ats.h"
 #include "test_ats_api_common.h"
 
@@ -97,8 +97,11 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
   die_task = GNUNET_SCHEDULER_NO_TASK;
 
-  if (sched_ats != NULL)
-    GNUNET_ATS_scheduling_done (sched_ats);
+  if (NULL != sched_ats)
+  {
+       GNUNET_ATS_scheduling_done (sched_ats);
+       sched_ats = NULL;
+  }
   free_test_address (&test_addr[0]);
   free_test_address (&test_addr[1]);
   ret = GNUNET_SYSERR;
@@ -114,8 +117,11 @@ end ()
     GNUNET_SCHEDULER_cancel (die_task);
     die_task = GNUNET_SCHEDULER_NO_TASK;
   }
-  GNUNET_ATS_scheduling_done (sched_ats);
-  sched_ats = NULL;
+  if (NULL != sched_ats)
+  {
+       GNUNET_ATS_scheduling_done (sched_ats);
+       sched_ats = NULL;
+  }
   free_test_address (&test_addr[0]);
   free_test_address (&test_addr[1]);
 }
@@ -274,13 +280,15 @@ address_suggest_cb (void *cls, const struct GNUNET_HELLO_Address *address,
 
     if (GNUNET_OK != compare_ats(atsi, ats_count, test_ats_info[1], test_ats_count))
     {
-      GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Stage %u: Callback with incorrect ats info \n");
+      GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Stage %u: Callback with incorrect ats info \n",
+          stage);
       ret = 1;
     }
 
     if ((bw_in == 0) || (bw_out == 0))
     {
-        GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Stage %u: ATS did not set bandwidth correctly \n");
+        GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Stage %u: ATS did not set bandwidth correctly \n",
+            stage);
         ret = 1;
     }