Skip to content

Commit 1c4d475

Browse files
committed
Merge branch 'bugfix/remove_exception_windowspill_test' into 'master'
CXX: remove exception windowspill test See merge request espressif/esp-idf!9612
2 parents d65af31 + f3e180d commit 1c4d475

File tree

1 file changed

+0
-54
lines changed

1 file changed

+0
-54
lines changed

components/cxx/test/test_cxx.cpp

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -251,60 +251,6 @@ TEST_CASE("c++ exceptions emergency pool", "[cxx] [exceptions] [ignore] [leaks="
251251
#endif
252252
}
253253

254-
255-
#define TIMEOUT 19
256-
257-
#define RECURSION 19
258-
259-
static esp_timer_handle_t crash_timer;
260-
261-
static uint32_t result = 0;
262-
263-
uint32_t calc_fac(uint32_t n) {
264-
if (n == 1 || n == 0) {
265-
return 1;
266-
} else {
267-
return n * calc_fac(n - 1);
268-
}
269-
}
270-
271-
static void timer_cb(void *arg) {
272-
result = calc_fac(RECURSION);
273-
}
274-
275-
// TODO: Not a unit test, refactor to integration test/system test, etc.
276-
TEST_CASE("frequent interrupts don't interfere with c++ exceptions", "[cxx] [exceptions] [leaks=" LEAKS "]")
277-
{// if exception workaround is disabled, this is almost guaranteed to fail
278-
const esp_timer_create_args_t timer_args {
279-
timer_cb,
280-
NULL,
281-
ESP_TIMER_TASK,
282-
"crash_timer"
283-
};
284-
285-
TEST_ESP_OK(esp_timer_create(&timer_args, &crash_timer));
286-
TEST_ESP_OK(esp_timer_start_periodic(crash_timer, TIMEOUT));
287-
288-
for (int i = 0; i < 500; i++) {
289-
bool thrown_value = false;
290-
try {
291-
throw true;
292-
} catch (bool e) {
293-
thrown_value = e;
294-
}
295-
296-
if (thrown_value) {
297-
printf("ex thrown %d\n", i);
298-
} else {
299-
printf("ex not thrown\n");
300-
TEST_ASSERT(false);
301-
}
302-
}
303-
304-
TEST_ESP_OK(esp_timer_stop(crash_timer));
305-
TEST_ESP_OK(esp_timer_delete(crash_timer));
306-
}
307-
308254
#else // !CONFIG_COMPILER_CXX_EXCEPTIONS
309255

310256
TEST_CASE("std::out_of_range exception when -fno-exceptions", "[cxx][reset=abort,SW_CPU_RESET]")

0 commit comments

Comments
 (0)