Browse Source

tests: crypto: move the tinycrypt_hmac_prng test to new ztest API

Migrate the testsuite tests/crypto/tinycrypt_hmac_prng to the new
ztest API.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
pull/49732/head
Enjia Mai 3 years ago committed by Anas Nashif
parent
commit
64f096d264
  1. 1
      tests/crypto/tinycrypt_hmac_prng/prj.conf
  2. 4
      tests/crypto/tinycrypt_hmac_prng/src/hmac_prng.c
  3. 16
      tests/crypto/tinycrypt_hmac_prng/src/main.c

1
tests/crypto/tinycrypt_hmac_prng/prj.conf

@ -4,3 +4,4 @@ CONFIG_TINYCRYPT_SHA256=y @@ -4,3 +4,4 @@ CONFIG_TINYCRYPT_SHA256=y
CONFIG_TINYCRYPT_SHA256_HMAC=y
CONFIG_TINYCRYPT_SHA256_HMAC_PRNG=y
CONFIG_ZTEST=y
CONFIG_ZTEST_NEW_API=y

4
tests/crypto/tinycrypt_hmac_prng/src/hmac_prng.c

@ -7544,7 +7544,7 @@ unsigned int test_120(void) @@ -7544,7 +7544,7 @@ unsigned int test_120(void)
}
void test_hmac_prng(void)
ZTEST(hmac_prng_fn, test_hmac_prng)
{
unsigned int result = TC_PASS;
@ -7913,3 +7913,5 @@ void test_hmac_prng(void) @@ -7913,3 +7913,5 @@ void test_hmac_prng(void)
TC_PRINT("\n");
TC_PRINT("All HMAC-PRNG tests succeeded!\n");
}
ZTEST_SUITE(hmac_prng_fn, NULL, NULL, NULL, NULL, NULL);

16
tests/crypto/tinycrypt_hmac_prng/src/main.c

@ -1,16 +0,0 @@ @@ -1,16 +0,0 @@
/*
* Copyright (c) 2017 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/ztest.h>
extern void test_hmac_prng(void);
/**test case main entry*/
void test_main(void)
{
ztest_test_suite(test_hmac_prng_fn,
ztest_unit_test(test_hmac_prng));
ztest_run_test_suite(test_hmac_prng_fn);
}
Loading…
Cancel
Save