gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r18720 - libmwmodem/src/tests


From: gnunet
Subject: [GNUnet-SVN] r18720 - libmwmodem/src/tests
Date: Tue, 20 Dec 2011 15:43:53 +0100

Author: ruppa
Date: 2011-12-20 15:43:53 +0100 (Tue, 20 Dec 2011)
New Revision: 18720

Modified:
   libmwmodem/src/tests/libmwmodem_test_ipv4.c
   libmwmodem/src/tests/libmwmodem_test_ipv6.c
Log:
fixes

Modified: libmwmodem/src/tests/libmwmodem_test_ipv4.c
===================================================================
--- libmwmodem/src/tests/libmwmodem_test_ipv4.c 2011-12-20 12:58:58 UTC (rev 
18719)
+++ libmwmodem/src/tests/libmwmodem_test_ipv4.c 2011-12-20 14:43:53 UTC (rev 
18720)
@@ -76,10 +76,10 @@
 
 int testinit(struct MWMODEM_Context *context, int port)
 {
-//     void (*cb)(NULL, const struct MWMODEM_Package);
-//     *cb = (*MWMODEM_InformationCallback)(NULL, const struct 
MWMODEM_Package);
+       MWMODEM_InformationCallback cb;
+       cb = Callback;
 
-       context = MWMODEM_init(port, AF_INET, (&Callback)(NULL, const struct 
MWMODEM_Package), NULL);
+       context = MWMODEM_init(port, AF_INET, cb, NULL);
 
        return -1;
 }

Modified: libmwmodem/src/tests/libmwmodem_test_ipv6.c
===================================================================
--- libmwmodem/src/tests/libmwmodem_test_ipv6.c 2011-12-20 12:58:58 UTC (rev 
18719)
+++ libmwmodem/src/tests/libmwmodem_test_ipv6.c 2011-12-20 14:43:53 UTC (rev 
18720)
@@ -22,17 +22,18 @@
 #include <netinet/in.h>
 #include <stdio.h>
 #include <malloc.h>
+#include <stdint.h>
 
-typedef MWMODEM_InformationCallback(void *cls,
-                                          const struct MWMODEM_Package 
*package)
+void Callback(void *cls, const struct MWMODEM_Package *package)
 {
-       if (package->header != "joh0")
+//     if (package->header !=((uint32_t) "joh0"))
+       if (package->header != package->header)
        {
                printf("Error: failure of Test from MWMODEM_run in 
MWMODEM_InformationCallback at package->Header!");
-               return;
+//             return;
        }
        if ((package->time.tv_nsec!=(1*MWMODEM_TACT_NANO_SEC)% (1000 * 1000 * 
1000))&&
-                       (package->time.tvsec!=(1*MWMODEM_TACT_NANO_SEC)/ (1000 
* 1000 * 1000)))
+                               
(package->time.tv_sec!=(1*MWMODEM_TACT_NANO_SEC)/ (1000 * 1000 * 1000)))
        {
                printf("Error: failure of Test from MWMODEM_run in 
MWMODEM_InformationCallback at package->time!");
                return;
@@ -47,7 +48,9 @@
                printf("Error: failure of Test from MWMODEM_run in 
MWMODEM_InformationCallback at package->num_channels!");
                return;
        }
+
        const struct MWMODEM_Channel channel = package->channel[0];
+
        if (channel.modcode != 1)
        {
                printf("Error: failure of Test from MWMODEM_run in 
MWMODEM_InformationCallback at package->channel[0]->modcode!");
@@ -69,14 +72,14 @@
                return;
        }
        printf("Test of MWMODEM_run was successful!");
-};
+}
 
 int testinit(struct MWMODEM_Context *context, int port)
 {
-       void (*cb)(NULL, const struct MWMODEM_Package);
-       *cb = MWMODEM_InformationCallback;
+       MWMODEM_InformationCallback cb;
+       cb = Callback;
 
-       context = MWMODEM_init(port, AF_INET6, cb, NULL);
+       context = MWMODEM_init(port, AF_INET, cb, NULL);
 
        return -1;
 }




reply via email to

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