Skip to content

Commit

Permalink
Don't skip a test that cannot be performed.
Browse files Browse the repository at this point in the history
Skipped tests result in errors during unittest.
  • Loading branch information
kristjanvalur committed Nov 30, 2021
1 parent 6943fe2 commit 0618635
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions test.c
Original file line number Diff line number Diff line change
Expand Up @@ -1685,9 +1685,9 @@ static void test_async(struct config config) {
assert(astest.ac == NULL);
test_cond(astest.disconnect_status == REDIS_OK);

test("Async connect timeout: ");
if (config.type == CONN_TCP || config.type == CONN_SSL)
{
if (config.type == CONN_TCP || config.type == CONN_SSL) {
/* timeout can only be simulated with network */
test("Async connect timeout: ");
config.tcp.host = "192.168.254.254"; /* blackhole ip */
config.tcp.timeout.tv_usec = 100000;
c = do_aconnect(config, ASTEST_CONN_TIMEOUT);
Expand All @@ -1702,10 +1702,9 @@ static void test_async(struct config config) {
*/
assert(astest.ac == NULL);
test_cond(astest.connect_status == REDIS_ERR);
config = defaultconfig;
} else
test_skipped();
config = defaultconfig;


/* Test a ping/pong after connection */
test("Async PING/PONG: ");
c = do_aconnect(config, ASTEST_PINGPONG);
Expand Down

0 comments on commit 0618635

Please sign in to comment.