tests: crypto: style, tag, and category fixes

Fix coding style, test tags and use categories.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2018-04-21 18:17:22 -05:00 committed by Anas Nashif
parent 1f2627a638
commit 9312de0077
8 changed files with 70 additions and 70 deletions

View file

@ -101,7 +101,7 @@ const u8_t ciphertext[80] = {
/*
* NIST SP 800-38a CBC Test for encryption and decryption.
*/
void test_1_and_2(void)
void test_sp_800_38a_encrypt_decrypt(void)
{
TC_START("Performing AES128 tests:");

View file

@ -5,12 +5,12 @@
*/
#include <ztest.h>
extern void test_1_and_2(void);
extern void test_sp_800_38a_encrypt_decrypt(void);
/**test case main entry*/
void test_main(void)
{
ztest_test_suite(test_cbc_fn,
ztest_unit_test(test_1_and_2));
ztest_unit_test(test_sp_800_38a_encrypt_decrypt));
ztest_run_test_suite(test_cbc_fn);
}

View file

@ -49,7 +49,7 @@
/*
* NIST SP 800-38a CTR Test for encryption and decryption.
*/
void test_1_and_2(void)
void test_sp_800_38a_encrypt_decrypt(void)
{
TC_START("Performing AES128-CTR mode tests:");

View file

@ -5,12 +5,12 @@
*/
#include <ztest.h>
extern void test_1_and_2(void);
extern void test_sp_800_38a_encrypt_decrypt(void);
/**test case main entry*/
void test_main(void)
{
ztest_test_suite(test_ctr_mode_fn,
ztest_unit_test(test_1_and_2));
ztest_unit_test(test_sp_800_38a_encrypt_decrypt));
ztest_run_test_suite(test_ctr_mode_fn);
}

View file

@ -60,7 +60,7 @@ u32_t do_hmac_test(TCHmacState_t h, u32_t testnum, const u8_t *data,
/*
* NIST test vectors for encryption.
*/
void test_1(void)
void test_hmac_1(void)
{
u32_t result = TC_PASS;
@ -94,7 +94,7 @@ void test_1(void)
zassert_false(result, "HMAC test #7 failed");
}
void test_2(void)
void test_hmac_2(void)
{
u32_t result = TC_PASS;
@ -128,7 +128,7 @@ void test_2(void)
zassert_false(result, "HMAC test #7 failed");
}
void test_3(void)
void test_hmac_3(void)
{
u32_t result = TC_PASS;
@ -168,7 +168,7 @@ void test_3(void)
zassert_false(result, "HMAC test #3 failed");
}
void test_4(void)
void test_hmac_4(void)
{
u32_t result = TC_PASS;
@ -210,7 +210,7 @@ void test_4(void)
zassert_false(result, "HMAC test #4 failed");
}
void test_5(void)
void test_hmac_5(void)
{
u32_t result = TC_PASS;
@ -244,7 +244,7 @@ void test_5(void)
zassert_false(result, "HMAC test #5 failed");
}
void test_6(void)
void test_hmac_6(void)
{
u32_t result = TC_PASS;
@ -302,7 +302,7 @@ void test_6(void)
zassert_false(result, "HMAC test #6 failed");
}
void test_7(void)
void test_hmac_7(void)
{
u32_t result = TC_PASS;

View file

@ -5,24 +5,24 @@
*/
#include <ztest.h>
extern void test_1(void);
extern void test_2(void);
extern void test_3(void);
extern void test_4(void);
extern void test_5(void);
extern void test_6(void);
extern void test_7(void);
extern void test_hmac_1(void);
extern void test_hmac_2(void);
extern void test_hmac_3(void);
extern void test_hmac_4(void);
extern void test_hmac_5(void);
extern void test_hmac_6(void);
extern void test_hmac_7(void);
/**test case main entry*/
void test_main(void)
{
ztest_test_suite(test_hmac_fn,
ztest_unit_test(test_1),
ztest_unit_test(test_2),
ztest_unit_test(test_3),
ztest_unit_test(test_4),
ztest_unit_test(test_5),
ztest_unit_test(test_6),
ztest_unit_test(test_7));
ztest_unit_test(test_hmac_1),
ztest_unit_test(test_hmac_2),
ztest_unit_test(test_hmac_3),
ztest_unit_test(test_hmac_4),
ztest_unit_test(test_hmac_5),
ztest_unit_test(test_hmac_6),
ztest_unit_test(test_hmac_7));
ztest_run_test_suite(test_hmac_fn);
}

View file

@ -5,36 +5,36 @@
*/
#include <ztest.h>
extern void test_1(void);
extern void test_2(void);
extern void test_3(void);
extern void test_4(void);
extern void test_5(void);
extern void test_6(void);
extern void test_7(void);
extern void test_8(void);
extern void test_9(void);
extern void test_10(void);
extern void test_11(void);
extern void test_12(void);
extern void test_13_and_14(void);
extern void test_sha256_1(void);
extern void test_sha256_2(void);
extern void test_sha256_3(void);
extern void test_sha256_4(void);
extern void test_sha256_5(void);
extern void test_sha256_6(void);
extern void test_sha256_7(void);
extern void test_sha256_8(void);
extern void test_sha256_9(void);
extern void test_sha256_10(void);
extern void test_sha256_11(void);
extern void test_sha256_12(void);
extern void test_sha256_13_and_14(void);
/**test case main entry*/
void test_main(void)
{
ztest_test_suite(test_sha256_fn,
ztest_unit_test(test_1),
ztest_unit_test(test_2),
ztest_unit_test(test_3),
ztest_unit_test(test_4),
ztest_unit_test(test_5),
ztest_unit_test(test_6),
ztest_unit_test(test_7),
ztest_unit_test(test_7),
ztest_unit_test(test_9),
ztest_unit_test(test_10),
ztest_unit_test(test_11),
ztest_unit_test(test_12),
ztest_unit_test(test_13_and_14));
ztest_unit_test(test_sha256_1),
ztest_unit_test(test_sha256_2),
ztest_unit_test(test_sha256_3),
ztest_unit_test(test_sha256_4),
ztest_unit_test(test_sha256_5),
ztest_unit_test(test_sha256_6),
ztest_unit_test(test_sha256_7),
ztest_unit_test(test_sha256_7),
ztest_unit_test(test_sha256_9),
ztest_unit_test(test_sha256_10),
ztest_unit_test(test_sha256_11),
ztest_unit_test(test_sha256_12),
ztest_unit_test(test_sha256_13_and_14));
ztest_run_test_suite(test_sha256_fn);
}

View file

@ -50,7 +50,7 @@
/*
* NIST SHA256 test vector 1.
*/
void test_1(void)
void test_sha256_1(void)
{
TC_START("Performing SHA256 tests (NIST tests vectors):");
@ -81,7 +81,7 @@ void test_1(void)
/*
* NIST SHA256 test vector 2.
*/
void test_2(void)
void test_sha256_2(void)
{
u32_t result = TC_PASS;
@ -109,7 +109,7 @@ void test_2(void)
zassert_false(result, "SHA256 test #2 failed.");
}
void test_3(void)
void test_sha256_3(void)
{
u32_t result = TC_PASS;
@ -137,7 +137,7 @@ void test_3(void)
}
void test_4(void)
void test_sha256_4(void)
{
u32_t result = TC_PASS;
@ -165,7 +165,7 @@ void test_4(void)
}
void test_5(void)
void test_sha256_5(void)
{
u32_t result = TC_PASS;
@ -195,7 +195,7 @@ void test_5(void)
}
void test_6(void)
void test_sha256_6(void)
{
u32_t result = TC_PASS;
@ -225,7 +225,7 @@ void test_6(void)
}
void test_7(void)
void test_sha256_7(void)
{
u32_t result = TC_PASS;
@ -255,7 +255,7 @@ void test_7(void)
}
void test_8(void)
void test_sha256_8(void)
{
u32_t result = TC_PASS;
@ -285,7 +285,7 @@ void test_8(void)
}
void test_9(void)
void test_sha256_9(void)
{
u32_t result = TC_PASS;
@ -315,7 +315,7 @@ void test_9(void)
}
void test_10(void)
void test_sha256_10(void)
{
u32_t result = TC_PASS;
@ -345,7 +345,7 @@ void test_10(void)
}
void test_11(void)
void test_sha256_11(void)
{
u32_t result = TC_PASS;
@ -375,7 +375,7 @@ void test_11(void)
}
void test_12(void)
void test_sha256_12(void)
{
u32_t result = TC_PASS;
@ -407,7 +407,7 @@ void test_12(void)
zassert_false(result, "SHA256 test #12 failed.");
}
#if EXTREME_SLOW
void test_13(void)
void test_sha256_13(void)
{
u32_t result = TC_PASS;
@ -440,7 +440,7 @@ void test_13(void)
}
void test_14(void)
void test_sha256_14(void)
{
u32_t result = TC_PASS;
@ -474,10 +474,10 @@ void test_14(void)
}
#endif
void test_13_and_14(void)
void test_sha256_13_and_14(void)
{
#if EXTREME_SLOW
result = test_13();
result = test_14();
result = test_sha256_13();
result = test_sha256_14();
#endif
}