From: sangorrin Date: Tue, 1 Apr 2008 16:09:39 +0000 (+0000) Subject: tests for bwres basic X-Git-Url: https://rtime.felk.cvut.cz/gitweb/frescor/fna.git/commitdiff_plain/a0e1e04c6e0f3c38b6661ce1dc0cbed4c3485198 tests for bwres basic git-svn-id: http://www.frescor.org/private/svn/frescor/fna/trunk@1061 35b4ef3e-fd22-0410-ab77-dab3279adceb --- diff --git a/tests/tests_frescan/test_frescan_bwres_init.c b/tests/tests_frescan/test_frescan_bwres_init.c new file mode 100644 index 0000000..c3c455a --- /dev/null +++ b/tests/tests_frescan/test_frescan_bwres_init.c @@ -0,0 +1,39 @@ +#include // perror +#include // exit +#include // 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 index 0000000..7bb4e24 --- /dev/null +++ b/tests/tests_frescan/test_frescan_bwres_negotiate_in_master.c @@ -0,0 +1,44 @@ +#include // perror +#include // exit +#include // 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; +} + + diff --git a/tests/tests_frescan/test_frescan_init.c b/tests/tests_frescan/test_frescan_init.c index b98045a..56a0f94 100644 --- a/tests/tests_frescan/test_frescan_init.c +++ b/tests/tests_frescan/test_frescan_init.c @@ -2,7 +2,7 @@ #include // exit #include // sleep -#include +#include "frescan.h" #define ERROR(s) {perror (s); exit (-1);} diff --git a/tests/tests_frescan/test_frescan_send_basic.c b/tests/tests_frescan/test_frescan_send_basic.c index af69133..c9b1302 100644 --- a/tests/tests_frescan/test_frescan_send_basic.c +++ b/tests/tests_frescan/test_frescan_send_basic.c @@ -5,7 +5,7 @@ #include // exit #include // sleep -#include +#include "frescan.h" #define ERROR(s) {perror (s); exit (-1);} diff --git a/tests/tests_frescan/test_frescan_servers_send_basic.c b/tests/tests_frescan/test_frescan_servers_send_basic.c index 65f2af2..2e6fdb5 100644 --- a/tests/tests_frescan/test_frescan_servers_send_basic.c +++ b/tests/tests_frescan/test_frescan_servers_send_basic.c @@ -5,7 +5,7 @@ #include // exit #include // sleep -#include +#include "frescan.h" #include "frescan_servers.h" #define ERROR(s) {perror (s); exit (-1);}