Diff between 8e07f07562a0e959408ac48caa46d17a77bffeb7 and 94235472946bb6eb20fc5e39b86a9ddbd43aba0e

Changed Files

File Additions Deletions Status
doc/test-coverage.txt +2 -2 modified
unit/test-crypto.c +11 -14 modified

Full Patch

diff --git a/doc/test-coverage.txt b/doc/test-coverage.txt
index 29a97dc..952e31e 100644
--- a/doc/test-coverage.txt
+++ b/doc/test-coverage.txt
@@ -13,7 +13,7 @@ test-lib		  14	SDP library functions
 test-sdp		 133	SDP qualification test cases
 test-uuid		  30	UUID conversion handling
 test-mgmt		   2	Management interface handling
-test-crypto		   6	Cryptographic toolbox helpers
+test-crypto		   4	Cryptographic toolbox helpers
 test-textfile		   4	Old textfile storage format
 test-ringbuf		   3	Ring buffer functionality
 test-queue		   1	Queue handling functionality
@@ -29,7 +29,7 @@ test-gobex-apparam	  18	OBEX apparam handling
 test-gobex-transfer	  36	OBEX transfer handling
 test-gdbus-client	  12	D-Bus client handling
 			-----
-			 520
+			 518
 
 
 Automated end-to-end testing
diff --git a/unit/test-crypto.c b/unit/test-crypto.c
index c5a6954..fd2ea78 100644
--- a/unit/test-crypto.c
+++ b/unit/test-crypto.c
@@ -107,12 +107,6 @@ static const struct test_data test_data_4 = {
 	.t = t_msg_4
 };
 
-static void test_start(void)
-{
-	crypto = bt_crypto_new();
-	g_assert(crypto);
-}
-
 static void print_buf(const uint8_t *t, uint8_t len)
 {
 	int i;
@@ -152,21 +146,24 @@ static void test_sign(gconstpointer data)
 	g_assert(result_compare(d->t, t));
 }
 
-static void test_stop(void)
-{
-	bt_crypto_unref(crypto);
-}
-
 int main(int argc, char *argv[])
 {
+	int exit_status;
+
+	crypto = bt_crypto_new();
+	if (!crypto)
+		return 0;
+
 	g_test_init(&argc, &argv, NULL);
 
-	g_test_add_func("/crypto/start", test_start);
 	g_test_add_data_func("/crypto/sign_att_1", &test_data_1, test_sign);
 	g_test_add_data_func("/crypto/sign_att_2", &test_data_2, test_sign);
 	g_test_add_data_func("/crypto/sign_att_3", &test_data_3, test_sign);
 	g_test_add_data_func("/crypto/sign_att_4", &test_data_4, test_sign);
-	g_test_add_func("/crypto/stop", test_stop);
 
-	return g_test_run();
+	exit_status = g_test_run();
+
+	bt_crypto_unref(crypto);
+
+	return exit_status;
 }