gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r34490 - gnunet/src/scalarproduct


From: gnunet
Subject: [GNUnet-SVN] r34490 - gnunet/src/scalarproduct
Date: Sun, 7 Dec 2014 01:42:31 +0100

Author: grothoff
Date: 2014-12-07 01:42:31 +0100 (Sun, 07 Dec 2014)
New Revision: 34490

Modified:
   gnunet/src/scalarproduct/gnunet-service-scalarproduct_alice.c
   gnunet/src/scalarproduct/gnunet-service-scalarproduct_bob.c
   gnunet/src/scalarproduct/scalarproduct.conf.in
   gnunet/src/scalarproduct/test_scalarproduct.conf
   gnunet/src/scalarproduct/test_scalarproduct.sh
Log:
-fix some of the obvious issues

Modified: gnunet/src/scalarproduct/gnunet-service-scalarproduct_alice.c
===================================================================
--- gnunet/src/scalarproduct/gnunet-service-scalarproduct_alice.c       
2014-12-07 00:21:18 UTC (rev 34489)
+++ gnunet/src/scalarproduct/gnunet-service-scalarproduct_alice.c       
2014-12-07 00:42:31 UTC (rev 34490)
@@ -817,8 +817,8 @@
 element_cmp (const void *a,
              const void *b)
 {
-  const struct MpiElement *ma = *(const struct MpiElement **) a;
-  const struct MpiElement *mb = *(const struct MpiElement **) b;
+  const struct MpiElement *ma = a;
+  const struct MpiElement *mb = b;
 
   return GNUNET_CRYPTO_hash_cmp (ma->key,
                                  mb->key);
@@ -858,7 +858,7 @@
   LOG (GNUNET_ERROR_TYPE_DEBUG,
        "Finished intersection, %d items remain\n",
        s->used_element_count);
-  qsort (s->intersected_elements,
+  qsort (s->sorted_elements,
          s->used_element_count,
          sizeof (struct MpiElement),
          &element_cmp);
@@ -1296,6 +1296,8 @@
 {
   struct AliceServiceSession *s;
 
+  if (NULL == client)
+    return;
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Client %p disconnected from us.\n",
               client);

Modified: gnunet/src/scalarproduct/gnunet-service-scalarproduct_bob.c
===================================================================
--- gnunet/src/scalarproduct/gnunet-service-scalarproduct_bob.c 2014-12-07 
00:21:18 UTC (rev 34489)
+++ gnunet/src/scalarproduct/gnunet-service-scalarproduct_bob.c 2014-12-07 
00:42:31 UTC (rev 34490)
@@ -815,8 +815,8 @@
 element_cmp (const void *a,
              const void *b)
 {
-  const struct MpiElement *ma = *(const struct MpiElement **) a;
-  const struct MpiElement *mb = *(const struct MpiElement **) b;
+  const struct MpiElement *ma = a;
+  const struct MpiElement *mb = b;
 
   return GNUNET_CRYPTO_hash_cmp (ma->key,
                                  mb->key);
@@ -844,7 +844,7 @@
   LOG (GNUNET_ERROR_TYPE_DEBUG,
        "Finished intersection, %d items remain\n",
        s->used_element_count);
-  qsort (s->intersected_elements,
+  qsort (s->sorted_elements,
          s->used_element_count,
          sizeof (struct MpiElement),
          &element_cmp);

Modified: gnunet/src/scalarproduct/scalarproduct.conf.in
===================================================================
--- gnunet/src/scalarproduct/scalarproduct.conf.in      2014-12-07 00:21:18 UTC 
(rev 34489)
+++ gnunet/src/scalarproduct/scalarproduct.conf.in      2014-12-07 00:42:31 UTC 
(rev 34490)
@@ -1,10 +1,23 @@
 [scalarproduct-alice]
+AUTOSTART = @AUTOSTART@
 BINARY = gnunet-service-scalarproduct-alice
 UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-scalarproduct-alice.sock
 @UNIXONLY@ PORT = 2117
+#ACCEPT_FROM = 127.0.0.1;
+#ACCEPT_FROM6 = ::1;
+UNIX_MATCH_UID = NO
+UNIX_MATCH_GID = YES
+#OPTIONS = -L DEBUG
 
 [scalarproduct-bob]
+AUTOSTART = @AUTOSTART@
+HOSTNAME = localhost
 BINARY = gnunet-service-scalarproduct-bob
 UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-scalarproduct-bob.sock
 @UNIXONLY@ PORT = 2118
 
+#ACCEPT_FROM = 127.0.0.1;
+#ACCEPT_FROM6 = ::1;
+UNIX_MATCH_UID = NO
+UNIX_MATCH_GID = YES
+#OPTIONS = -L DEBUG
\ No newline at end of file

Modified: gnunet/src/scalarproduct/test_scalarproduct.conf
===================================================================
--- gnunet/src/scalarproduct/test_scalarproduct.conf    2014-12-07 00:21:18 UTC 
(rev 34489)
+++ gnunet/src/scalarproduct/test_scalarproduct.conf    2014-12-07 00:42:31 UTC 
(rev 34490)
@@ -5,27 +5,5 @@
 [PATHS]
 GNUNET_TEST_HOME = /tmp/test-scalarproduct/
 
-[scalarproduct]
-AUTOSTART = YES
-BINARY = gnunet-service-scalarproduct
-#UNIXPATH = $SERVICEHOME/scalarproduct.sock
-UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-scalarproduct.sock
-HOSTNAME = localhost
-PORT = 13087
-#OPTIONS = -L DEBUG
-
-[set]
-AUTOSTART = YES
-PORT = 12106
-HOSTNAME = localhost
-BINARY = gnunet-service-set
-#ACCEPT_FROM = 127.0.0.1;
-#ACCEPT_FROM6 = ::1;
-#UNIXPATH = $SERVICEHOME/set.sock
-UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-set.sock
-#UNIX_MATCH_UID = YES
-#UNIX_MATCH_GID = YES
-#OPTIONS = -L DEBUG
-
 [testbed]
 OVERLAY_TOPOLOGY = CLIQUE
\ No newline at end of file

Modified: gnunet/src/scalarproduct/test_scalarproduct.sh
===================================================================
--- gnunet/src/scalarproduct/test_scalarproduct.sh      2014-12-07 00:21:18 UTC 
(rev 34489)
+++ gnunet/src/scalarproduct/test_scalarproduct.sh      2014-12-07 00:42:31 UTC 
(rev 34490)
@@ -3,6 +3,7 @@
 # payload for this test:
 INPUTALICE="-k CCC -e 'AB,10;RO,3;FL,3;LOL,-1;'"
 INPUTBOB="-k CCC -e 'BC,-20000;RO,1000;FL,100;LOL,24;'"
+EXPECTED="0CCC"
 
 # necessary to make the testing prefix deterministic, so we can access the 
config files
 PREFIX=/tmp/test-scalarproduct`date +%H%M%S`
@@ -16,30 +17,31 @@
 # interactive mode would terminate the test immediately
 # because the rest of the script is already in stdin,
 # thus redirecting stdin does not suffice)
-#GNUNET_LOG='scalarproduct;;;;DEBUG'
+GNUNET_LOG='scalarproduct*;;;;DEBUG'
 GNUNET_TESTING_PREFIX=$PREFIX ../testbed/gnunet-testbed-profiler -n -c 
test_scalarproduct.conf -p 2 &
 PID=$!
 # sleep 1 is too short on most systems, 2 works on most, 5 seems to be safe
+echo "Waiting for peers to start..."
 sleep 5
+echo "Running test..."
 
 # get bob's peer ID, necessary for alice
 PEERIDBOB=`gnunet-peerinfo -qs $CFGBOB`
 
 #GNUNET_LOG=';;;;DEBUG'
 gnunet-scalarproduct $CFGBOB $INPUTBOB &
-GNUNET_LOG=';;;;DEBUG'
+#GNUNET_LOG=';;;;DEBUG'
 RESULT=`gnunet-scalarproduct $CFGALICE $INPUTALICE -p $PEERIDBOB`
 
 # terminate the testbed
 kill $PID
 
-EXPECTED="0CCC"
 if [ "$RESULT" == "$EXPECTED" ]
 then
        echo "OK"
        exit 0
 else
-       echo "Result $RESULT NOTOK"
+       echo "Result $RESULT, expected $EXPECTED - NOTOK"
        exit 1
 fi
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]