stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject svn commit: r407398 - /incubator/stdcxx/trunk/tests/strings/21.string.replace.cpp
Date Wed, 17 May 2006 23:27:10 GMT
Author: sebor
Date: Wed May 17 16:27:10 2006
New Revision: 407398

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

	* 21.string.replace.cpp (test_replace): Corrected the formatting
	of expected result string.
	(test_replace): Used rw_check_leaks() to simplify the detection
	of memory leaks using the user-defined allocator UserAlloc as
	well as replacement operator new (when available).

Modified:
    incubator/stdcxx/trunk/tests/strings/21.string.replace.cpp

Modified: incubator/stdcxx/trunk/tests/strings/21.string.replace.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/strings/21.string.replace.cpp?rev=407398&r1=407397&r2=407398&view=diff
==============================================================================
--- incubator/stdcxx/trunk/tests/strings/21.string.replace.cpp (original)
+++ incubator/stdcxx/trunk/tests/strings/21.string.replace.cpp Wed May 17 16:27:10 2006
@@ -915,7 +915,7 @@
 #endif   // _RWSTD_NO_EXCEPTIONS
 
         // start checking for memory leaks
-        rwt_check_leaks (0, 0);
+        rw_check_leaks (str.get_allocator ());
 
         try {
             switch (which) {
@@ -974,9 +974,9 @@
 
             // verfiy that the length of the resulting string
             rw_assert (res_len == str.size (), 0, tcase.line,
-                       "line %d. %{$FUNCALL} expected %{#*s} with length "
+                       "line %d. %{$FUNCALL} expected %{/*.*Gs} with length "
                        "%zu, got %{/*.*Gs} with length %zu",
-                       __LINE__, int (res_len), tcase.res, 
+                       __LINE__, int (sizeof (charT)), int (res_len), wres, 
                        res_len, int (sizeof (charT)), 
                        int (str.size ()), str.c_str (), str.size ());
 
@@ -1043,16 +1043,10 @@
 
 #endif   // _RWSTD_NO_EXCEPTIONS
 
-        /* const */ std::size_t nbytes;
-        const       std::size_t nblocks = rwt_check_leaks (&nbytes, 0);
-
         // FIXME: verify the number of blocks the function call
         // is expected to allocate and detect any memory leaks
-        const std::size_t expect_blocks = nblocks;
-
-        rw_assert (nblocks == expect_blocks, 0, tcase.line,
-                   "line %d. %{$FUNCALL} allocated %td bytes in %td blocks",
-                   __LINE__, nbytes, expect_blocks);
+        rw_check_leaks (str.get_allocator (), tcase.line,
+                        std::size_t (-1), std::size_t (-1));
 
         if (caught) {
             // verify that an exception thrown during allocation



Mime
View raw message