Link libgnunetblockgroup to libgnunetblock
[oweals/gnunet.git] / src / util / test_container_heap.c
index 7b352241ccdbb1324cf9f690ef3bf78f63743332..82b0e9523809077269b912eebfc65e80dad149b5 100644 (file)
@@ -1,6 +1,6 @@
 /*
  This file is part of GNUnet.
- (C) 2008 Christian Grothoff (and other contributing authors)
+ Copyright (C) 2008 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
@@ -14,8 +14,8 @@
 
  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.
  */
 
 /**
@@ -25,8 +25,7 @@
  */
 
 #include "platform.h"
-#include "gnunet_common.h"
-#include "gnunet_container_lib.h"
+#include "gnunet_util_lib.h"
 
 static int
 iterator_callback (void *cls,
@@ -68,7 +67,7 @@ check ()
   n1 = GNUNET_CONTAINER_heap_peek (myHeap);
   GNUNET_assert (NULL == n1);
 
-  // GNUNET_CONTAINER_heap_walk_get_next: heap empty, taking if-branch 
+  // GNUNET_CONTAINER_heap_walk_get_next: heap empty, taking if-branch
   n1 = GNUNET_CONTAINER_heap_walk_get_next (myHeap);
   GNUNET_assert (NULL == n1);
 
@@ -76,7 +75,7 @@ check ()
   GNUNET_assert (NULL != n1);
 
 
-  // GNUNET_CONTAINER_heap_peek not empty, taking if-branch  
+  // GNUNET_CONTAINER_heap_peek not empty, taking if-branch
   n2 = NULL;
   n2 = GNUNET_CONTAINER_heap_peek (myHeap);
   GNUNET_assert (NULL != n2);
@@ -95,12 +94,12 @@ check ()
   GNUNET_CONTAINER_heap_iterate (myHeap, &iterator_callback, NULL);
 
   n3 = GNUNET_CONTAINER_heap_insert (myHeap, "15", 5);
-  GNUNET_CONTAINER_heap_update_cost (myHeap, n3, 15);
+  GNUNET_CONTAINER_heap_update_cost (n3, 15);
   GNUNET_assert (2 == GNUNET_CONTAINER_heap_get_size (myHeap));
   GNUNET_CONTAINER_heap_iterate (myHeap, &iterator_callback, NULL);
 
   n4 = GNUNET_CONTAINER_heap_insert (myHeap, "50", 50);
-  GNUNET_CONTAINER_heap_update_cost (myHeap, n4, 50);
+  GNUNET_CONTAINER_heap_update_cost (n4, 50);
   GNUNET_assert (3 == GNUNET_CONTAINER_heap_get_size (myHeap));
   GNUNET_CONTAINER_heap_iterate (myHeap, &iterator_callback, NULL);
 
@@ -111,7 +110,7 @@ check ()
   r = GNUNET_CONTAINER_heap_remove_root (myHeap);       /* n1 */
   GNUNET_assert (NULL != r);
   GNUNET_assert (0 == strcmp ("11", r));
-  GNUNET_CONTAINER_heap_update_cost (myHeap, n6, 200);
+  GNUNET_CONTAINER_heap_update_cost (n6, 200);
   GNUNET_CONTAINER_heap_remove_node (n3);
   r = GNUNET_CONTAINER_heap_remove_root (myHeap);       /* n4 */
   GNUNET_assert (NULL != r);
@@ -123,14 +122,14 @@ check ()
 
   GNUNET_CONTAINER_heap_destroy (myHeap);
 
-  // My additions to a complete testcase  
+  // My additions to a complete testcase
   // Testing a GNUNET_CONTAINER_HEAP_ORDER_MIN
   // Testing remove_node
 
   myHeap = GNUNET_CONTAINER_heap_create (GNUNET_CONTAINER_HEAP_ORDER_MIN);
 
   n1 = GNUNET_CONTAINER_heap_insert (myHeap, "10", 10);
-  GNUNET_CONTAINER_heap_update_cost (myHeap, n1, 15);
+  GNUNET_CONTAINER_heap_update_cost (n1, 15);
 
   r = GNUNET_CONTAINER_heap_remove_node (n1);
   GNUNET_assert (NULL != r);
@@ -215,7 +214,7 @@ check ()
   myHeap = GNUNET_CONTAINER_heap_create (GNUNET_CONTAINER_HEAP_ORDER_MAX);
 
   n1 = GNUNET_CONTAINER_heap_insert (myHeap, "10", 10);
-  GNUNET_CONTAINER_heap_update_cost (myHeap, n1, 15);
+  GNUNET_CONTAINER_heap_update_cost (n1, 15);
 
   GNUNET_assert (0 == nstrcmp ("10", GNUNET_CONTAINER_heap_remove_node (n1)));