[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r8434 - GNUnet/src/applications/dv/module
From: |
gnunet |
Subject: |
[GNUnet-SVN] r8434 - GNUnet/src/applications/dv/module |
Date: |
Mon, 27 Apr 2009 13:03:29 -0600 |
Author: nevans
Date: 2009-04-27 13:03:29 -0600 (Mon, 27 Apr 2009)
New Revision: 8434
Modified:
GNUnet/src/applications/dv/module/check.conf
GNUnet/src/applications/dv/module/dv_heaptest.c
Log:
after precommit
Modified: GNUnet/src/applications/dv/module/check.conf
===================================================================
--- GNUnet/src/applications/dv/module/check.conf 2009-04-27 19:02:55 UTC
(rev 8433)
+++ GNUnet/src/applications/dv/module/check.conf 2009-04-27 19:03:29 UTC
(rev 8434)
@@ -1,6 +1,6 @@
# General settings
[GNUNET]
-GNUNET_HOME = "/tmp/gnunet-session-test-driver"
+GNUNET_HOME = "/tmp/gnunet-dv-test-driver"
LOGLEVEL = "ERROR"
LOGFILE = ""
PROCESS-PRIORITY = "NORMAL"
Modified: GNUnet/src/applications/dv/module/dv_heaptest.c
===================================================================
--- GNUnet/src/applications/dv/module/dv_heaptest.c 2009-04-27 19:02:55 UTC
(rev 8433)
+++ GNUnet/src/applications/dv/module/dv_heaptest.c 2009-04-27 19:03:29 UTC
(rev 8434)
@@ -27,7 +27,6 @@
#include "gnunet_util.h"
#include "gnunet_util_crypto.h"
#include "platform.h"
-#include "heap.h"
#include "dv.h"
#include "../../../util/crypto/hostkey_gcrypt.c"
@@ -37,92 +36,15 @@
static int tempminsize;
static int heapverify;
-static int
-count_max_callback (struct GNUNET_dv_neighbor *neighbor,
- struct GNUNET_dv_heap *root, void *cls)
-{
- tempmaxsize++;
- return 1;
-}
-static int
-count_min_callback (struct GNUNET_dv_neighbor *neighbor,
- struct GNUNET_dv_heap *root, void *cls)
-{
- tempminsize++;
- return 1;
-}
-
-static int
-heap_verify_callback (struct GNUNET_dv_neighbor *neighbor,
- struct GNUNET_dv_heap *root, void *cls)
-{
- int ret;
- ret = heapverify;
- if (root->type == GNUNET_CONTAINER_MAX_HEAP)
- {
- if ((neighbor->max_loc->left_child != NULL)
- && (neighbor->cost < neighbor->max_loc->left_child->neighbor->cost))
- {
- ret = GNUNET_SYSERR;
- }
-
- if ((neighbor->max_loc->right_child != NULL)
- && (neighbor->cost <
- neighbor->max_loc->right_child->neighbor->cost))
- {
- ret = GNUNET_SYSERR;
- }
- }
- else if (root->type == GNUNET_CONTAINER_MIN_HEAP)
- {
- if ((neighbor->min_loc->left_child != NULL)
- && (neighbor->cost > neighbor->min_loc->left_child->neighbor->cost))
- {
- ret = GNUNET_SYSERR;
- }
-
- if ((neighbor->min_loc->right_child != NULL)
- && (neighbor->cost >
- neighbor->min_loc->right_child->neighbor->cost))
- {
- ret = GNUNET_SYSERR;
- }
- }
-
- heapverify = ret;
- return ret;
-}
-
-
-static int
-iterator_callback (struct GNUNET_dv_neighbor *neighbor,
- struct GNUNET_dv_heap *root, void *cls)
-{
- fprintf (stdout, "%d\n", neighbor->cost);
-
- return GNUNET_OK;
-}
-
-static int
-check_node (struct GNUNET_dv_neighbor *neighbor)
-{
- if ((neighbor->max_loc->neighbor == neighbor)
- && (neighbor->min_loc->neighbor == neighbor))
- return GNUNET_OK;
- else
- return GNUNET_SYSERR;
-}
-
-
int
main (int argc, char **argv)
{
struct GNUNET_RSA_PrivateKey *hostkey;
GNUNET_RSA_PublicKey pubkey;
- struct GNUNET_dv_heap *minHeap;
- struct GNUNET_dv_heap *maxHeap;
+ struct GNUNET_CONTAINER_Heap *minHeap;
+ struct GNUNET_CONTAINER_Heap *maxHeap;
int i;
int j;
int ret;
@@ -163,8 +85,10 @@
&neighbors[cur_pos]->neighbor->hashPubKey);
//neighbors[cur_pos]->cost = temp_rand;
neighbors[cur_pos]->cost = temp_rand;
- GNUNET_CONTAINER_heap_insert (maxHeap, neighbors[cur_pos]);
- GNUNET_CONTAINER_heap_insert (minHeap, neighbors[cur_pos]);
+ GNUNET_CONTAINER_heap_insert (maxHeap, neighbors[cur_pos],
+ temp_rand);
+ GNUNET_CONTAINER_heap_insert (minHeap, neighbors[cur_pos],
+ temp_rand);
cur_pos++;
break;
@@ -175,7 +99,7 @@
temp_node + 1, neighbors[temp_node]->cost, temp_rand);
GNUNET_CONTAINER_heap_update_cost (maxHeap, neighbors[temp_node],
temp_rand);
- GNUNET_CONTAINER_heap_update_Cost (minHeap, neighbors[temp_node],
+ GNUNET_CONTAINER_heap_update_cost (minHeap, neighbors[temp_node],
temp_rand);
break;
case 3:
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r8434 - GNUnet/src/applications/dv/module,
gnunet <=