diff options
author | Pieter Noordhuis <pcnoordhuis@gmail.com> | 2012-08-27 23:47:38 -0700 |
---|---|---|
committer | Pieter Noordhuis <pcnoordhuis@gmail.com> | 2012-08-27 23:47:42 -0700 |
commit | 05d0608ab9311f48be9b95495e0ea9d7eee5f148 (patch) | |
tree | 8a0c6f434c28e5375674ef825a71ee40685c3494 /test.c | |
parent | f7f022e4e0aa36b34b7c72a5073c779d7ef8866f (diff) |
Test new maximum depth of multi-bulk replies
Diffstat (limited to 'test.c')
-rw-r--r-- | test.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -204,6 +204,7 @@ static void test_reply_reader(void) { redisReader *reader; void *reply; int ret; + int i; test("Error handling in reply parser: "); reader = redisReaderCreate(); @@ -225,12 +226,13 @@ static void test_reply_reader(void) { strcasecmp(reader->errstr,"Protocol error, got \"@\" as reply type byte") == 0); redisReaderFree(reader); - test("Set error on nested multi bulks with depth > 2: "); + test("Set error on nested multi bulks with depth > 7: "); reader = redisReaderCreate(); - redisReaderFeed(reader,(char*)"*1\r\n",4); - redisReaderFeed(reader,(char*)"*1\r\n",4); - redisReaderFeed(reader,(char*)"*1\r\n",4); - redisReaderFeed(reader,(char*)"*1\r\n",4); + + for (i = 0; i < 9; i++) { + redisReaderFeed(reader,(char*)"*1\r\n",4); + } + ret = redisReaderGetReply(reader,NULL); test_cond(ret == REDIS_ERR && strncasecmp(reader->errstr,"No support for",14) == 0); |