Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
hiredis
Commits
6e98f373
Commit
6e98f373
authored
Jul 12, 2011
by
Pieter Noordhuis
Browse files
Debugging output in tests
parent
9adb3aed
Changes
1
Show whitespace changes
Inline
Side-by-side
test/parser.c
View file @
6e98f373
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
#include <string.h>
#include <string.h>
#include <assert.h>
#include <assert.h>
#include "parser.h"
#include "parser.h"
#include "sds.h"
#define assert_equal_size_t(a,b) do { \
#define assert_equal_size_t(a,b) do { \
__typeof__ (a) a_ = (a); \
__typeof__ (a) a_ = (a); \
...
@@ -137,6 +138,17 @@ void test_char_by_char(redis_protocol_t *_unused, const char *buf, size_t len) {
...
@@ -137,6 +138,17 @@ void test_char_by_char(redis_protocol_t *_unused, const char *buf, size_t len) {
for
(
j
=
i
+
1
;
j
<
(
len
-
1
);
j
++
)
{
for
(
j
=
i
+
1
;
j
<
(
len
-
1
);
j
++
)
{
RESET_PARSER_T
(
p
);
RESET_PARSER_T
(
p
);
#ifdef DEBUG
sds
debug
=
sdsempty
();
debug
=
sdscatrepr
(
debug
,
buf
,
i
);
debug
=
sdscatprintf
(
debug
,
" + "
);
debug
=
sdscatrepr
(
debug
,
buf
+
i
,
j
-
i
);
debug
=
sdscatprintf
(
debug
,
" + "
);
debug
=
sdscatrepr
(
debug
,
buf
+
j
,
len
-
j
);
fprintf
(
stderr
,
"%s
\n
"
,
debug
);
sdsfree
(
debug
);
#endif
/* Slice 1 */
/* Slice 1 */
assert_equal_size_t
(
redis_parser_execute
(
p
,
&
res
,
buf
,
i
),
i
);
assert_equal_size_t
(
redis_parser_execute
(
p
,
&
res
,
buf
,
i
),
i
);
assert
(
NULL
==
res
);
/* no result */
assert
(
NULL
==
res
);
/* no result */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment