402N/A--- stdcxx-4.2.1/tests/strings/21.string.replace.stdcxx-170.cpp 2011-01-06 23:30:16.580682374 -0500
402N/A+++ stdcxx-4.2.1/tests/strings/21.string.replace.stdcxx-170.cpp 2011-01-26 01:31:44.599748916 -0500
402N/A@@ -0,0 +1,54 @@
402N/A+/************************************************************************
402N/A+*
402N/A+* 21.string.replace.stdcxx-170.cpp - regression test for STDCXX-170
402N/A+*
402N/A+* https://issues.apache.org/jira/browse/STDCXX-170
402N/A+*
402N/A+* $Id: $
402N/A+*
402N/A+***************************************************************************
402N/A+*
402N/A+* Licensed to the Apache Software Foundation (ASF) under one or more
402N/A+* contributor license agreements. See the NOTICE file distributed
402N/A+* with this work for additional information regarding copyright
402N/A+* ownership. The ASF licenses this file to you under the Apache
402N/A+* License, Version 2.0 (the "License"); you may not use this file
402N/A+* except in compliance with the License. You may obtain a copy of
402N/A+* the License at
402N/A+*
402N/A+* http://www.apache.org/licenses/LICENSE-2.0
402N/A+*
402N/A+* Unless required by applicable law or agreed to in writing, software
402N/A+* distributed under the License is distributed on an "AS IS" BASIS,
402N/A+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
402N/A+* implied. See the License for the specific language governing
402N/A+* permissions and limitations under the License.
402N/A+*
402N/A+**************************************************************************/
402N/A+
402N/A+#include <cassert>
402N/A+#include <string>
402N/A+#include <iostream>
402N/A+
402N/A+int main ()
402N/A+{
402N/A+ std::string s ("abc");
402N/A+
402N/A+ s.replace (s.begin (), s.begin (), s.rbegin () + 1, s.rbegin () + 2);
402N/A+
402N/A+ assert ("babc" == s);
402N/A+
402N/A+ std::cout << "1. Expected 'babc', got '" << s.c_str() << "'." << std::endl;
402N/A+
402N/A+ s = "abc";
402N/A+
402N/A+ typedef const unsigned char UChar;
402N/A+ s.replace (s.begin (), s.begin (), (UChar*)&s [1], (UChar*)&s [2]);
402N/A+
402N/A+ assert ("babc" == s);
402N/A+
402N/A+ std::cout << "2. Expected 'babc', got '" << s.c_str() << "'." << std::endl;
402N/A+
402N/A+ return 0;
402N/A+}
402N/A+