Fixed test error
This commit is contained in:
parent
b87eb8987e
commit
afbade9e79
|
@ -49,7 +49,7 @@ typedef struct {
|
||||||
typedef struct {
|
typedef struct {
|
||||||
accumulator *acc;
|
accumulator *acc;
|
||||||
scripted_data_feed *df;
|
scripted_data_feed *df;
|
||||||
int valid, invalid, ping_recv;
|
int valid, invalid;
|
||||||
size_t data_source_length;
|
size_t data_source_length;
|
||||||
} my_user_data;
|
} my_user_data;
|
||||||
|
|
||||||
|
@ -122,14 +122,6 @@ static void on_invalid_ctrl_recv_callback(spdylay_session *session,
|
||||||
++ud->invalid;
|
++ud->invalid;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void on_ping_recv_callback(spdylay_session *session,
|
|
||||||
const struct timespec *rtt,
|
|
||||||
void *user_data)
|
|
||||||
{
|
|
||||||
my_user_data *ud = (my_user_data*)user_data;
|
|
||||||
++ud->ping_recv;
|
|
||||||
}
|
|
||||||
|
|
||||||
static ssize_t fixed_length_data_source_read_callback
|
static ssize_t fixed_length_data_source_read_callback
|
||||||
(spdylay_session *session, uint8_t *buf, size_t len, int *eof,
|
(spdylay_session *session, uint8_t *buf, size_t len, int *eof,
|
||||||
spdylay_data_source *source, void *user_data)
|
spdylay_data_source *source, void *user_data)
|
||||||
|
@ -599,8 +591,7 @@ void test_spdylay_session_on_ping_received()
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
on_ctrl_recv_callback,
|
on_ctrl_recv_callback,
|
||||||
on_invalid_ctrl_recv_callback,
|
on_invalid_ctrl_recv_callback
|
||||||
on_ping_recv_callback
|
|
||||||
};
|
};
|
||||||
my_user_data user_data;
|
my_user_data user_data;
|
||||||
spdylay_frame frame;
|
spdylay_frame frame;
|
||||||
|
@ -608,7 +599,6 @@ void test_spdylay_session_on_ping_received()
|
||||||
uint32_t unique_id;
|
uint32_t unique_id;
|
||||||
user_data.valid = 0;
|
user_data.valid = 0;
|
||||||
user_data.invalid = 0;
|
user_data.invalid = 0;
|
||||||
user_data.ping_recv = 0;
|
|
||||||
|
|
||||||
spdylay_session_client_new(&session, &callbacks, &user_data);
|
spdylay_session_client_new(&session, &callbacks, &user_data);
|
||||||
unique_id = 2;
|
unique_id = 2;
|
||||||
|
@ -616,7 +606,6 @@ void test_spdylay_session_on_ping_received()
|
||||||
|
|
||||||
CU_ASSERT(0 == spdylay_session_on_ping_received(session, &frame));
|
CU_ASSERT(0 == spdylay_session_on_ping_received(session, &frame));
|
||||||
CU_ASSERT(1 == user_data.valid);
|
CU_ASSERT(1 == user_data.valid);
|
||||||
CU_ASSERT(0 == user_data.ping_recv);
|
|
||||||
top = spdylay_session_get_ob_pq_top(session);
|
top = spdylay_session_get_ob_pq_top(session);
|
||||||
CU_ASSERT(SPDYLAY_PING == top->frame_type);
|
CU_ASSERT(SPDYLAY_PING == top->frame_type);
|
||||||
CU_ASSERT(unique_id == top->frame->ping.unique_id);
|
CU_ASSERT(unique_id == top->frame->ping.unique_id);
|
||||||
|
@ -626,7 +615,6 @@ void test_spdylay_session_on_ping_received()
|
||||||
|
|
||||||
CU_ASSERT(0 == spdylay_session_on_ping_received(session, &frame));
|
CU_ASSERT(0 == spdylay_session_on_ping_received(session, &frame));
|
||||||
CU_ASSERT(2 == user_data.valid);
|
CU_ASSERT(2 == user_data.valid);
|
||||||
CU_ASSERT(1 == user_data.ping_recv);
|
|
||||||
|
|
||||||
spdylay_frame_ping_free(&frame.ping);
|
spdylay_frame_ping_free(&frame.ping);
|
||||||
spdylay_session_del(session);
|
spdylay_session_del(session);
|
||||||
|
|
Loading…
Reference in New Issue