Commit 4173088e authored by Geir Istad's avatar Geir Istad

test/test_srtp.c: Apply clang-format

parent 9d821146
......@@ -72,13 +72,13 @@ void srtp_calc_aead_iv_srtcp_distinct_iv_per_sequence_number(void);
* item is the test function.
*/
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_seq_num_over_0x7FFFFFFF_bad_param()",
srtp_calc_aead_iv_srtcp_seq_num_over_0x7FFFFFFF_bad_param},
{"srtp_calc_aead_iv_srtcp_distinct_iv_per_sequence_number()",
srtp_calc_aead_iv_srtcp_distinct_iv_per_sequence_number},
{NULL} /* End of tests */};
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_seq_num_over_0x7FFFFFFF_bad_param()",
srtp_calc_aead_iv_srtcp_seq_num_over_0x7FFFFFFF_bad_param },
{ "srtp_calc_aead_iv_srtcp_distinct_iv_per_sequence_number()",
srtp_calc_aead_iv_srtcp_distinct_iv_per_sequence_number },
{ NULL } /* End of tests */ };
/*
* Implementation.
......@@ -146,9 +146,9 @@ void srtp_calc_aead_iv_srtcp_seq_num_over_0x7FFFFFFF_bad_param()
*/
void srtp_calc_aead_iv_srtcp_distinct_iv_per_sequence_number()
{
#define SAMPLE_COUNT (3)
// Preconditions
// Test each significant bit high in each full byte.
#define SAMPLE_COUNT (3)
srtp_session_keys_t session_keys;
srtcp_hdr_t header;
v128_t output_iv[SAMPLE_COUNT];
......@@ -173,13 +173,13 @@ void srtp_calc_aead_iv_srtcp_distinct_iv_per_sequence_number()
size_t i = 0;
for (i = 0; i < SAMPLE_COUNT; i++) {
TEST_CHECK(srtp_calc_aead_iv_srtcp(&session_keys, &output_iv[i],
sequence_num[i], &header)
== srtp_err_status_ok);
sequence_num[i],
&header) == srtp_err_status_ok);
}
// Then all IVs are as expected
for (i = 0; i < SAMPLE_COUNT; i++) {
TEST_CHECK(memcmp(&final_iv[i], &output_iv[i], sizeof(v128_t)) == 0);
}
#undef SAMPLE_COUNT
#undef SAMPLE_COUNT
}
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