From 6538ebe8ad97d3fd01dd9b1dbb57e6219ce4c99a Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Thu, 15 Jun 2017 17:58:57 +0800 Subject: [PATCH] =?UTF-8?q?cxx:=20don=E2=80=99t=20pull=20libstdc++=20local?= =?UTF-8?q?=20support=20in=20unit=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/cxx/test/test_cxx.cpp | 38 ++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/components/cxx/test/test_cxx.cpp b/components/cxx/test/test_cxx.cpp index 3b653361f..5d5ff1595 100644 --- a/components/cxx/test/test_cxx.cpp +++ b/components/cxx/test/test_cxx.cpp @@ -1,7 +1,5 @@ -#include #include #include -#include #include "unity.h" #include "esp_log.h" #include "freertos/FreeRTOS.h" @@ -59,20 +57,6 @@ TEST_CASE("can use static initializers for non-POD types", "[cxx]") TEST_ASSERT_EQUAL(1, non_pod_test_helper(0)); } -TEST_CASE("can call std::function and bind", "[cxx]") -{ - int outer = 1; - std::function fn = [&outer](int x) -> int { - return x + outer; - }; - outer = 5; - TEST_ASSERT_EQUAL(6, fn(1)); - - auto bound = std::bind(fn, outer); - outer = 10; - TEST_ASSERT_EQUAL(15, bound()); -} - TEST_CASE("can use std::vector", "[cxx]") { std::vector v(10, 1); @@ -203,8 +187,30 @@ TEST_CASE("before scheduler has started, static initializers work correctly", "[ TEST_ASSERT_EQUAL(2, StaticInitTestBeforeScheduler::order); } +/* These test cases pull a lot of code from libstdc++ and are disabled for now + */ +#if 0 +#include +#include TEST_CASE("can use iostreams", "[cxx]") { std::cout << "hello world"; } + +TEST_CASE("can call std::function and bind", "[cxx]") +{ + int outer = 1; + std::function fn = [&outer](int x) -> int { + return x + outer; + }; + outer = 5; + TEST_ASSERT_EQUAL(6, fn(1)); + + auto bound = std::bind(fn, outer); + outer = 10; + TEST_ASSERT_EQUAL(15, bound()); +} + +#endif +