diff options
| author | Ted Ross <tross@apache.org> | 2013-02-28 01:05:17 +0000 |
|---|---|---|
| committer | Ted Ross <tross@apache.org> | 2013-02-28 01:05:17 +0000 |
| commit | 2aa1ce3eab71768e425d4c5b08ce1ee50a506ce6 (patch) | |
| tree | 7486799df7b79f29d85a10114f31a888d3d13c40 /qpid/extras/dispatch/tests | |
| parent | 8ba26143ef15381faefada81906b64f83cb09403 (diff) | |
| download | qpid-python-2aa1ce3eab71768e425d4c5b08ce1ee50a506ce6.tar.gz | |
NO-JIRA - Added non-blocking server-start for when the application want to keep its own
main thread.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1451069 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/extras/dispatch/tests')
| -rw-r--r-- | qpid/extras/dispatch/tests/server_test.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/qpid/extras/dispatch/tests/server_test.c b/qpid/extras/dispatch/tests/server_test.c index adeab62af9..74b4f9f2ae 100644 --- a/qpid/extras/dispatch/tests/server_test.c +++ b/qpid/extras/dispatch/tests/server_test.c @@ -47,7 +47,7 @@ static dx_user_fd_t *ufd_write; static dx_user_fd_t *ufd_read; -static void thread_start(void *context, int thread_id) +static void thread_start_handler(void *context, int thread_id) { sys_mutex_lock(test_lock); if (context != expected_context && !stored_error[0]) @@ -134,7 +134,7 @@ static char* test_start_handler(void *context) threads_seen[i] = 0; dx_server_set_conn_handler(conn_handler); - dx_server_set_start_handler(thread_start, expected_context); + dx_server_set_start_handler(thread_start_handler, expected_context); dx_server_run(); dx_server_finalize(); @@ -147,6 +147,18 @@ static char* test_start_handler(void *context) } +static char *test_server_start(void *context) +{ + dx_server_initialize(THREAD_COUNT); + dx_server_set_conn_handler(conn_handler); + dx_server_start(); + dx_server_stop(); + dx_server_finalize(); + + return 0; +} + + static char* test_user_fd(void *context) { int res; @@ -186,6 +198,7 @@ int server_tests(void) test_lock = sys_mutex(); dx_log_set_mask(LOG_NONE); + TEST_CASE(test_server_start, 0); TEST_CASE(test_start_handler, 0); TEST_CASE(test_user_fd, 0); |
