From 2c1d2b318b162a2573108ccdb02b13d492dfee19 Mon Sep 17 00:00:00 2001 From: Milanka Ringwald Date: Thu, 14 Jan 2016 13:42:11 +0100 Subject: [PATCH] hfp test: call setup before test run --- test/hfp/hfp_ag_client_test.c | 6 ++++++ test/hfp/hfp_hf_client_test.c | 9 ++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/test/hfp/hfp_ag_client_test.c b/test/hfp/hfp_ag_client_test.c index 525339a1c..6e0a0c6cb 100644 --- a/test/hfp/hfp_ag_client_test.c +++ b/test/hfp/hfp_ag_client_test.c @@ -528,6 +528,7 @@ TEST_GROUP(HFPClient){ TEST(HFPClient, PTSRHHTests){ for (int i = 0; i < hfp_pts_ag_rhh_tests_size(); i++){ + setup(); simulate_test_sequence(&hfp_pts_ag_rhh_tests()[i]); teardown(); } @@ -535,6 +536,7 @@ TEST(HFPClient, PTSRHHTests){ TEST(HFPClient, PTSECCTests){ for (int i = 0; i < hfp_pts_ag_ecc_tests_size(); i++){ + setup(); simulate_test_sequence(&hfp_pts_ag_ecc_tests()[i]); teardown(); } @@ -542,6 +544,7 @@ TEST(HFPClient, PTSECCTests){ TEST(HFPClient, PTSECSTests){ for (int i = 0; i < hfp_pts_ag_ecs_tests_size(); i++){ + setup(); simulate_test_sequence(&hfp_pts_ag_ecs_tests()[i]); teardown(); } @@ -549,6 +552,7 @@ TEST(HFPClient, PTSECSTests){ TEST(HFPClient, PTSTWCTests){ for (int i = 0; i < hfp_pts_ag_twc_tests_size(); i++){ + setup(); simulate_test_sequence(&hfp_pts_ag_twc_tests()[i]); teardown(); } @@ -556,6 +560,7 @@ TEST(HFPClient, PTSTWCTests){ TEST(HFPClient, PTSATATests){ for (int i = 0; i < hfp_pts_ag_ata_tests_size(); i++){ + setup(); simulate_test_sequence(&hfp_pts_ag_ata_tests()[i]); teardown(); } @@ -563,6 +568,7 @@ TEST(HFPClient, PTSATATests){ TEST(HFPClient, PTSSLCTests){ for (int i = 0; i < hfp_pts_ag_slc_tests_size(); i++){ + setup(); simulate_test_sequence(&hfp_pts_ag_slc_tests()[i]); teardown(); } diff --git a/test/hfp/hfp_hf_client_test.c b/test/hfp/hfp_hf_client_test.c index 97ced1307..d541f0b01 100644 --- a/test/hfp/hfp_hf_client_test.c +++ b/test/hfp/hfp_hf_client_test.c @@ -318,7 +318,8 @@ void simulate_test_sequence(hfp_test_item_t * test_item){ int previous_step = -1; while ( i < test_item->len){ previous_step++; - if (i < previous_step) exit(0); + CHECK_EQUAL(i >= previous_step, 1); + char * expected_cmd = test_steps[i]; int expected_cmd_len = strlen(expected_cmd); printf("\nStep %d, %s \n", i, expected_cmd); @@ -495,6 +496,7 @@ TEST_GROUP(HFPClient){ TEST(HFPClient, PTSRHHTests){ for (int i = 0; i < hfp_pts_hf_rhh_tests_size(); i++){ + setup(); simulate_test_sequence(&hfp_pts_hf_rhh_tests()[i]); teardown(); } @@ -502,6 +504,7 @@ TEST(HFPClient, PTSRHHTests){ TEST(HFPClient, PTSECCTests){ for (int i = 0; i < hfp_pts_hf_ecc_tests_size(); i++){ + setup(); simulate_test_sequence(&hfp_pts_hf_ecc_tests()[i]); teardown(); } @@ -509,6 +512,7 @@ TEST(HFPClient, PTSECCTests){ TEST(HFPClient, PTSECSTests){ for (int i = 0; i < hfp_pts_hf_ecs_tests_size(); i++){ + setup(); simulate_test_sequence(&hfp_pts_hf_ecs_tests()[i]); teardown(); } @@ -516,6 +520,7 @@ TEST(HFPClient, PTSECSTests){ TEST(HFPClient, PTSTWCTests){ for (int i = 0; i < hfp_pts_hf_twc_tests_size(); i++){ + setup(); simulate_test_sequence(&hfp_pts_hf_twc_tests()[i]); teardown(); } @@ -523,6 +528,7 @@ TEST(HFPClient, PTSTWCTests){ TEST(HFPClient, PTSATATests){ for (int i = 0; i < hfp_pts_hf_ata_tests_size(); i++){ + setup(); simulate_test_sequence(&hfp_pts_hf_ata_tests()[i]); teardown(); } @@ -530,6 +536,7 @@ TEST(HFPClient, PTSATATests){ TEST(HFPClient, PTSSLCTests){ for (int i = 0; i < hfp_pts_hf_slc_tests_size(); i++){ + setup(); simulate_test_sequence(&hfp_pts_hf_slc_tests()[i]); teardown(); }