util-test: Copy the test in the esp32 directory to the esp32s2beta directory

This commit is contained in:
Li Shuai
2019-06-27 21:45:24 +08:00
parent 35147119f1
commit fd15fd3da4
7 changed files with 450 additions and 0 deletions

View File

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