Commit 66a3c718 authored by Geir Istad's avatar Geir Istad

test_srtp.c: Uncomment and fix test

srtp_calc_aead_iv_srtcp_seq_num_over_0x7FFFFFFF_bad_param()

Some errors in the test was fixed as well. Enabled now that the function
under test returns a result.
parent 5da28098
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
*/ */
void srtp_calc_aead_iv_srtcp_all_zero_input_yield_zero_output(); void srtp_calc_aead_iv_srtcp_all_zero_input_yield_zero_output();
// void srtp_calc_aead_iv_srtcp_seq_num_over_0x7FFFFFFF_bad_param(); void srtp_calc_aead_iv_srtcp_seq_num_over_0x7FFFFFFF_bad_param();
/* /*
* NULL terminated array of tests. * NULL terminated array of tests.
...@@ -70,8 +70,8 @@ void srtp_calc_aead_iv_srtcp_all_zero_input_yield_zero_output(); ...@@ -70,8 +70,8 @@ void srtp_calc_aead_iv_srtcp_all_zero_input_yield_zero_output();
TEST_LIST = {{"srtp_calc_aead_iv_srtcp_all_zero_input_yield_zero_output()", TEST_LIST = {{"srtp_calc_aead_iv_srtcp_all_zero_input_yield_zero_output()",
srtp_calc_aead_iv_srtcp_all_zero_input_yield_zero_output}, srtp_calc_aead_iv_srtcp_all_zero_input_yield_zero_output},
/* {"srtp_calc_aead_iv_srtcp_seq_num_over_0x7FFFFFFF_bad_param()", {"srtp_calc_aead_iv_srtcp_seq_num_over_0x7FFFFFFF_bad_param()",
srtp_calc_aead_iv_srtcp_seq_num_over_0x7FFFFFFF_bad_param}, */ srtp_calc_aead_iv_srtcp_seq_num_over_0x7FFFFFFF_bad_param},
{NULL} /* End of tests */}; {NULL} /* End of tests */};
/* /*
...@@ -105,7 +105,6 @@ void srtp_calc_aead_iv_srtcp_all_zero_input_yield_zero_output() ...@@ -105,7 +105,6 @@ void srtp_calc_aead_iv_srtcp_all_zero_input_yield_zero_output()
TEST_CHECK(memcmp(&zero_vector, &init_vector, sizeof(v128_t)) == 0); TEST_CHECK(memcmp(&zero_vector, &init_vector, sizeof(v128_t)) == 0);
} }
/*
void srtp_calc_aead_iv_srtcp_seq_num_over_0x7FFFFFFF_bad_param() void srtp_calc_aead_iv_srtcp_seq_num_over_0x7FFFFFFF_bad_param()
{ {
// Preconditions // Preconditions
...@@ -115,7 +114,7 @@ void srtp_calc_aead_iv_srtcp_seq_num_over_0x7FFFFFFF_bad_param() ...@@ -115,7 +114,7 @@ void srtp_calc_aead_iv_srtcp_seq_num_over_0x7FFFFFFF_bad_param()
uint32_t sequence_num; uint32_t sequence_num;
// Postconditions // Postconditions
srtp_err_status_t status srtp_err_status_t status;
// Given // Given
memset(&session_keys, 0, sizeof(srtp_session_keys_t)); memset(&session_keys, 0, sizeof(srtp_session_keys_t));
...@@ -124,10 +123,9 @@ void srtp_calc_aead_iv_srtcp_seq_num_over_0x7FFFFFFF_bad_param() ...@@ -124,10 +123,9 @@ void srtp_calc_aead_iv_srtcp_seq_num_over_0x7FFFFFFF_bad_param()
sequence_num = 0x7FFFFFFFUL + 0x1UL; sequence_num = 0x7FFFFFFFUL + 0x1UL;
// When // When
srtp_err_status_t status = srtp_calc_aead_iv_srtcp( status = srtp_calc_aead_iv_srtcp(&session_keys, &init_vector, sequence_num,
&session_keys, &init_vector, sequence_num, &header); &header);
// Then // Then
TEST_CHECK(status == srtp_err_status_bad_param); TEST_CHECK(status == srtp_err_status_bad_param);
} }
*/
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment