From c779eb8183a7717cb43267c167e038b6c8b23853 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Danis?= Date: Mon, 1 Sep 2025 17:49:01 +0200 Subject: [PATCH] unit/test-hfp: Re-order TS tests in alphabetical order This will simplify when looking for a test. --- unit/test-hfp.c | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/unit/test-hfp.c b/unit/test-hfp.c index 9be1b05ae..0a6828b7c 100644 --- a/unit/test-hfp.c +++ b/unit/test-hfp.c @@ -771,15 +771,7 @@ static void hf_update_indicator(enum hfp_indicator indicator, uint32_t val, return; } - if (g_str_equal(test_name, "/HFP/HF/TRS/BV-01-C")) { - context->session.step++; - g_assert_cmpint(indicator, ==, HFP_INDICATOR_SERVICE); - g_assert_cmpint(val, ==, context->session.step % 2); - - if (context->session.step == 3) - context->data->response_func(HFP_RESULT_OK, 0, - context); - } else if (g_str_equal(test_name, "/HFP/HF/PSI/BV-01-C")) { + if (g_str_equal(test_name, "/HFP/HF/PSI/BV-01-C")) { g_assert_cmpint(indicator, ==, HFP_INDICATOR_SIGNAL); g_assert_cmpint(val, ==, 3); context->data->response_func(HFP_RESULT_OK, 0, context); @@ -795,6 +787,14 @@ static void hf_update_indicator(enum hfp_indicator indicator, uint32_t val, g_assert_cmpint(indicator, ==, HFP_INDICATOR_BATTCHG); g_assert_cmpint(val, ==, 3); context->data->response_func(HFP_RESULT_OK, 0, context); + } else if (g_str_equal(test_name, "/HFP/HF/TRS/BV-01-C")) { + context->session.step++; + g_assert_cmpint(indicator, ==, HFP_INDICATOR_SERVICE); + g_assert_cmpint(val, ==, context->session.step % 2); + + if (context->session.step == 3) + context->data->response_func(HFP_RESULT_OK, 0, + context); } } @@ -1008,18 +1008,6 @@ int main(int argc, char *argv[]) MINIMAL_SLC_SESSION, data_end()); - /* Transfer Registration Status - HF */ - define_hf_test("/HFP/HF/TRS/BV-01-C", test_hf_session, - NULL, test_hf_session_done, - MINIMAL_SLC_SESSION, - frg_pdu('\r', '\n', '+', 'C', 'I', 'E', 'V', ':'), - frg_pdu(' ', '1', ',', '1', '\r', '\n'), - frg_pdu('\r', '\n', '+', 'C', 'I', 'E', 'V', ':'), - frg_pdu(' ', '1', ',', '0', '\r', '\n'), - frg_pdu('\r', '\n', '+', 'C', 'I', 'E', 'V', ':'), - frg_pdu(' ', '1', ',', '1', '\r', '\n'), - data_end()); - /* Transfer Signal Strength Indication - HF */ define_hf_test("/HFP/HF/PSI/BV-01-C", test_hf_session, NULL, test_hf_session_done, @@ -1046,5 +1034,17 @@ int main(int argc, char *argv[]) frg_pdu(' ', '7', ',', '3', '\r', '\n'), data_end()); + /* Transfer Registration Status - HF */ + define_hf_test("/HFP/HF/TRS/BV-01-C", test_hf_session, + NULL, test_hf_session_done, + MINIMAL_SLC_SESSION, + frg_pdu('\r', '\n', '+', 'C', 'I', 'E', 'V', ':'), + frg_pdu(' ', '1', ',', '1', '\r', '\n'), + frg_pdu('\r', '\n', '+', 'C', 'I', 'E', 'V', ':'), + frg_pdu(' ', '1', ',', '0', '\r', '\n'), + frg_pdu('\r', '\n', '+', 'C', 'I', 'E', 'V', ':'), + frg_pdu(' ', '1', ',', '1', '\r', '\n'), + data_end()); + return tester_run(); } -- 2.47.3