stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject svn commit: r399899 - in /incubator/stdcxx/trunk/tests/strings: 21.string.append.cpp 21.string.assign.cpp 21.string.copy.cpp 21.string.insert.cpp 21.string.op.plus.equal.cpp 21.string.replace.cpp
Date Fri, 05 May 2006 00:43:24 GMT
Author: sebor
Date: Thu May  4 17:43:21 2006
New Revision: 399899

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

	* 21.string.append.cpp (test_append): Corrected compilation errors
	when _RWSTD_NO_EXCEPTIONS is #defined and verified with
	gcc -fno-exceptions.
	* 21.string.assign.cpp (test_assign): Same.
	* 21.string.copy.cpp (test_assign): Same.
	* 21.string.insert.cpp (test_insert): Same.
	* 21.string.plus_equal.cpp (test_op_plus_eq): Same.
	* 21.string.replace.cpp (test_replace): Same.

Modified:
    incubator/stdcxx/trunk/tests/strings/21.string.append.cpp
    incubator/stdcxx/trunk/tests/strings/21.string.assign.cpp
    incubator/stdcxx/trunk/tests/strings/21.string.copy.cpp
    incubator/stdcxx/trunk/tests/strings/21.string.insert.cpp
    incubator/stdcxx/trunk/tests/strings/21.string.op.plus.equal.cpp
    incubator/stdcxx/trunk/tests/strings/21.string.replace.cpp

Modified: incubator/stdcxx/trunk/tests/strings/21.string.append.cpp
URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/tests/strings/21.string.append.cpp?rev=399899&r1=399898&r2=399899&view=diff
==============================================================================
--- incubator/stdcxx/trunk/tests/strings/21.string.append.cpp (original)
+++ incubator/stdcxx/trunk/tests/strings/21.string.append.cpp Thu May  4 17:43:21 2006
@@ -544,10 +544,12 @@
 #  endif   // _RWSTD_NO_REPLACEABLE_NEW_DELETE
 #endif   // _RWSTD_NO_EXCEPTIONS
 
+        // (name of) expected and caught exception
+        const char* expected = 0;
+        const char* caught   = 0;
+
 #ifndef _RWSTD_NO_EXCEPTIONS
 
-        // is some exception expected?
-        const char* expected = 0;
         if (1 == tcase.bthrow && Append (str_size_size) == which)
             expected = exceptions [1];   // out_of_range
         else if (2 == tcase.bthrow)
@@ -555,8 +557,6 @@
         else if (-1 == tcase.bthrow)
             expected = exceptions [3];   // bad_alloc
 
-        const char* caught = 0;
-
 #else   // if defined (_RWSTD_NO_EXCEPTIONS)
 
         if (tcase.bthrow)
@@ -720,9 +720,8 @@
 #  endif   // _RWSTD_NO_REPLACEABLE_NEW_DELETE
 #else   // if defined (_RWSTD_NO_EXCEPTIONS)
 
-    _RWSTD_UNUSED (size);
-    _RWSTD_UNUSED (capacity);
     _RWSTD_UNUSED (throw_after);
+    _RWSTD_UNUSED (pst);
 
 #endif   // _RWSTD_NO_EXCEPTIONS
 

Modified: incubator/stdcxx/trunk/tests/strings/21.string.assign.cpp
URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/tests/strings/21.string.assign.cpp?rev=399899&r1=399898&r2=399899&view=diff
==============================================================================
--- incubator/stdcxx/trunk/tests/strings/21.string.assign.cpp (original)
+++ incubator/stdcxx/trunk/tests/strings/21.string.assign.cpp Thu May  4 17:43:21 2006
@@ -545,10 +545,12 @@
 #  endif   // _RWSTD_NO_REPLACEABLE_NEW_DELETE
 #endif   // _RWSTD_NO_EXCEPTIONS
 
+        // (name of) expected and caught exception
+        const char* expected = 0;
+        const char* caught   = 0;
+
 #ifndef _RWSTD_NO_EXCEPTIONS
 
