From 94235472946bb6eb20fc5e39b86a9ddbd43aba0e Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 6 Jun 2014 16:44:39 +0200 Subject: [PATCH] unit: The crypto create and cleanup functions are not test cases --- doc/test-coverage.txt | 4 ++-- unit/test-crypto.c | 25 +++++++++++-------------- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/doc/test-coverage.txt b/doc/test-coverage.txt index 29a97dc6c..952e31eaf 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 c5a695483..fd2ea78c4 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; } -- 2.47.3