Commit 3f503b6f authored by michael-grunder's avatar michael-grunder
Browse files

Add a test for the TCP_USER_TIMEOUT option.

parent af144563
...@@ -409,10 +409,19 @@ static void test_tcp_options(struct config cfg) { ...@@ -409,10 +409,19 @@ static void test_tcp_options(struct config cfg) {
redisContext *c; redisContext *c;
c = do_connect(cfg); c = do_connect(cfg);
test("We can enable TCP_KEEPALIVE: "); test("We can enable TCP_KEEPALIVE: ");
test_cond(redisEnableKeepAlive(c) == REDIS_OK); test_cond(redisEnableKeepAlive(c) == REDIS_OK);
disconnect(c, 0); #ifdef TCP_USER_TIMEOUT
test("We can set TCP_USER_TIMEOUT: ");
test_cond(redisSetTcpUserTimeout(c, 100) == REDIS_OK);
#else
test("Setting TCP_USER_TIMEOUT errors when unsupported: ");
test_cond(redisSetTcpUserTimeout(c, 100) == REDIS_ERR && c->err == REDIS_ERR_IO);
#endif
redisFree(c);
} }
static void test_reply_reader(void) { static void test_reply_reader(void) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment