complexity.cc: Add missing test variable.
authorFrançois Dumont <fdumont@gcc.gnu.org>
Thu, 23 Oct 2014 22:03:49 +0000 (22:03 +0000)
committerFrançois Dumont <fdumont@gcc.gnu.org>
Thu, 23 Oct 2014 22:03:49 +0000 (22:03 +0000)
2014-10-23  François Dumont  <fdumont@gcc.gnu.org>

* testsuite/25_algorithms/make_heap/complexity.cc: Add missing test
variable.
* testsuite/25_algorithms/sort_heap/complexity.cc: Likewise and use
log2. Now require cmath support.
* testsuite/25_algorithms/pop_heap/complexity.cc: Likewise and require
normal mode.
* testsuite/25_algorithms/push_heap/complexity.cc: Likewise.

From-SVN: r216601

libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/25_algorithms/make_heap/complexity.cc
libstdc++-v3/testsuite/25_algorithms/pop_heap/complexity.cc
libstdc++-v3/testsuite/25_algorithms/push_heap/complexity.cc
libstdc++-v3/testsuite/25_algorithms/sort_heap/complexity.cc

index 1495a6e83d265dad6c3feaaee7b3d5ed82d666a9..0e230ca40d268ab8b1c6beca6c527c8b99b1b9be 100644 (file)
@@ -1,3 +1,13 @@
+2014-10-23  François Dumont  <fdumont@gcc.gnu.org>
+
+       * testsuite/25_algorithms/make_heap/complexity.cc: Add missing test
+       variable.
+       * testsuite/25_algorithms/sort_heap/complexity.cc: Likewise and use
+       log2. Now require cmath support.
+       * testsuite/25_algorithms/pop_heap/complexity.cc: Likewise and require
+       normal mode.
+       * testsuite/25_algorithms/push_heap/complexity.cc: Likewise.
+
 2014-10-23  Jonathan Wakely  <jwakely@redhat.com>
 
        * doc/xml/manual/status_cxx2011.xml: Update status.
index cfe1a7a659f6b2995dbca60f5af6ce714f9ee55e..97c1df343f2c07b5a68986175716252c5f7a1548 100644 (file)
@@ -26,6 +26,8 @@
 
 void test01()
 {
+  bool test __attribute__((unused)) = true;
+
   using __gnu_test::counter_type;
   const std::size_t nb_values = 1000;
 
index 75ed37e665ea446e08f883a8058f90b5be8eb1a8..dea99ca3b98b793c70a41a0c6ec4f3fe9b72b777 100644 (file)
@@ -15,6 +15,8 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
+// { dg-require-normal-mode "" }
+// { dg-require-cmath "" }
 // { dg-options "-std=gnu++11" }
 
 #include <cmath>
@@ -27,6 +29,8 @@
 
 void test01()
 {
+  bool test __attribute__((unused)) = true;
+
   using __gnu_test::counter_type;
   const std::size_t nb_values = 1000;
 
@@ -43,7 +47,7 @@ void test01()
 
   std::pop_heap(values.begin(), values.end());
 
-  VERIFY( counter_type::less_compare_count <= 2.0 * std::log(nb_values) );
+  VERIFY( counter_type::less_compare_count <= 2.0 * std::log2(nb_values) );
 }
 
 int main()
index 90c445710cce7e0d2f4daa703b8a92c6c9cfd7c8..a110b0fd2327db0024e0649c9975fddb29eacb90 100644 (file)
@@ -15,6 +15,8 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
+// { dg-require-normal-mode "" }
+// { dg-require-cmath "" }
 // { dg-options "-std=gnu++11" }
 
 #include <cmath>
@@ -27,6 +29,8 @@
 
 void test01()
 {
+  bool test __attribute__((unused)) = true;
+
   using __gnu_test::counter_type;
   const std::size_t nb_values = 1000;
 
@@ -44,7 +48,7 @@ void test01()
 
   std::push_heap(values.begin(), values.end());
 
-  VERIFY( counter_type::less_compare_count <= std::log(values.size()) );
+  VERIFY( counter_type::less_compare_count <= std::log2(values.size()) );
 }
 
 int main()
index b847e279aec6a5aba5e91ec24ca24631d0959bb4..34de48e150ba41f12b296f0388bf217833a06151 100644 (file)
@@ -15,6 +15,7 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
+// { dg-require-cmath "" }
 // { dg-options "-std=gnu++11" }
 
 #include <cmath>
@@ -27,6 +28,8 @@
 
 void test01()
 {
+  bool test __attribute__((unused)) = true;
+
   using __gnu_test::counter_type;
   const std::size_t nb_values = 1000;
 
@@ -43,7 +46,7 @@ void test01()
 
   std::sort_heap(values.begin(), values.end());
 
-  VERIFY( counter_type::less_compare_count <= 2.0 * nb_values * std::log(nb_values) );
+  VERIFY( counter_type::less_compare_count <= 2.0 * nb_values * std::log2(nb_values) );
 }
 
 int main()