From b7eb67fb74e98ae4c7002bb9a37bc07911f4ee59 Mon Sep 17 00:00:00 2001 From: Ronald Cron Date: Tue, 9 Jun 2020 16:57:42 +0200 Subject: [PATCH] tests: Add random.c and random.h files The purpose of random.c file is to contain the helper functions to generate random numbers that have been in helpers.function so far. The purpose of random.h is to contain the interface exposed by random.c thus helper function prototypes. Signed-off-by: Ronald Cron --- tests/include/test/random.h | 35 +++++++++++++++++++++++++++++++++++ tests/src/random.c | 26 ++++++++++++++++++++++++++ tests/suites/helpers.function | 1 + 3 files changed, 62 insertions(+) create mode 100644 tests/include/test/random.h create mode 100644 tests/src/random.c diff --git a/tests/include/test/random.h b/tests/include/test/random.h new file mode 100644 index 000000000..11a353176 --- /dev/null +++ b/tests/include/test/random.h @@ -0,0 +1,35 @@ +/** + * \file random.h + * + * \brief This file contains the prototypes of helper functions to generate + * random numbers for the purpose of testing. + */ + +/* Copyright (C) 2020, ARM Limited, All Rights Reserved + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * This file is part of mbed TLS (https://tls.mbed.org) + */ + +#ifndef TEST_RANDOM_H +#define TEST_RANDOM_H + +#if !defined(MBEDTLS_CONFIG_FILE) +#include "mbedtls/config.h" +#else +#include MBEDTLS_CONFIG_FILE +#endif + +#endif /* TEST_RANDOM_H */ diff --git a/tests/src/random.c b/tests/src/random.c new file mode 100644 index 000000000..f80a1c471 --- /dev/null +++ b/tests/src/random.c @@ -0,0 +1,26 @@ +/** + * \file random.c + * + * \brief This file contains the helper functions to generate random numbers + * for the purpose of testing. + */ + +/* Copyright (C) 2020, ARM Limited, All Rights Reserved + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * This file is part of mbed TLS (https://tls.mbed.org) + */ + +#include diff --git a/tests/suites/helpers.function b/tests/suites/helpers.function index 2d1e38c23..926658216 100644 --- a/tests/suites/helpers.function +++ b/tests/suites/helpers.function @@ -4,6 +4,7 @@ #include #include +#include #include