unit-tests: Return status from process_message()
This commit is contained in:
@@ -179,17 +179,20 @@ METHOD(backend_t, create_peer_cfg_enumerator, enumerator_t*,
|
|||||||
return enumerator_create_single(this->peer_cfg, NULL);
|
return enumerator_create_single(this->peer_cfg, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
METHOD(exchange_test_helper_t, process_message, void,
|
METHOD(exchange_test_helper_t, process_message, status_t,
|
||||||
private_exchange_test_helper_t *this, ike_sa_t *ike_sa, message_t *message)
|
private_exchange_test_helper_t *this, ike_sa_t *ike_sa, message_t *message)
|
||||||
{
|
{
|
||||||
|
status_t status;
|
||||||
|
|
||||||
if (!message)
|
if (!message)
|
||||||
{
|
{
|
||||||
message = this->public.sender->dequeue(this->public.sender);
|
message = this->public.sender->dequeue(this->public.sender);
|
||||||
}
|
}
|
||||||
charon->bus->set_sa(charon->bus, ike_sa);
|
charon->bus->set_sa(charon->bus, ike_sa);
|
||||||
ike_sa->process_message(ike_sa, message);
|
status = ike_sa->process_message(ike_sa, message);
|
||||||
charon->bus->set_sa(charon->bus, NULL);
|
charon->bus->set_sa(charon->bus, NULL);
|
||||||
message->destroy(message);
|
message->destroy(message);
|
||||||
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
METHOD(exchange_test_helper_t, establish_sa, void,
|
METHOD(exchange_test_helper_t, establish_sa, void,
|
||||||
|
|||||||
@@ -64,9 +64,10 @@ struct exchange_test_helper_t {
|
|||||||
* @param ike_sa the IKE_SA receiving the message
|
* @param ike_sa the IKE_SA receiving the message
|
||||||
* @param message the message, or NULL to pass the next message in the
|
* @param message the message, or NULL to pass the next message in the
|
||||||
* send queue (adopted)
|
* send queue (adopted)
|
||||||
|
* @return return value from ike_sa_t::process_message()
|
||||||
*/
|
*/
|
||||||
void (*process_message)(exchange_test_helper_t *this, ike_sa_t *sa,
|
status_t (*process_message)(exchange_test_helper_t *this, ike_sa_t *sa,
|
||||||
message_t *message);
|
message_t *message);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register a listener with the bus.
|
* Register a listener with the bus.
|
||||||
|
|||||||
Reference in New Issue
Block a user