Commit Graph

61 Commits (7a8de1fe25dda6187d68ec6570a831394cb127d1)

Author SHA1 Message Date
Pieter Noordhuis 7a8de1fe25 Exit with a non-zero status when tests failed 2011-05-29 10:03:39 -07:00
Pieter Noordhuis 9723a4fc46 More control over host/port and unix path in test.c 2011-05-22 16:26:04 +02:00
Piotr Sikora 5793b999a9 Add "make check" target (useful for automated tests).
While there, add "-p" option to "hiredis-test", so that we could run
tests without interrupting Redis instance running on the default port.
2011-05-22 15:24:11 +02:00
Pieter Noordhuis 77540aa316 Add function to retrieve formatted reply
This is done by only truncating the read buffer once a full reply has
been read. The buffer is no longer truncated halfway through reading a
reply. In addition: pass offset/length of protocol and content via the
read tasks.
2011-05-05 17:01:34 +02:00
Pieter Noordhuis 19709152f2 Reflect rename in tests 2011-04-21 16:03:54 +02:00
Pieter Noordhuis 6d207ea98e Create protocol reader when creating context 2011-04-21 15:04:42 +02:00
Pieter Noordhuis fc790ebea6 State should not be reset after protocol error 2011-04-21 10:54:54 +02:00
Pieter Noordhuis 178024244d Use variable for throughput test iteration count 2011-04-19 23:03:29 +02:00
Pieter Noordhuis b4f85484ea Add pipelined throughput tests 2011-03-31 12:41:46 +02:00
Pieter Noordhuis 8e2c39200d Fix formatCommand to work with all empty interpolations 2011-03-06 11:38:07 +01:00
Pieter Noordhuis 663d6d1258 Properly reset state after protocol error in reply reader 2011-01-27 14:39:34 +01:00
Pieter Noordhuis fbe756d838 Avoid warnings with -Wstrict-prototypes 2011-01-27 12:50:55 +01:00
Pieter Noordhuis 43ab0f8018 Return error on socket timeout for a blocking context 2011-01-07 13:04:42 +01:00
Pieter Noordhuis 7684d556bd Add (nearly) full printf support by delegating to vsprintf 2010-12-02 16:20:55 +01:00
Pieter Noordhuis 257a9d40a9 Set error on unexpected nesting of multi bulks 2010-11-24 15:46:05 +01:00
Pieter Noordhuis b6b96f776e Make error messages consistent in casing 2010-11-22 10:37:14 +01:00
Pieter Noordhuis 537e64e946 Tests for behavior when connecting fails 2010-11-22 10:32:37 +01:00
Pieter Noordhuis 7c33f2666b Make test for formatting commands using a vector more robust 2010-11-22 10:06:43 +01:00
Pieter Noordhuis cb89a472b6 Fix formatting literal percent characters 2010-11-22 10:00:45 +01:00
Pieter Noordhuis 9d9b8e1c79 Correctly format commands with empty interpolated values 2010-11-22 09:55:54 +01:00
Pieter Noordhuis 650df0f982 Don't do a write(2) after QUIT
This causes non-deterministic error messages because sometimes the
socket will already be closed and sometimes it is yet to be closed.
2010-11-19 12:37:06 +01:00
Pieter Noordhuis 0b27639e09 Don't print when testing can continue 2010-11-15 20:17:31 +01:00
Pieter Noordhuis a5acb58948 Redis >=2.1 replies with OK on QUIT, so make the test conditional 2010-11-15 20:16:01 +01:00
Pieter Noordhuis 1c39483434 Include signal.h 2010-11-05 17:24:11 +01:00
Pieter Noordhuis 8ce0b3228d Finding \r\n without strstr is a little harder 2010-11-04 23:52:47 +01:00
Pieter Noordhuis 2e5e9a49fd Return the reply type when the reply object function set is NULL 2010-11-04 13:15:44 +01:00
Pieter Noordhuis bea6c4bde2 Check replies in throughput test 2010-11-03 11:43:01 +01:00
Pieter Noordhuis f25a5267cc Allow to connect using a unix socket from hiredis 2010-11-03 11:38:26 +01:00
Pieter Noordhuis ffa8666a64 Change error reporting to have an explicit type
When there is an I/O error, errno should be used to find out what is
wrong. In other cases, errno cannot be used. So, use an explicit type in
Hiredis to define the different error scenarios that can occur.
2010-11-02 16:36:38 +01:00
Pieter Noordhuis f463734e91 Remove reply object functions from connect functions 2010-10-31 12:53:57 +01:00
Pieter Noordhuis 298e9325d7 First step in decoupling reply callbacks from internals 2010-10-31 10:56:24 +01:00
Pieter Noordhuis a3a405bcba Format a command using an argument vector 2010-10-31 10:34:29 +01:00
Pieter Noordhuis bc5dcdbc85 Status replies should have type REDIS_REPLY_STATUS 2010-10-30 17:49:39 +02:00
Pieter Noordhuis 171b5a24d4 Drop dependency on sds.h for exposed API 2010-10-30 17:47:19 +02:00
Pieter Noordhuis 0f745d1ac0 Run pending callbacks with NULL reply on redisDisconnect() 2010-10-19 21:26:06 +02:00
Pieter Noordhuis bbe007a75a Test helper for creating a non-blocking connection 2010-10-19 21:24:30 +02:00
Pieter Noordhuis d4b4a9128e Revert e5dd32d8 that added the const qualifier for command callbacks 2010-10-19 21:24:30 +02:00
Pieter Noordhuis ba42ab2ef8 Revert privdata in context callbacks to being non-const 2010-10-19 14:19:51 +02:00
Pieter Noordhuis f9596db90b Test callback sequence in non-blocking context 2010-10-18 16:27:52 +02:00
Pieter Noordhuis e332a32b35 Change redisWriteBuffer to return OK on an empty buffer 2010-10-18 15:49:52 +02:00
Pieter Noordhuis a68cb9686e Tests for context callbacks in non-blocking mode 2010-10-18 15:39:56 +02:00
Pieter Noordhuis 634314f386 Rearrange tests to isolated functions 2010-10-18 14:51:03 +02:00
Pieter Noordhuis 7496458c68 The QUIT commands returns OK on master 2010-10-18 12:01:17 +02:00
Pieter Noordhuis 5c7b5fca4d Make error messages more consistent (e.g. no newline) 2010-10-06 21:23:03 +02:00
Pieter Noordhuis 1a5f111d52 c->error is no longer a redisReply object, but rather a plain C-string 2010-10-06 21:10:09 +02:00
Pieter Noordhuis 8345467b2e Free the replies after the tests are done 2010-09-25 15:33:46 +02:00
Pieter Noordhuis 9e417047ed Add function to free an allocated context 2010-09-25 15:33:27 +02:00
Pieter Noordhuis a7d7618141 Deprecate the error object for I/O and protocol errors
Rather, use the return value REDIS_OK and REDIS_ERR to designate if
calling a function has a successful outcome. When there was an error in
performing the call the error field will be set inside the reader or the
context.
2010-09-25 15:09:13 +02:00
Pieter Noordhuis d156550886 Rename fd to the more appropriate c 2010-09-24 18:48:07 +02:00
Pieter Noordhuis 817d26b81d Use context variable to keep state for a connection
The context supports both blocking and non-blocking connections. All
read and write events are not handled by hiredis, but hiredis exposes an
API for buffered reading/writing to Redis.
2010-09-24 18:42:22 +02:00