esp32c3: Add tests for esp_sha, stack checker

From internal commit 6d894813
This commit is contained in:
Angus Gratton
2020-12-22 19:03:24 +11:00
parent adbf182bc5
commit 544c5e57ce
5 changed files with 143 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
#include "unity.h"
#if CONFIG_COMPILER_STACK_CHECK
static void recur_and_smash_cxx(void)
{
static int cnt;
volatile uint8_t buf[50];
volatile int num = sizeof(buf)+10;
if (cnt++ < 1) {
recur_and_smash_cxx();
}
for (int i = 0; i < num; i++) {
buf[i] = 0;
}
}
TEST_CASE("stack smashing protection CXX", "[stack_check] [ignore]")
{
recur_and_smash_cxx();
}
#endif