32#ifndef __TEST_UTILS_H__
33#define __TEST_UTILS_H__
36#include <tinycrypt/constants.h>
43 for (i = 0U; i < (
uint32_t)len; ++i) {
51 const void *computed,
size_t computedlen)
53 TC_ERROR(
"\tTest #%d Failed!\n", testnum);
54 show_str(
"\t\tExpected", expected, expectedlen);
55 show_str(
"\t\tComputed ", computed, computedlen);
61 size_t expectedlen,
const void *computed,
62 size_t computedlen,
uint32_t verbose)
68 if (expectedlen != computedlen) {
69 TC_ERROR(
"The length of the computed buffer (%zu)",
71 TC_ERROR(
"does not match the expected length (%zu).",
75 if (
memcmp(computed, expected, computedlen) != 0) {
76 fatal(testnum, expected, expectedlen,
77 computed, computedlen);
irp nz macro MOVR cc s mov cc s endm endr irp aw macro LDR aa s
Definition asm-macro-32-bit-gnu.h:17
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
int memcmp(const void *m1, const void *m2, size_t n)
#define TC_FAIL
Definition tc_util.h:68
#define TC_PRINT(fmt,...)
Definition tc_util.h:133
#define TC_ERROR(fmt,...)
Definition tc_util.h:117
#define TC_PASS
Definition tc_util.h:67
static void fatal(uint32_t testnum, const void *expected, size_t expectedlen, const void *computed, size_t computedlen)
Definition test_utils.h:50
static void show_str(const char *label, const uint8_t *s, size_t len)
Definition test_utils.h:38
static uint32_t check_result(uint32_t testnum, const void *expected, size_t expectedlen, const void *computed, size_t computedlen, uint32_t verbose)
Definition test_utils.h:60