-        // is some exception expected ?
-        const char* expected = 0;
         if (1 == tcase.bthrow && Assign (str_size_size) == which)
             expected = exceptions [1];   // out_of_range
         if (2 == tcase.bthrow)
@@ -556,8 +558,6 @@
         if (-1 == tcase.bthrow)
             expected = exceptions [3];   // bad_alloc
 
-        const char* caught = 0;
-
 #else   // if defined (_RWSTD_NO_EXCEPTIONS)
 
         if (tcase.bthrow)
@@ -721,8 +721,7 @@
 #  endif   // _RWSTD_NO_REPLACEABLE_NEW_DELETE
 #else   // if defined (_RWSTD_NO_EXCEPTIONS)
 
-    _RWSTD_UNUSED (ssize);
-    _RWSTD_UNUSED (capacity);
+    _RWSTD_UNUSED (pst);
     _RWSTD_UNUSED (throw_after);
 
 #endif   // _RWSTD_NO_EXCEPTIONS

Modified: incubator/stdcxx/trunk/tests/strings/21.string.copy.cpp
URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/tests/strings/21.string.copy.cpp?rev=399899&r1=399898&r2=399899&view=diff
==============================================================================
--- incubator/stdcxx/trunk/tests/strings/21.string.copy.cpp (original)
+++ incubator/stdcxx/trunk/tests/strings/21.string.copy.cpp Thu May  4 17:43:21 2006
@@ -175,12 +175,13 @@
     charT wcgb = make_char (cgb, (charT*)0);
     Traits::assign (s_res, min_len + 1, wcgb);
 
+    // (name of) expected and caught exception
+    const char* expected = 0;
+    const char* caught   = 0;
+
 #ifndef _RWSTD_NO_EXCEPTIONS
 
-    // is some exception expected?
-    const char* const expected =
-        cs.bthrow && use_pos ? exp_exceptions [1] : 0;
-    const char* caught = 0;
+    expected = cs.bthrow && use_pos ? exp_exceptions [1] : 0;
 
     try {
 
@@ -228,7 +229,7 @@
     }
 
 #else   // if defined (_RWSTD_NO_EXCEPTIONS)
