diff options
author | Bjorn Svensson <bjorn.a.svensson@est.tech> | 2022-10-14 17:11:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-14 08:11:40 -0700 |
commit | 3b15a04b5939fc85f5e134ed09eb5c9e1584bef1 (patch) | |
tree | 742c529f0cdb34615ce7dd2a1085fcc34f955b6d /net.c | |
parent | c245df9fb92fdb51b8255dc90a60eaf03b9846a0 (diff) |
Fixup of PR734: Coverage of hiredis.c (#1124)
Improve coverage (#734)
* Remove duplicate tests
- double covered by:
"Can parse RESP3 doubles"
- bool covered via:
"Can parse RESP3 bool"
* Make (connect) timeout in test config general
* Set error string in Unix connect with invalid timeout
Restructure testcase since redisConnectWithTimeout() and
redisConnectUnixWithTimeout() now behaves similar.
* Use quiet flag in lcov/genhtml instead of piping to /dev/null
* Fixup of redisCommandArgv test case
* Update test case to match what it covers
Use new test case info text since the previous one seemed copy&pasted.
The sought coverage was the handling of the parent-chaining
for a double object, which the test case now focuses on.
Co-authored-by: Ariel <ashtul@gmail.com>
Diffstat (limited to 'net.c')
-rw-r--r-- | net.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -238,6 +238,7 @@ static int redisContextTimeoutMsec(redisContext *c, long *result) /* Only use timeout when not NULL. */ if (timeout != NULL) { if (timeout->tv_usec > 1000000 || timeout->tv_sec > __MAX_MSEC) { + __redisSetError(c, REDIS_ERR_IO, "Invalid timeout specified"); *result = msec; return REDIS_ERR; } @@ -435,7 +436,6 @@ static int _redisContextConnectTcp(redisContext *c, const char *addr, int port, } if (redisContextTimeoutMsec(c, &timeout_msec) != REDIS_OK) { - __redisSetError(c, REDIS_ERR_IO, "Invalid timeout specified"); goto error; } |