stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject svn commit: r374953 - in /incubator/stdcxx/trunk/tests/algorithms: 25.lower.bound.cpp 25.upper.bound.cpp
Date Sun, 05 Feb 2006 00:51:42 GMT
Author: sebor
Date: Sat Feb  4 16:51:39 2006
New Revision: 374953

URL: http://svn.apache.org/viewcvs?rev=374953&view=rev
Log:
2006-02-04  Martin Sebor  <sebor@roguewave.com>

	* 25.lower.bound.cpp (test_lower_bound): Corrected the nparam argument
	in the formatting string to account for a change in rw_snprintfa()
	behavior introduced in r371638.
	* 25.upper.bound.cpp (test_upper_bound): Same.

2006-02-04  Anton Pevtsov <antonp@moscow.vdiweb.com>

	* 25.lower.bound.cpp (test_lower_bound): Fixed assertion condition to
	verify the complexity, updated the expected complexity values to meet
	the standard requirements.
	* 25.upper.bound.cpp (test_upper_bound): Same.

Modified:
    incubator/stdcxx/trunk/tests/algorithms/25.lower.bound.cpp
    incubator/stdcxx/trunk/tests/algorithms/25.upper.bound.cpp

Modified: incubator/stdcxx/trunk/tests/algorithms/25.lower.bound.cpp
URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/tests/algorithms/25.lower.bound.cpp?rev=374953&r1=374952&r2=374953&view=diff
==============================================================================
--- incubator/stdcxx/trunk/tests/algorithms/25.lower.bound.cpp (original)
+++ incubator/stdcxx/trunk/tests/algorithms/25.lower.bound.cpp Sat Feb  4 16:51:39 2006
@@ -143,11 +143,11 @@
     const std::size_t funcalls = predicate
         ? LessThan::funcalls_ : X::n_total_op_lt_;
 
-    rw_assert (off == result_off, 0, line,
+    rw_assert (funcalls <= ncomp, 0, line,
                "lower_bound(%s = \"%s\", ...%{?}%#c%{;}) complexity: "
                "invoked predicate at most %zu times, got %zu",
                itname, src_str, !predicate, val_char,
-               funcalls, ncomp);
+               ncomp, funcalls);
 
     delete[] xsrc;
 }
@@ -179,26 +179,26 @@
     TEST ("a", 'b', 1, 1);
     TEST ("b", 'a', 0, 1);
 
-    TEST ("aa", 'a', 0, 1);
-    TEST ("ab", 'a', 0, 1);
+    TEST ("aa", 'a', 0, 2);
+    TEST ("ab", 'a', 0, 2);
     TEST ("ab", 'b', 1, 2);
     TEST ("bb", 'a', 0, 2);
 
-    TEST ("ace", 'a', 0, 1);
-    TEST ("ace", 'b', 1, 2);
-    TEST ("ace", 'c', 1, 2);
+    TEST ("ace", 'a', 0, 3);
+    TEST ("ace", 'b', 1, 3);
+    TEST ("ace", 'c', 1, 3);
     TEST ("ace", 'd', 2, 3);
     TEST ("ace", 'e', 2, 3);
     TEST ("ace", 'f', 3, 3);
 
-    TEST ("aceg", 'a', 0, 1);
-    TEST ("aceg", 'b', 1, 2);
-    TEST ("aceg", 'c', 1, 2);
+    TEST ("aceg", 'a', 0, 3);
+    TEST ("aceg", 'b', 1, 3);
+    TEST ("aceg", 'c', 1, 3);
     TEST ("aceg", 'd', 2, 3);
     TEST ("aceg", 'e', 2, 3);
     TEST ("aceg", 'f', 3, 3);
-    TEST ("aceg", 'g', 3, 4);
-    TEST ("aceg", 'h', 4, 4);
+    TEST ("aceg", 'g', 3, 3);
+    TEST ("aceg", 'h', 4, 3);
 }
 
 /**************************************************************************/
@@ -213,7 +213,7 @@
 test_lower_bound (bool predicate)
 {
     rw_info (0, 0, 0, "template <class %s, class %s%{?}, class %s%{;}> "
-             "std::lower_bound (%1$s, %1$s, const X&%{?}, %3$s%{;})",
+             "std::lower_bound (%1$s, %1$s, const X&%{?}, %4$s%{;})",
              "ForwardIterator", "X", predicate, "Compare", predicate);
 
     if (rw_opt_no_fwd_iter) {

Modified: incubator/stdcxx/trunk/tests/algorithms/25.upper.bound.cpp
URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/tests/algorithms/25.upper.bound.cpp?rev=374953&r1=374952&r2=374953&view=diff
==============================================================================
--- incubator/stdcxx/trunk/tests/algorithms/25.upper.bound.cpp (original)
+++ incubator/stdcxx/trunk/tests/algorithms/25.upper.bound.cpp Sat Feb  4 16:51:39 2006
@@ -153,11 +153,11 @@
     const std::size_t funcalls = predicate
         ? LessThan::funcalls_ : X::n_total_op_lt_;
 
-    rw_assert (off == result_off, 0, line,
+    rw_assert (funcalls <= ncomp, 0, line,
                "upper_bound(%s = \"%s\", ...%{?}%#c%{;}) complexity: "
                "invoked predicate at most %zu times, got %zu",
                itname, src_str, !predicate, val_char,
-               funcalls, ncomp);
+               ncomp, funcalls);
 
     delete[] xsrc;
 }
@@ -192,23 +192,23 @@
     TEST ("aa", 'a', 2, 2);
     TEST ("ab", 'a', 1, 2);
     TEST ("ab", 'b', 2, 2);
-    TEST ("bb", 'a', 0, 1);
+    TEST ("bb", 'a', 0, 2);
 
-    TEST ("ace", 'a', 1, 2);
-    TEST ("ace", 'b', 1, 2);
+    TEST ("ace", 'a', 1, 3);
+    TEST ("ace", 'b', 1, 3);
     TEST ("ace", 'c', 2, 3);
     TEST ("ace", 'd', 2, 3);
     TEST ("ace", 'e', 3, 3);
     TEST ("ace", 'f', 3, 3);
 
-    TEST ("aceg", 'a', 1, 2);
-    TEST ("aceg", 'b', 1, 2);
+    TEST ("aceg", 'a', 1, 3);
+    TEST ("aceg", 'b', 1, 3);
     TEST ("aceg", 'c', 2, 3);
     TEST ("aceg", 'd', 2, 3);
-    TEST ("aceg", 'e', 3, 4);
-    TEST ("aceg", 'f', 3, 4);
-    TEST ("aceg", 'g', 4, 5);
-    TEST ("aceg", 'h', 4, 5);
+    TEST ("aceg", 'e', 3, 3);
+    TEST ("aceg", 'f', 3, 3);
+    TEST ("aceg", 'g', 4, 3);
+    TEST ("aceg", 'h', 4, 3);
 }
 
 /**************************************************************************/
@@ -223,7 +223,7 @@
 test_upper_bound (bool predicate)
 {
     rw_info (0, 0, 0, "template <class %s, class %s%{?}, class %s%{;}> "
-             "std::upper_bound (%1$s, %1$s, const X&%{?}, %3$s%{;})",
+             "std::upper_bound (%1$s, %1$s, const X&%{?}, %4$s%{;})",
              "ForwardIterator", "X", predicate, "Compare", predicate);
 
     if (rw_opt_no_fwd_iter) {



Mime
View raw message