From 80c1c02872f1fac59e0481d00ad444daf0722a30 Mon Sep 17 00:00:00 2001 From: Alvaro Denis Date: Thu, 16 May 2019 16:16:20 -0400 Subject: [PATCH] refactor move TestPubKeyVerifyDefault1 from lib/cgo/tests/check_cipher.crypto.c to lib/cgo/tests/check_cipher.crypto.common.c ref #34 --- lib/cgo/tests/check_cipher.crypto.c | 12 ------------ lib/cgo/tests/check_cipher.crypto.common.c | 12 ++++++++++++ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/cgo/tests/check_cipher.crypto.c b/lib/cgo/tests/check_cipher.crypto.c index 9e91cfd21..4c93e4294 100644 --- a/lib/cgo/tests/check_cipher.crypto.c +++ b/lib/cgo/tests/check_cipher.crypto.c @@ -9,17 +9,6 @@ // TestSuite(cipher_crypto, .init = setup, .fini = teardown); -START_TEST(TestPubKeyVerifyDefault1) -{ - cipher__PubKey p; - cipher__SecKey s; - - SKY_cipher_GenerateKeyPair(&p, &s); - GoUint32 errorcode = SKY_cipher_PubKey_Verify(&p); - ck_assert(errorcode == SKY_OK); -} -END_TEST - START_TEST(TestPubKeyVerifyDefault2) { cipher__PubKey p; @@ -708,7 +697,6 @@ Suite* cipher_crypto(void) tc = tcase_create("cipher.crypto"); tcase_add_checked_fixture(tc, setup, teardown); - tcase_add_test(tc, TestPubKeyVerifyDefault1); tcase_add_test(tc, TestPubKeyRipemd160); tcase_add_test(tc, TestPubKeyToAddress2); tcase_add_test(tc, TestSecKeyFromHex); diff --git a/lib/cgo/tests/check_cipher.crypto.common.c b/lib/cgo/tests/check_cipher.crypto.common.c index b1bddd570..8dc3db0ab 100644 --- a/lib/cgo/tests/check_cipher.crypto.common.c +++ b/lib/cgo/tests/check_cipher.crypto.common.c @@ -158,6 +158,17 @@ START_TEST(TestPubKeyVerifyNil) } END_TEST +START_TEST(TestPubKeyVerifyDefault1) +{ + cipher__PubKey p; + cipher__SecKey s; + + SKY_cipher_GenerateKeyPair(&p, &s); + GoUint32 errorcode = SKY_cipher_PubKey_Verify(&p); + ck_assert(errorcode == SKY_OK); +} +END_TEST + // define test suite and cases Suite *common_check_cipher_crypto(void) { @@ -170,6 +181,7 @@ Suite *common_check_cipher_crypto(void) tcase_add_test(tc, TestPubKeyHex); tcase_add_test(tc, TestPubKeyVerify); tcase_add_test(tc, TestPubKeyVerifyNil); + tcase_add_test(tc, TestPubKeyVerifyDefault1); suite_add_tcase(s, tc); tcase_set_timeout(tc, 150);