mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-10 04:50:37 -04:00
r19610@catbus: nickm | 2008-05-05 15:18:52 -0400
Switch strcmp() tests in test_evbuffer() to use memcmp instead. Previously they broke on my Linux box. svn:r779
This commit is contained in:
parent
803dc36ad8
commit
caa368e1cc
@ -980,13 +980,13 @@ test_evbuffer(void)
|
|||||||
evbuffer_validate(evb);
|
evbuffer_validate(evb);
|
||||||
|
|
||||||
if (EVBUFFER_LENGTH(evb) != 7 ||
|
if (EVBUFFER_LENGTH(evb) != 7 ||
|
||||||
strcmp((char*)EVBUFFER_DATA(evb), "hello/1") != 0)
|
memcmp((char*)EVBUFFER_DATA(evb), "hello/1", 1) != 0)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
evbuffer_drain(evb, strlen("hello/"));
|
evbuffer_drain(evb, strlen("hello/"));
|
||||||
evbuffer_validate(evb);
|
evbuffer_validate(evb);
|
||||||
if (EVBUFFER_LENGTH(evb) != 1 ||
|
if (EVBUFFER_LENGTH(evb) != 1 ||
|
||||||
strcmp((char*)EVBUFFER_DATA(evb), "1") != 0)
|
memcmp((char*)EVBUFFER_DATA(evb), "1", 1) != 0)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
evbuffer_add_printf(evb_two, "%s", "/hello");
|
evbuffer_add_printf(evb_two, "%s", "/hello");
|
||||||
@ -996,7 +996,7 @@ test_evbuffer(void)
|
|||||||
|
|
||||||
if (EVBUFFER_LENGTH(evb_two) != 0 ||
|
if (EVBUFFER_LENGTH(evb_two) != 0 ||
|
||||||
EVBUFFER_LENGTH(evb) != 7 ||
|
EVBUFFER_LENGTH(evb) != 7 ||
|
||||||
strcmp((char*)EVBUFFER_DATA(evb), "1/hello") != 0)
|
memcmp((char*)EVBUFFER_DATA(evb), "1/hello", 7) != 0)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
memset(buffer, 0, sizeof(buffer));
|
memset(buffer, 0, sizeof(buffer));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user