]> granicus.if.org Git - esp-idf/commitdiff
cxx: don’t pull libstdc++ local support in unit tests
authorIvan Grokhotkov <ivan@espressif.com>
Thu, 15 Jun 2017 09:58:57 +0000 (17:58 +0800)
committerIvan Grokhotkov <ivan@espressif.com>
Thu, 15 Jun 2017 10:15:36 +0000 (18:15 +0800)
components/cxx/test/test_cxx.cpp

index 3b653361f457d2b7f383e1c8c2b578f11d964239..5d5ff1595c03f103227770eff97e0495408b10cf 100644 (file)
@@ -1,7 +1,5 @@
-#include <functional>
 #include <vector>
 #include <algorithm>
-#include <iostream>
 #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<int(int)> 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<int> 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 <iostream>
+#include <functional>
 
 TEST_CASE("can use iostreams", "[cxx]")
 {
     std::cout << "hello world";
 }
+
+TEST_CASE("can call std::function and bind", "[cxx]")
+{
+    int outer = 1;
+    std::function<int(int)> 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
+