Skip to content
Snippets Groups Projects
Commit a6d32089 authored by Anatolii Kurotych's avatar Anatolii Kurotych
Browse files
parents 82585249 dd0cb36b
No related branches found
No related tags found
Loading
...@@ -5,10 +5,11 @@ ...@@ -5,10 +5,11 @@
static struct ev_loop *loop; static struct ev_loop *loop;
static struct moc_dap_server_clients { static struct moc_dap_clients_remote {
dap_server_client_t ** clients; dap_client_remote_t ** clients;
size_t count; size_t count;
} moc_dap_server_clients; } moc_dap_clients_remote;
static dap_server_t * _dap_server; static dap_server_t * _dap_server;
// false == test failed // false == test failed
...@@ -20,7 +21,7 @@ static void success_callback(dap_server_t* server) ...@@ -20,7 +21,7 @@ static void success_callback(dap_server_t* server)
pthread_mutex_lock(&_dap_server->mutex_on_hash); pthread_mutex_lock(&_dap_server->mutex_on_hash);
size_t cnt = HASH_COUNT(server->clients); size_t cnt = HASH_COUNT(server->clients);
pthread_mutex_unlock(&_dap_server->mutex_on_hash); pthread_mutex_unlock(&_dap_server->mutex_on_hash);
dap_assert(cnt == moc_dap_server_clients.count, "Dap server amount clients"); dap_assert(cnt == moc_dap_clients_remote.count, "Dap server amount clients");
is_callback_result_success = true; is_callback_result_success = true;
} }
...@@ -40,20 +41,20 @@ static void test_callback() { ...@@ -40,20 +41,20 @@ static void test_callback() {
void init_test_case() { void init_test_case() {
_dap_server = DAP_NEW_Z(dap_server_t); _dap_server = DAP_NEW_Z(dap_server_t);
moc_dap_server_clients.count = 111; moc_dap_clients_remote.count = 111;
moc_dap_server_clients.clients = calloc(moc_dap_server_clients.count, moc_dap_clients_remote.clients = calloc(moc_dap_clients_remote.count,
sizeof(dap_server_client_t *)); sizeof(dap_client_remote_t *));
for(size_t i = 0, j = 0; (i < moc_dap_server_clients.count) && (j = i + 1); i++) { for(size_t i = 0, j = 0; (i < moc_dap_clients_remote.count) && (j = i + 1); i++) {
moc_dap_server_clients.clients[i] = moc_dap_clients_remote.clients[i] =
dap_client_create(_dap_server, j, NULL); dap_client_remote_create(_dap_server, j, NULL);
} }
} }
void cleanup_test_case() { void cleanup_test_case() {
for(size_t i = 0; i < moc_dap_server_clients.count; i++) for(size_t i = 0; i < moc_dap_clients_remote.count; i++)
dap_client_remove(moc_dap_server_clients.clients[i], _dap_server); dap_client_remote_remove(moc_dap_clients_remote.clients[i], _dap_server);
ev_loop_destroy(loop); ev_loop_destroy(loop);
DAP_DELETE(moc_dap_server_clients.clients); DAP_DELETE(moc_dap_clients_remote.clients);
DAP_DELETE(_dap_server); DAP_DELETE(_dap_server);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment