Diff between e733365a4119015dfa44686a006862c5a2fe381b and 4e5ce5de4d69f1dadf6366a26ff55d78be3f62d6

Changed Files

File Additions Deletions Status
unit/test-hfp.c +20 -0 modified

Full Patch

diff --git a/unit/test-hfp.c b/unit/test-hfp.c
index dd5dbcf..617b336 100644
--- a/unit/test-hfp.c
+++ b/unit/test-hfp.c
@@ -486,6 +486,18 @@ static void hf_response_with_data(enum hfp_result res,
 	hfp_hf_disconnect(context->hfp_hf);
 }
 
+static void hf_cme_error_response_cb(enum hfp_result res,
+							enum hfp_error cme_err,
+							void *user_data)
+{
+	struct context *context = user_data;
+
+	g_assert_cmpint(res, ==, HFP_RESULT_CME_ERROR);
+	g_assert_cmpint(cme_err, ==, 30);
+
+	hfp_hf_disconnect(context->hfp_hf);
+}
+
 static void hf_response_cb(enum hfp_result res, enum hfp_error cme_err,
 							void *user_data)
 {
@@ -718,6 +730,14 @@ int main(int argc, char *argv[])
 			frg_pdu('\r', '\n', 'O', 'k', '\r', '\n'),
 			data_end());
 
+	define_hf_test("/hfp_hf/test_send_command_3", test_hf_send_command,
+			NULL, hf_cme_error_response_cb,
+			raw_pdu('A', 'T', '+', 'C', 'H', 'L', 'D', '=',
+								'1', '\0'),
+			frg_pdu('\r', '\n', '+', 'C', 'M', 'E', ' ', 'E'),
+			frg_pdu('R', 'R', 'O', 'R', ':', '3', '0', '\r', '\n'),
+			data_end());
+
 	define_hf_test("/hfp_hf/test_unsolicited_1", test_hf_unsolicited,
 			hf_result_handler, NULL,
 			raw_pdu('+', 'C', 'L', 'C', 'C', '\0'),