Diff between 619acbcda394ffbb2b84d2668376e3b6a9fc631f and 87aeb83c8071d4f676533b6c84866e8610a0a659

Changed Files

File Additions Deletions Status
unit/test-gatt.c +10 -2 modified

Full Patch

diff --git a/unit/test-gatt.c b/unit/test-gatt.c
index 2edcacb..7668e93 100644
--- a/unit/test-gatt.c
+++ b/unit/test-gatt.c
@@ -304,9 +304,12 @@ static gboolean context_quit(gpointer user_data)
 	if (step && step->post_func)
 		step->post_func(context);
 
-	destroy_context(context);
+	if (context->data->pdu_list[context->pdu_offset].valid)
+		tester_test_abort();
+	else
+		tester_test_passed();
 
-	tester_test_passed();
+	destroy_context(context);
 
 	return FALSE;
 }
@@ -910,6 +913,11 @@ static void test_signed_write(struct context *context)
 	uint8_t key[16] = {0xD8, 0x51, 0x59, 0x48, 0x45, 0x1F, 0xEA, 0x32, 0x0D,
 				0xC0, 0x5A, 0x2E, 0x88, 0x30, 0x81, 0x88 };
 
+	if (!bt_att_has_crypto(context->att)) {
+		context_quit(context);
+		return;
+	}
+
 	g_assert(bt_att_set_local_key(context->att, key, local_counter,
 								context));