From: Angus Gratton Date: Wed, 4 Oct 2017 05:00:11 +0000 (+1100) Subject: cxx: Add a sanity check for C++ exception support X-Git-Tag: v3.1-dev~156^2~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a231ba22f320e2b582e21a2089f3c0616822b177;p=esp-idf cxx: Add a sanity check for C++ exception support --- diff --git a/components/cxx/test/test_cxx.cpp b/components/cxx/test/test_cxx.cpp index 7e08e9017e..af73d9ea92 100644 --- a/components/cxx/test/test_cxx.cpp +++ b/components/cxx/test/test_cxx.cpp @@ -188,6 +188,21 @@ TEST_CASE("before scheduler has started, static initializers work correctly", "[ TEST_ASSERT_EQUAL(2, StaticInitTestBeforeScheduler::order); } +TEST_CASE("c++ exceptions work", "[cxx]") +{ + int thrown_value; + try + { + throw 20; + } + catch (int e) + { + thrown_value = e; + } + TEST_ASSERT_EQUAL(20, thrown_value); + printf("OK?\n"); +} + /* These test cases pull a lot of code from libstdc++ and are disabled for now */ #if 0