From bc5dcdbc85775ffa5213ae0678ca452ad4c8683f Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Sat, 30 Oct 2010 17:49:39 +0200 Subject: Status replies should have type REDIS_REPLY_STATUS --- hiredis.c | 4 ---- test.c | 6 +++--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/hiredis.c b/hiredis.c index f1ade93..c2f58fb 100644 --- a/hiredis.c +++ b/hiredis.c @@ -118,10 +118,6 @@ static void *createStringObject(redisReadTask *task, char *str, size_t len) { r->str = value; r->len = len; - /* for API compat, set STATUS to STRING */ - if (task->type == REDIS_REPLY_STATUS) - r->type = REDIS_REPLY_STRING; - if (task->parent) { redisReply *parent = task->parent; assert(parent->type == REDIS_REPLY_ARRAY); diff --git a/test.c b/test.c index 5bddf04..cc15ba5 100644 --- a/test.c +++ b/test.c @@ -44,7 +44,7 @@ static void test_blocking_connection() { __connect(&c); /* reconnect */ test("Is able to deliver commands: "); reply = redisCommand(c,"PING"); - test_cond(reply->type == REDIS_REPLY_STRING && + test_cond(reply->type == REDIS_REPLY_STATUS && strcasecmp(reply->str,"pong") == 0) freeReplyObject(reply); @@ -65,7 +65,7 @@ static void test_blocking_connection() { test("Is a able to send commands verbatim: "); reply = redisCommand(c,"SET foo bar"); - test_cond (reply->type == REDIS_REPLY_STRING && + test_cond (reply->type == REDIS_REPLY_STATUS && strcasecmp(reply->str,"ok") == 0) freeReplyObject(reply); @@ -122,7 +122,7 @@ static void test_blocking_connection() { reply->element[0]->elements == 2 && !memcmp(reply->element[0]->element[0]->str,"bar",3) && !memcmp(reply->element[0]->element[1]->str,"foo",3) && - reply->element[1]->type == REDIS_REPLY_STRING && + reply->element[1]->type == REDIS_REPLY_STATUS && strcasecmp(reply->element[1]->str,"pong") == 0); freeReplyObject(reply); } -- cgit v1.2.3