-    _RWSTD_UNUSED (should_throw);
+
 #endif   // _RWSTD_NO_EXCEPTIONS
 
     rw_assert (caught == expected, 0, cs.line,

Modified: incubator/stdcxx/trunk/tests/strings/21.string.insert.cpp
URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/tests/strings/21.string.insert.cpp?rev=399899&r1=399898&r2=399899&view=diff
==============================================================================
--- incubator/stdcxx/trunk/tests/strings/21.string.insert.cpp (original)
+++ incubator/stdcxx/trunk/tests/strings/21.string.insert.cpp Thu May  4 17:43:21 2006
@@ -572,8 +572,6 @@
 
     typedef typename UserTraits<charT>::MemFun UTMemFun;
 
-    const bool use_iters = (Insert (val) <= which);
-
     static charT wstr [LLEN];
     static charT warg [LLEN];
 
@@ -629,10 +627,14 @@
 #  endif   // _RWSTD_NO_REPLACEABLE_NEW_DELETE
 #endif   // _RWSTD_NO_EXCEPTIONS
 
+        // (name of) expected and caught exception
+        const char* expected = 0;
+        const char* caught   = 0;
+
 #ifndef _RWSTD_NO_EXCEPTIONS
 
-        // is some exception expected ?
-        const char* expected = 0;
+        const bool use_iters = (Insert (val) <= which);
+
         if (1 == tcase.bthrow && !use_iters)
             expected = exceptions [1];      // out_of_range
         if (2 == tcase.bthrow && Insert (size_str_size_size) == which)
@@ -642,7 +644,10 @@
         if (-1 == tcase.bthrow)
             expected = exceptions [3];      // bad_alloc
 
-        const char* caught = 0;
+#else   // if defined (_RWSTD_NO_EXCEPTIONS)
+
+        if (tcase.bthrow)
+            return;
 
 #endif   // _RWSTD_NO_EXCEPTIONS
 
@@ -818,8 +823,7 @@
 #  endif   // _RWSTD_NO_REPLACEABLE_NEW_DELETE
 #else   // if defined (_RWSTD_NO_EXCEPTIONS)
 
-    _RWSTD_UNUSED (size);
-    _RWSTD_UNUSED (capacity);
+    _RWSTD_UNUSED (pst);
     _RWSTD_UNUSED (throw_after);
 
 #endif   // _RWSTD_NO_EXCEPTIONS

Modified: incubator/stdcxx/trunk/tests/strings/21.string.op.plus.equal.cpp
URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/tests/strings/21.string.op.plus.equal.cpp?rev=399899&r1=399898&r2=399899&view=diff
==============================================================================
--- incubator/stdcxx/trunk/tests/strings/21.string.op.plus.equal.cpp (original)
+++ incubator/stdcxx/trunk/tests/strings/21.string.op.plus.equal.cpp Thu May  4 17:43:21 2006
@@ -279,17 +279,17 @@
 #  endif   // _RWSTD_NO_REPLACEABLE_NEW_DELETE
 #endif   // _RWSTD_NO_EXCEPTIONS
 
+        // (name of) expected and caught exception
+        const char* expected = 0;
+        const char* caught   = 0;
+
 #ifndef _RWSTD_NO_EXCEPTIONS
 
-        // is some exception expected ?
-        const char* expected = 0;
         if (1 == tcase.bthrow)
             expected = exceptions [2];      // length_error
         if (-1 == tcase.bthrow)
             expected = exceptions [3];      // bad_alloc
 
-        const char* caught = 0;
-
 #else   // if defined (_RWSTD_NO_EXCEPTIONS)
 
         if (tcase.bthrow)
@@ -432,8 +432,7 @@
 #  endif   // _RWSTD_NO_REPLACEABLE_NEW_DELETE
 #else   // if defined (_RWSTD_NO_EXCEPTIONS)
 
-    _RWSTD_UNUSED (size);
-    _RWSTD_UNUSED (capacity);
+    _RWSTD_UNUSED (pst);
     _RWSTD_UNUSED (throw_after);
 
 #endif   // _RWSTD_NO_EXCEPTIONS

Modified: incubator/stdcxx/trunk/tests/strings/21.string.replace.cpp
URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/tests/strings/21.string.replace.cpp?rev=399899&r1=399898&r2=399899&view=diff
==============================================================================
--- incubator/stdcxx/trunk/tests/strings/21.string.replace.cpp (original)
+++ incubator/stdcxx/trunk/tests/strings/21.string.replace.cpp Thu May  4 17:43:21 2006
@@ -752,10 +752,12 @@
 #  endif   // _RWSTD_NO_REPLACEABLE_NEW_DELETE
 #endif   // _RWSTD_NO_EXCEPTIONS
 
+        // (name of) expected and caught exception
+        const char* expected = 0;
+        const char* caught   = 0;
+
 #ifndef _RWSTD_NO_EXCEPTIONS
 
-        // is some exception expected ?
-        const char* expected = 0;
         if (1 == tcase.bthrow && !use_iters)
             expected = exceptions [1];      // out_of_range
         if (2 == tcase.bthrow && Replace (size_size_str_size_size) == which)
@@ -765,8 +767,6 @@
         if (-1 == tcase.bthrow)
             expected = exceptions [3];      // bad_alloc
 
-        const char* caught = 0;
-
 #else   // if defined (_RWSTD_NO_EXCEPTIONS)
 
         if (tcase.bthrow)
@@ -967,8 +967,7 @@
 #  endif   // _RWSTD_NO_REPLACEABLE_NEW_DELETE
 #else   // if defined (_RWSTD_NO_EXCEPTIONS)
 
-    _RWSTD_UNUSED (ssize);
-    _RWSTD_UNUSED (capacity);
+    _RWSTD_UNUSED (pst);
     _RWSTD_UNUSED (throw_after);
 
 #endif   // _RWSTD_NO_EXCEPTIONS



Mime
View raw message