]> rtime.felk.cvut.cz Git - frescor/fna.git/commitdiff
tests for bwres basic
authorsangorrin <sangorrin@35b4ef3e-fd22-0410-ab77-dab3279adceb>
Tue, 1 Apr 2008 16:09:39 +0000 (16:09 +0000)
committersangorrin <sangorrin@35b4ef3e-fd22-0410-ab77-dab3279adceb>
Tue, 1 Apr 2008 16:09:39 +0000 (16:09 +0000)
git-svn-id: http://www.frescor.org/private/svn/frescor/fna/trunk@1061 35b4ef3e-fd22-0410-ab77-dab3279adceb

tests/tests_frescan/test_frescan_bwres_init.c [new file with mode: 0644]
tests/tests_frescan/test_frescan_bwres_negotiate_in_master.c [new file with mode: 0644]
tests/tests_frescan/test_frescan_init.c
tests/tests_frescan/test_frescan_send_basic.c
tests/tests_frescan/test_frescan_servers_send_basic.c

diff --git a/tests/tests_frescan/test_frescan_bwres_init.c b/tests/tests_frescan/test_frescan_bwres_init.c
new file mode 100644 (file)
index 0000000..c3c455a
--- /dev/null
@@ -0,0 +1,39 @@
+#include <stdio.h>  // perror
+#include <stdlib.h> // exit
+#include <unistd.h>   // sleep
+
+#include "frescan.h"
+#include "frescan_bandwidth_reservation.h"
+
+#define ERROR(s) {perror (s); exit (-1);}
+
+#define NETWORK 0
+#define LOCAL_NODE 0
+
+int main ()
+{
+        int ret;
+        frescan_init_params_t init_params;
+
+        init_params.net = NETWORK;
+        init_params.node = LOCAL_NODE;
+        init_params.tx_fp_max_prio = 10;
+        init_params.rx_num_of_channels = 5;
+        init_params.rx_channel_max_prio = NULL;
+
+        printf("Initializing FRESCAN\n");
+        ret = frescan_init(&init_params);
+        if (ret != 0) ERROR ("could not init FRESCAN");
+
+        printf("Initializing BWRES\n");
+        ret = frescan_bwres_init(NETWORK);
+        if (ret != 0) ERROR ("could not init BWRES");
+
+        while (1) {
+                sleep(1);
+        }
+
+        return 0;
+}
+
+
diff --git a/tests/tests_frescan/test_frescan_bwres_negotiate_in_master.c b/tests/tests_frescan/test_frescan_bwres_negotiate_in_master.c
new file mode 100644 (file)
index 0000000..7bb4e24
--- /dev/null
@@ -0,0 +1,44 @@
+#include <stdio.h>  // perror
+#include <stdlib.h> // exit
+#include <unistd.h>   // sleep
+
+#include "frescan.h"
+#include "frescan_bandwidth_reservation.h"
+
+#define ERROR(s) {perror (s); exit (-1);}
+
+#define NETWORK 0
+#define LOCAL_NODE 0
+
+int main ()
+{
+        int ret;
+        frescan_init_params_t init_params;
+        frescan_ss_t ss;
+        frescan_contract_t contract;
+
+        init_params.net = NETWORK;
+        init_params.node = LOCAL_NODE;
+        init_params.tx_fp_max_prio = 10;
+        init_params.rx_num_of_channels = 5;
+        init_params.rx_channel_max_prio = NULL;
+
+        printf("Initializing FRESCAN\n");
+        ret = frescan_init(&init_params);
+        if (ret != 0) ERROR ("could not init FRESCAN");
+
+        printf("Initializing BWRES\n");
+        ret = frescan_bwres_init(NETWORK);
+        if (ret != 0) ERROR ("could not init BWRES");
+
+        ret = frescan_bwres_negotiate(NETWORK, &contract, &ss);
+        if (ret != 0) ERROR ("could not negotiate succesfully");
+
+        while (1) {
+                sleep(1);
+        }
+
+        return 0;
+}
+
+
index b98045a2d96434ed06e8e38eaf0eaef75852c594..56a0f94397d9ed2606cdbec8a2bc8124b01adeaa 100644 (file)
@@ -2,7 +2,7 @@
 #include <stdlib.h> // exit
 #include <unistd.h>   // sleep
 
-#include <drivers/frescan.h>
+#include "frescan.h"
 
 #define ERROR(s) {perror (s); exit (-1);}
 
index af69133965cdf34994dd840bda3c336615ad13eb..c9b1302e3c9acbdbc8f9c991dfa5767371af7aff 100644 (file)
@@ -5,7 +5,7 @@
 #include <stdlib.h> // exit
 #include <unistd.h>   // sleep
 
-#include <drivers/frescan.h>
+#include "frescan.h"
 
 #define ERROR(s) {perror (s); exit (-1);}
 
index 65f2af20f88ff6ab145d6c69444e26322809ab92..2e6fdb55e56421f177f7149c72d1947529b23a26 100644 (file)
@@ -5,7 +5,7 @@
 #include <stdlib.h> // exit
 #include <unistd.h>   // sleep
 
-#include <drivers/frescan.h>
+#include "frescan.h"
 #include "frescan_servers.h"
 
 #define ERROR(s) {perror (s); exit (-1);}