diff options
author | Andrew Bartlett <abartlet@samba.org> | 2011-05-03 10:40:33 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-05-03 07:37:07 +0200 |
commit | cdd802af8319e0b0744d8e727cef75526269ece2 (patch) | |
tree | deb3c73bc35357a7fe272d40ce1568274316f8cf /source4/lib/messaging/tests | |
parent | 7261a9b9f76d19e6a2179a48e903e2fee4ee64a1 (diff) | |
download | samba-cdd802af8319e0b0744d8e727cef75526269ece2.tar.gz samba-cdd802af8319e0b0744d8e727cef75526269ece2.tar.bz2 samba-cdd802af8319e0b0744d8e727cef75526269ece2.zip |
s4-messaging Rename messaging -> imessaging
This avoid symbol and structure conflicts between Samba3 and Samba4,
and chooses a less generic name.
Andrew Bartlett
Diffstat (limited to 'source4/lib/messaging/tests')
-rw-r--r-- | source4/lib/messaging/tests/irpc.c | 10 | ||||
-rw-r--r-- | source4/lib/messaging/tests/messaging.c | 34 |
2 files changed, 22 insertions, 22 deletions
diff --git a/source4/lib/messaging/tests/irpc.c b/source4/lib/messaging/tests/irpc.c index 4d0b6b4378..cfa2bcb91e 100644 --- a/source4/lib/messaging/tests/irpc.c +++ b/source4/lib/messaging/tests/irpc.c @@ -34,7 +34,7 @@ static bool test_debug; struct irpc_test_data { - struct messaging_context *msg_ctx1, *msg_ctx2; + struct imessaging_context *msg_ctx1, *msg_ctx2; struct tevent_context *ev; }; @@ -246,15 +246,15 @@ static bool irpc_setup(struct torture_context *tctx, void **_data) data->ev = tctx->ev; torture_assert(tctx, data->msg_ctx1 = - messaging_init(tctx, - lpcfg_messaging_path(tctx, tctx->lp_ctx), + imessaging_init(tctx, + lpcfg_imessaging_path(tctx, tctx->lp_ctx), cluster_id(0, MSG_ID1), data->ev), "Failed to init first messaging context"); torture_assert(tctx, data->msg_ctx2 = - messaging_init(tctx, - lpcfg_messaging_path(tctx, tctx->lp_ctx), + imessaging_init(tctx, + lpcfg_imessaging_path(tctx, tctx->lp_ctx), cluster_id(0, MSG_ID2), data->ev), "Failed to init second messaging context"); diff --git a/source4/lib/messaging/tests/messaging.c b/source4/lib/messaging/tests/messaging.c index 82fdf2f73e..38c34fc52e 100644 --- a/source4/lib/messaging/tests/messaging.c +++ b/source4/lib/messaging/tests/messaging.c @@ -29,24 +29,24 @@ static uint32_t msg_pong; -static void ping_message(struct messaging_context *msg, void *private_data, +static void ping_message(struct imessaging_context *msg, void *private_data, uint32_t msg_type, struct server_id src, DATA_BLOB *data) { NTSTATUS status; - status = messaging_send(msg, src, msg_pong, data); + status = imessaging_send(msg, src, msg_pong, data); if (!NT_STATUS_IS_OK(status)) { printf("pong failed - %s\n", nt_errstr(status)); } } -static void pong_message(struct messaging_context *msg, void *private_data, +static void pong_message(struct imessaging_context *msg, void *private_data, uint32_t msg_type, struct server_id src, DATA_BLOB *data) { int *count = (int *)private_data; (*count)++; } -static void exit_message(struct messaging_context *msg, void *private_data, +static void exit_message(struct imessaging_context *msg, void *private_data, uint32_t msg_type, struct server_id src, DATA_BLOB *data) { talloc_free(private_data); @@ -59,8 +59,8 @@ static void exit_message(struct messaging_context *msg, void *private_data, static bool test_ping_speed(struct torture_context *tctx) { struct tevent_context *ev; - struct messaging_context *msg_client_ctx; - struct messaging_context *msg_server_ctx; + struct imessaging_context *msg_client_ctx; + struct imessaging_context *msg_server_ctx; int ping_count = 0; int pong_count = 0; struct timeval tv; @@ -71,24 +71,24 @@ static bool test_ping_speed(struct torture_context *tctx) ev = tctx->ev; - msg_server_ctx = messaging_init(tctx, - lpcfg_messaging_path(tctx, tctx->lp_ctx), cluster_id(0, 1), + msg_server_ctx = imessaging_init(tctx, + lpcfg_imessaging_path(tctx, tctx->lp_ctx), cluster_id(0, 1), ev); torture_assert(tctx, msg_server_ctx != NULL, "Failed to init ping messaging context"); - messaging_register_tmp(msg_server_ctx, NULL, ping_message, &msg_ping); - messaging_register_tmp(msg_server_ctx, tctx, exit_message, &msg_exit); + imessaging_register_tmp(msg_server_ctx, NULL, ping_message, &msg_ping); + imessaging_register_tmp(msg_server_ctx, tctx, exit_message, &msg_exit); - msg_client_ctx = messaging_init(tctx, - lpcfg_messaging_path(tctx, tctx->lp_ctx), + msg_client_ctx = imessaging_init(tctx, + lpcfg_imessaging_path(tctx, tctx->lp_ctx), cluster_id(0, 2), ev); torture_assert(tctx, msg_client_ctx != NULL, - "msg_client_ctx messaging_init() failed"); + "msg_client_ctx imessaging_init() failed"); - messaging_register_tmp(msg_client_ctx, &pong_count, pong_message, &msg_pong); + imessaging_register_tmp(msg_client_ctx, &pong_count, pong_message, &msg_pong); tv = timeval_current(); @@ -100,8 +100,8 @@ static bool test_ping_speed(struct torture_context *tctx) data.data = discard_const_p(uint8_t, "testing"); data.length = strlen((const char *)data.data); - status1 = messaging_send(msg_client_ctx, cluster_id(0, 1), msg_ping, &data); - status2 = messaging_send(msg_client_ctx, cluster_id(0, 1), msg_ping, NULL); + status1 = imessaging_send(msg_client_ctx, cluster_id(0, 1), msg_ping, &data); + status2 = imessaging_send(msg_client_ctx, cluster_id(0, 1), msg_ping, NULL); torture_assert_ntstatus_ok(tctx, status1, "msg1 failed"); ping_count++; @@ -121,7 +121,7 @@ static bool test_ping_speed(struct torture_context *tctx) } torture_comment(tctx, "sending exit\n"); - messaging_send(msg_client_ctx, cluster_id(0, 1), msg_exit, NULL); + imessaging_send(msg_client_ctx, cluster_id(0, 1), msg_exit, NULL); torture_assert_int_equal(tctx, ping_count, pong_count, "ping test failed"); |