Skip to content

Commit

Permalink
To fix unit test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
sadhyama committed Jan 19, 2024
1 parent 8f608c4 commit 0957b0a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "ParodusInternal.h"
#include "heartBeat.h"
#include "close_retry.h"
#include "upstream.h"
/*----------------------------------------------------------------------------*/
/* Macros */
/*----------------------------------------------------------------------------*/
Expand Down
6 changes: 1 addition & 5 deletions tests/test_conn_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ void clear_metadata()

void free_server_list (server_list_t *server_list)
{
UNUSED(server_list);
return;
}

Expand Down Expand Up @@ -344,7 +345,6 @@ void test_createSocketConnection()
expect_function_call(nopoll_log_set_handler);
will_return(createNopollConnection, nopoll_true);
expect_function_call(createNopollConnection);
expect_function_call(packMetaData);

expect_function_calls(StartThread, 5);
expect_function_call(initKeypress);
Expand Down Expand Up @@ -381,7 +381,6 @@ void test_createSocketConnection1()
expect_function_call(nopoll_log_set_handler);
will_return(createNopollConnection, nopoll_true);
expect_function_call(createNopollConnection);
expect_function_call(packMetaData);

expect_function_calls(StartThread, 5);
will_return(nopoll_loop_wait, 1);
Expand Down Expand Up @@ -429,7 +428,6 @@ void test_PingMissIntervalTime()
expect_function_call(nopoll_log_set_handler);
will_return(createNopollConnection, nopoll_true);
expect_function_call(createNopollConnection);
expect_function_call(packMetaData);

expect_function_calls(StartThread, 5);
//Increment ping interval time to 1 sec for each nopoll_loop_wait call
Expand Down Expand Up @@ -470,7 +468,6 @@ void err_createSocketConnection()
expect_function_call(nopoll_log_set_handler);
will_return(createNopollConnection, nopoll_true);
expect_function_call(createNopollConnection);
expect_function_call(packMetaData);

expect_function_calls(StartThread, 5);
will_return(nopoll_loop_wait, 1);
Expand Down Expand Up @@ -508,7 +505,6 @@ void test_createSocketConnection_cloud_disconn()
expect_function_call(nopoll_log_set_handler);
will_return(createNopollConnection, nopoll_true);
expect_function_call(createNopollConnection);
expect_function_call(packMetaData);

expect_function_calls(StartThread, 5);
will_return(nopoll_loop_wait, 1);
Expand Down
5 changes: 5 additions & 0 deletions tests/test_connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ int readFromFile(const char *file_name, char **data)
return 1;
}

void packMetaData()
{
return;
}

noPollConn * nopoll_conn_new_opts (noPollCtx * ctx, noPollConnOpts * opts, const char * host_ip, const char * host_port, const char * host_name,const char * get_url,const char * protocols, const char * origin)
{
UNUSED(host_port); UNUSED(host_name); UNUSED(get_url); UNUSED(protocols);
Expand Down

0 comments on commit 0957b0a

Please sign in to comment.