Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
move TestPubKeyVerifyDefault1 from lib/cgo/tests/check_cipher.crypto.c to lib/cgo/tests/check_cipher.crypto.common.c
ref #34
  • Loading branch information
stdevAlDen committed May 16, 2019
1 parent 50eb911 commit 80c1c02
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 0 additions & 12 deletions lib/cgo/tests/check_cipher.crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
12 changes: 12 additions & 0 deletions lib/cgo/tests/check_cipher.crypto.common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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);

Expand Down

0 comments on commit 80c1c02

Please sign in to comment.