summaryrefslogtreecommitdiffstats
path: root/extras/libmemif/test/main_test.c
diff options
context:
space:
mode:
authormsardara <msardara+fdio@cisco.com>2018-12-11 18:36:55 +0100
committerDamjan Marion <dmarion@me.com>2018-12-17 09:25:18 +0000
commit8f554b793c68fd5271334bf0e167dabc4c9ac73d (patch)
treea54ad410cdf3a839473551a59354956e3dc563cf /extras/libmemif/test/main_test.c
parentd6e9aecfd67ebfd012873eb24b72221f13e8f089 (diff)
Added CMake building system for libmemif
Added Cpack support for building libmemif DEB/RPM packages Fixed compilation errors in libmemif test and examples Change-Id: I59a237a4ca8eb08840857d5b0e666f3a8d74411d Signed-off-by: msardara <msardara+fdio@cisco.com>
Diffstat (limited to 'extras/libmemif/test/main_test.c')
-rw-r--r--extras/libmemif/test/main_test.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/extras/libmemif/test/main_test.c b/extras/libmemif/test/main_test.c
index a5e0e3dc860..e4697beb56f 100644
--- a/extras/libmemif/test/main_test.c
+++ b/extras/libmemif/test/main_test.c
@@ -66,7 +66,7 @@ START_TEST (test_init)
if ((err =
memif_init (control_fd_update, TEST_APP_NAME, NULL,
- NULL)) != MEMIF_ERR_SUCCESS)
+ NULL, NULL)) != MEMIF_ERR_SUCCESS)
ck_abort_msg ("err code: %u, err msg: %s", err, memif_strerror (err));
libmemif_main_t *lm = &libmemif_main;
@@ -86,7 +86,7 @@ START_TEST (test_init_epoll)
int err;
if ((err =
- memif_init (NULL, TEST_APP_NAME, NULL, NULL)) != MEMIF_ERR_SUCCESS)
+ memif_init (NULL, TEST_APP_NAME, NULL, NULL, NULL)) != MEMIF_ERR_SUCCESS)
ck_abort_msg ("err code: %u, err msg: %s", err, memif_strerror (err));
libmemif_main_t *lm = &libmemif_main;
@@ -113,7 +113,7 @@ START_TEST (test_create)
if ((err =
memif_init (control_fd_update, TEST_APP_NAME, NULL,
- NULL)) != MEMIF_ERR_SUCCESS)
+ NULL, NULL)) != MEMIF_ERR_SUCCESS)
ck_abort_msg ("err code: %u, err msg: %s", err, memif_strerror (err));
strncpy ((char *) args.interface_name, TEST_IF_NAME, strlen (TEST_IF_NAME));
@@ -147,8 +147,8 @@ START_TEST (test_create)
ck_assert_ptr_ne (c->on_disconnect, NULL);
ck_assert_ptr_ne (c->on_interrupt, NULL);
- ck_assert_str_eq (c->args.interface_name, args.interface_name);
- ck_assert_str_eq (c->args.socket_filename, SOCKET_FILENAME);
+ ck_assert_str_eq ((char *)c->args.interface_name, (char *)args.interface_name);
+ ck_assert_str_eq ((char *)c->args.socket_filename, SOCKET_FILENAME);
struct itimerspec timer;
timerfd_gettime (lm->timerfd, &timer);
@@ -177,7 +177,7 @@ START_TEST (test_create_master)
if ((err =
memif_init (control_fd_update, TEST_APP_NAME, NULL,
- NULL)) != MEMIF_ERR_SUCCESS)
+ NULL, NULL)) != MEMIF_ERR_SUCCESS)
ck_abort_msg ("err code: %u, err msg: %s", err, memif_strerror (err));
strncpy ((char *) args.interface_name, TEST_IF_NAME, strlen (TEST_IF_NAME));
@@ -211,8 +211,8 @@ START_TEST (test_create_master)
ck_assert_ptr_ne (c->on_disconnect, NULL);
ck_assert_ptr_ne (c->on_interrupt, NULL);
- ck_assert_str_eq (c->args.interface_name, args.interface_name);
- ck_assert_str_eq (c->args.socket_filename, SOCKET_FILENAME);
+ ck_assert_str_eq ((char *)c->args.interface_name, (char *)args.interface_name);
+ ck_assert_str_eq ((char *)c->args.socket_filename, SOCKET_FILENAME);
struct stat file_stat;
@@ -238,7 +238,7 @@ START_TEST (test_create_mult)
if ((err =
memif_init (control_fd_update, TEST_APP_NAME, NULL,
- NULL)) != MEMIF_ERR_SUCCESS)
+ NULL, NULL)) != MEMIF_ERR_SUCCESS)
ck_abort_msg ("err code: %u, err msg: %s", err, memif_strerror (err));
strncpy ((char *) args.interface_name, TEST_IF_NAME, strlen (TEST_IF_NAME));
@@ -296,10 +296,10 @@ START_TEST (test_create_mult)
ck_assert_ptr_ne (c1->on_disconnect, NULL);
ck_assert_ptr_ne (c1->on_interrupt, NULL);
- ck_assert_str_eq (c->args.interface_name, args.interface_name);
- ck_assert_str_eq (c->args.socket_filename, SOCKET_FILENAME);
- ck_assert_str_eq (c1->args.interface_name, args.interface_name);
- ck_assert_str_eq (c1->args.socket_filename, SOCKET_FILENAME);
+ ck_assert_str_eq ((char *)c->args.interface_name, (char *)args.interface_name);
+ ck_assert_str_eq ((char *)c->args.socket_filename, SOCKET_FILENAME);
+ ck_assert_str_eq ((char *)c1->args.interface_name, (char *)args.interface_name);
+ ck_assert_str_eq ((char *)c1->args.socket_filename, SOCKET_FILENAME);
struct itimerspec timer;
timerfd_gettime (lm->timerfd, &timer);
@@ -330,7 +330,7 @@ START_TEST (test_control_fd_handler)
if ((err =
memif_init (control_fd_update, TEST_APP_NAME, NULL,
- NULL)) != MEMIF_ERR_SUCCESS)
+ NULL, NULL)) != MEMIF_ERR_SUCCESS)
ck_abort_msg ("err code: %u, err msg: %s", err, memif_strerror (err));
strncpy ((char *) args.interface_name, TEST_IF_NAME, strlen (TEST_IF_NAME));
@@ -401,7 +401,7 @@ START_TEST (test_buffer_alloc)
if ((err =
memif_init (control_fd_update, TEST_APP_NAME, NULL,
- NULL)) != MEMIF_ERR_SUCCESS)
+ NULL, NULL)) != MEMIF_ERR_SUCCESS)
ck_abort_msg ("err code: %u, err msg: %s", err, memif_strerror (err));
strncpy ((char *) args.interface_name, TEST_IF_NAME, strlen (TEST_IF_NAME));
@@ -495,7 +495,7 @@ START_TEST (test_tx_burst)
if ((err =
memif_init (control_fd_update, TEST_APP_NAME, NULL,
- NULL)) != MEMIF_ERR_SUCCESS)
+ NULL, NULL)) != MEMIF_ERR_SUCCESS)
ck_abort_msg ("err code: %u, err msg: %s", err, memif_strerror (err));
strncpy ((char *) args.interface_name, TEST_IF_NAME, strlen (TEST_IF_NAME));
@@ -600,7 +600,7 @@ START_TEST (test_rx_burst)
if ((err =
memif_init (control_fd_update, TEST_APP_NAME, NULL,
- NULL)) != MEMIF_ERR_SUCCESS)
+ NULL, NULL)) != MEMIF_ERR_SUCCESS)
ck_abort_msg ("err code: %u, err msg: %s", err, memif_strerror (err));
strncpy ((char *) args.interface_name, TEST_IF_NAME, strlen (TEST_IF_NAME));
@@ -689,7 +689,7 @@ START_TEST (test_get_details)
if ((err =
memif_init (control_fd_update, TEST_APP_NAME, NULL,
- NULL)) != MEMIF_ERR_SUCCESS)
+ NULL, NULL)) != MEMIF_ERR_SUCCESS)
ck_abort_msg ("err code: %u, err msg: %s", err, memif_strerror (err));
strncpy ((char *) args.interface_name, TEST_IF_NAME, strlen (TEST_IF_NAME));
@@ -718,11 +718,11 @@ START_TEST (test_get_details)
if ((err = memif_get_details (conn, &md, buf, buflen)) != MEMIF_ERR_SUCCESS)
ck_abort_msg ("err code: %u, err msg: %s", err, memif_strerror (err));
- ck_assert_str_eq (md.if_name, c->args.interface_name);
- ck_assert_str_eq (md.remote_if_name, c->remote_if_name);
- ck_assert_str_eq (md.remote_inst_name, c->remote_name);
- ck_assert_str_eq (md.secret, c->args.secret);
- ck_assert_str_eq (md.socket_filename, c->args.socket_filename);
+ ck_assert_str_eq ((char *)md.if_name, (char *)c->args.interface_name);
+ ck_assert_str_eq ((char *)md.remote_if_name, (char *)c->remote_if_name);
+ ck_assert_str_eq ((char *)md.remote_inst_name, (char *)c->remote_name);
+ ck_assert_str_eq ((char *)md.secret, (char *)c->args.secret);
+ ck_assert_str_eq ((char *)md.socket_filename, (char *)c->args.socket_filename);
ck_assert_uint_eq (md.id, c->args.interface_id);
ck_assert_uint_ne (md.role, c->args.is_master);
@@ -766,7 +766,7 @@ START_TEST (test_init_regions_and_queues)
if ((err =
memif_init (control_fd_update, TEST_APP_NAME, NULL,
- NULL)) != MEMIF_ERR_SUCCESS)
+ NULL, NULL)) != MEMIF_ERR_SUCCESS)
ck_abort_msg ("err code: %u, err msg: %s", err, memif_strerror (err));
strncpy ((char *) args.interface_name, TEST_IF_NAME, strlen (TEST_IF_NAME));
@@ -790,7 +790,7 @@ START_TEST (test_init_regions_and_queues)
ck_assert_ptr_ne (c->tx_queues, NULL);
ck_assert_ptr_ne (c->rx_queues, NULL);
- ck_assert_ptr_ne (c->regions->shm, NULL);
+ ck_assert_ptr_ne (c->regions->addr, NULL);
ck_assert_ptr_ne (c->tx_queues->ring, NULL);
ck_assert_ptr_ne (c->rx_queues->ring, NULL);
@@ -821,7 +821,7 @@ START_TEST (test_connect1)
if ((err =
memif_init (control_fd_update, TEST_APP_NAME, NULL,
- NULL)) != MEMIF_ERR_SUCCESS)
+ NULL, NULL)) != MEMIF_ERR_SUCCESS)
ck_abort_msg ("err code: %u, err msg: %s", err, memif_strerror (err));
strncpy ((char *) args.interface_name, TEST_IF_NAME, strlen (TEST_IF_NAME));
@@ -867,7 +867,7 @@ START_TEST (test_disconnect_internal)
if ((err =
memif_init (control_fd_update, TEST_APP_NAME, NULL,
- NULL)) != MEMIF_ERR_SUCCESS)
+ NULL, NULL)) != MEMIF_ERR_SUCCESS)
ck_abort_msg ("err code: %u, err msg: %s", err, memif_strerror (err));
strncpy ((char *) args.interface_name, TEST_IF_NAME, strlen (TEST_IF_NAME));