@@ -27,6 +27,18 @@ static void test_single_status(void **state) {
27
27
1 , RESP_REPLY_OK , 1 );
28
28
}
29
29
30
+ static void test_empty_array (void * * state ) {
31
+ UNUSED (state );
32
+ test_resp_reader_common (NULL , STR_AND_SIZE ("*0\r\n" ),
33
+ 1 , RESP_REPLY_OK , 1 );
34
+ }
35
+
36
+ static void test_empty_bulk (void * * state ) {
37
+ UNUSED (state );
38
+ test_resp_reader_common (NULL , STR_AND_SIZE ("$0\r\n" ),
39
+ 1 , RESP_REPLY_OK , 1 );
40
+ }
41
+
30
42
static void test_single_int (void * * state ) {
31
43
UNUSED (state );
32
44
test_resp_reader_common (NULL , STR_AND_SIZE (":1\r\n" ),
@@ -118,8 +130,8 @@ static void test_reply_long_err_trimmed_by_report(void **state) {
118
130
static void test_mixture_and_fragmented (void * * state ) {
119
131
UNUSED (state );
120
132
RespRes res ;
121
- int expReplies = 6 ;
122
- char bulk [] = "*0\r\n* 3\r\n$2\r\n12\r\n$1\r\nA\r\n$3\r\nABC\r\n"
133
+ int expReplies = 5 ;
134
+ char bulk [] = "*3\r\n$2\r\n12\r\n$1\r\nA\r\n$3\r\nABC\r\n"
123
135
"+OK\r\n$5\r\nmylib\r\n+OK\r\n+OK\r\n" ;
124
136
RespReaderCtx ctx ;
125
137
@@ -141,6 +153,8 @@ static void test_mixture_and_fragmented(void **state) {
141
153
int group_test_resp_reader (void ) {
142
154
const struct CMUnitTest tests [] = {
143
155
cmocka_unit_test (test_single_status ),
156
+ cmocka_unit_test (test_empty_array ),
157
+ cmocka_unit_test (test_empty_bulk ),
144
158
cmocka_unit_test (test_single_int ),
145
159
cmocka_unit_test (test_array_single_bulk ),
146
160
cmocka_unit_test (test_array_3_bulks ),
0 commit comments