summaryrefslogtreecommitdiff
path: root/test.c
diff options
context:
space:
mode:
authorPieter Noordhuis <pcnoordhuis@gmail.com>2011-04-21 15:01:58 +0200
committerPieter Noordhuis <pcnoordhuis@gmail.com>2011-04-21 15:04:42 +0200
commit6d207ea98ec6de086cb48c259fd3cac786f699ec (patch)
tree017f3a6379b0a37fb182a4fca6cde3ff294bd1b1 /test.c
parent58caf62a527173ffb861177037ace344db3caf19 (diff)
Create protocol reader when creating context
Diffstat (limited to 'test.c')
-rw-r--r--test.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/test.c b/test.c
index 1b75ee0..3f74144 100644
--- a/test.c
+++ b/test.c
@@ -268,7 +268,7 @@ static void test_blocking_connection(void) {
}
static void test_reply_reader(void) {
- void *reader;
+ redisReader *reader;
void *reply;
char *err;
int ret;
@@ -308,7 +308,7 @@ static void test_reply_reader(void) {
test("Works with NULL functions for reply: ");
reader = redisReplyReaderCreate();
- redisReplyReaderSetReplyObjectFunctions(reader,NULL);
+ reader->fn = NULL;
redisReplyReaderFeed(reader,(char*)"+OK\r\n",5);
ret = redisReplyReaderGetReply(reader,&reply);
test_cond(ret == REDIS_OK && reply == (void*)REDIS_REPLY_STATUS);
@@ -316,7 +316,7 @@ static void test_reply_reader(void) {
test("Works when a single newline (\\r\\n) covers two calls to feed: ");
reader = redisReplyReaderCreate();
- redisReplyReaderSetReplyObjectFunctions(reader,NULL);
+ reader->fn = NULL;
redisReplyReaderFeed(reader,(char*)"+OK\r",4);
ret = redisReplyReaderGetReply(reader,&reply);
assert(ret == REDIS_OK && reply == NULL);
@@ -327,7 +327,7 @@ static void test_reply_reader(void) {
test("Don't reset state after protocol error: ");
reader = redisReplyReaderCreate();
- redisReplyReaderSetReplyObjectFunctions(reader,NULL);
+ reader->fn = NULL;
redisReplyReaderFeed(reader,(char*)"x",1);
ret = redisReplyReaderGetReply(reader,&reply);
assert(ret == REDIS_ERR);