ESP-IDF Firmware
Firmware architecture and call graph
Loading...
Searching...
No Matches
dsp_tests.h
Go to the documentation of this file.
1// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#ifndef _DSP_TESTS_H_
16#define _DSP_TESTS_H_
17
18#include <stdlib.h>
19#include "esp_idf_version.h"
20#include "esp_dsp.h"
21
22#define TEST_ASSERT_EXEC_IN_RANGE(min_exec, max_exec, actual) \
23 if (actual >= max_exec) { \
24 ESP_LOGE("", "Time error. Expected max: %i, reached: %i", (int)max_exec, (int)actual);\
25 TEST_ASSERT_MESSAGE (false, "Exec time takes more than expected! ");\
26 }\
27 if (actual < min_exec) {\
28 ESP_LOGE("", "Time error. Expected min: %i, reached: %i", (int)min_exec, (int)actual);\
29 TEST_ASSERT_MESSAGE (false, "Exec time takes less then expected!");\
30 }
31
32
33// memalign function is implemented in IDF 4.3 and later
34#if ESP_IDF_VERSION <= ESP_IDF_VERSION_VAL(4, 3, 0)
35#define memalign(align_, size_) malloc(size_)
36#endif
37
38#endif // _DSP_TESTS_H_