You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stdcxx.apache.org by an...@apache.org on 2006/05/18 10:25:18 UTC
svn commit: r407501 - /incubator/stdcxx/trunk/tests/strings/
Author: antonp
Date: Thu May 18 01:25:17 2006
New Revision: 407501
URL: http://svn.apache.org/viewvc?rev=407501&view=rev
Log:
2006-05-18 Anton Pevtsov <an...@moscow.vdiweb.com>
* 21.string.append.cpp (<rw_allocator.h>): Included.
(test_append_range, test_append): Added Allocator template
parameter and function argument.
(DEFINE_STRING_TEST_DISPATCH): Replaced DEFINE_TEST_DISPATCH.
* 21.string.access.cpp: Same
* 21.string.assing.cpp: Same
* 21.string.compare.cpp: Same
* 21.string.cons.cpp: Same
* 21.string.copy.cpp: Same
* 21.string.erase.cpp: Same
* 21.string.find.cpp: Same
* 21.string.find.first.not.of.cpp: Same
* 21.string.find.first.of.cpp: Same
* 21.string.find.last.not.of.cpp: Same
* 21.string.find.last.of.cpp: Same
* 21.string.insert.cpp: Same
* 21.string.op.plus.equal.cpp: Same
* 21.string.rfind.cpp: Same
* 21.string.substr.cpp: Same
* 21.string.swap.cpp: Same
Modified:
incubator/stdcxx/trunk/tests/strings/21.string.access.cpp
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.compare.cpp
incubator/stdcxx/trunk/tests/strings/21.string.cons.cpp
incubator/stdcxx/trunk/tests/strings/21.string.copy.cpp
incubator/stdcxx/trunk/tests/strings/21.string.erase.cpp
incubator/stdcxx/trunk/tests/strings/21.string.find.cpp
incubator/stdcxx/trunk/tests/strings/21.string.find.first.not.of.cpp
incubator/stdcxx/trunk/tests/strings/21.string.find.first.of.cpp
incubator/stdcxx/trunk/tests/strings/21.string.find.last.not.of.cpp
incubator/stdcxx/trunk/tests/strings/21.string.find.last.of.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.rfind.cpp
incubator/stdcxx/trunk/tests/strings/21.string.substr.cpp
incubator/stdcxx/trunk/tests/strings/21.string.swap.cpp
Modified: incubator/stdcxx/trunk/tests/strings/21.string.access.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/strings/21.string.access.cpp?rev=407501&r1=407500&r2=407501&view=diff
==============================================================================
--- incubator/stdcxx/trunk/tests/strings/21.string.access.cpp (original)
+++ incubator/stdcxx/trunk/tests/strings/21.string.access.cpp Thu May 18 01:25:17 2006
@@ -19,13 +19,14 @@
*
**************************************************************************/
-#include <string> // for string
-#include <cstdlib> // for free(), size_t
-#include <stdexcept> // for out_of_range
-
-#include <21.strings.h> // for StringMembers
-#include <driver.h> // for rw_test()
-#include <rw_char.h> // for rw_expand()
+#include <string> // for string
+#include <cstdlib> // for free(), size_t
+#include <stdexcept> // for out_of_range
+
+#include <21.strings.h> // for StringMembers
+#include <driver.h> // for rw_test()
+#include <rw_allocator.h> // for UserAlloc
+#include <rw_char.h> // for rw_expand()
/**************************************************************************/
@@ -201,12 +202,11 @@
/**************************************************************************/
-template <class charT, class Traits>
-void test_access (charT, Traits*,
+template <class charT, class Traits, class Allocator>
+void test_access (charT, Traits*, Allocator*,
OverloadId which,
const TestCase &cs)
{
- typedef std::allocator<charT> Allocator;
typedef std::basic_string <charT, Traits, Allocator> String;
typedef typename String::reference StrRef;
typedef typename String::const_reference StrConstRef;
@@ -321,7 +321,7 @@
/**************************************************************************/
-DEFINE_TEST_DISPATCH (test_access);
+DEFINE_STRING_TEST_DISPATCH (test_access);
int main (int argc, char** argv)
{
Modified: incubator/stdcxx/trunk/tests/strings/21.string.append.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/strings/21.string.append.cpp?rev=407501&r1=407500&r2=407501&view=diff
==============================================================================
--- incubator/stdcxx/trunk/tests/strings/21.string.append.cpp (original)
+++ incubator/stdcxx/trunk/tests/strings/21.string.append.cpp Thu May 18 01:25:17 2006
@@ -32,6 +32,7 @@
#include <21.strings.h> // for StringMembers
#include <alg_test.h> // for InputIter
#include <driver.h> // for rw_test()
+#include <rw_allocator.h> // for UserAlloc
#include <rw_char.h> // for rw_expand()
#include <rw_new.h> // for bad_alloc, replacement operator new
@@ -434,17 +435,17 @@
/**************************************************************************/
-template <class charT, class Traits, class Iterator>
+template <class charT, class Traits, class Allocator, class Iterator>
void test_append_range (const charT *wstr,
std::size_t wstr_len,
const charT *warg,
std::size_t warg_len,
std::size_t res_len,
- Traits*,
+ Traits*,
+ Allocator*,
const Iterator &it,
const TestCase &tcase)
{
- typedef std::allocator<charT> Allocator;
typedef std::basic_string <charT, Traits, Allocator> String;
typedef typename String::iterator StringIter;
@@ -498,20 +499,21 @@
/**************************************************************************/
-template <class charT, class Traits>
+template <class charT, class Traits, class Allocator>
void test_append_range (const charT *wstr,
std::size_t wstr_len,
const charT *warg,
std::size_t warg_len,
std::size_t res_len,
Traits*,
+ Allocator*,
const TestCase &tcase)
{
if (tcase.bthrow) // this method doesn't throw
return;
test_append_range (wstr, wstr_len, warg, warg_len, res_len, (Traits*)0,
- InputIter<charT>(0, 0, 0), tcase);
+ (Allocator*)0, InputIter<charT>(0, 0, 0), tcase);
// there is no need to call test_append_range
// for other iterators in this case
@@ -519,23 +521,23 @@
return;
test_append_range (wstr, wstr_len, warg, warg_len, res_len, (Traits*)0,
- ConstFwdIter<charT>(0, 0, 0), tcase);
+ (Allocator*)0, ConstFwdIter<charT>(0, 0, 0), tcase);
test_append_range (wstr, wstr_len, warg, warg_len, res_len, (Traits*)0,
- ConstBidirIter<charT>(0, 0, 0), tcase);
+ (Allocator*)0, ConstBidirIter<charT>(0, 0, 0), tcase);
- test_append_range (wstr, wstr_len, warg, warg_len, res_len, (Traits*)0,
+ test_append_range (wstr, wstr_len, warg, warg_len, res_len,
+ (Traits*)0, (Allocator*)0,
ConstRandomAccessIter<charT>(0, 0, 0), tcase);
}
/**************************************************************************/
-template <class charT, class Traits>
-void test_append (charT, Traits*,
+template <class charT, class Traits, class Allocator>
+void test_append (charT, Traits*, Allocator*,
OverloadId which,
const TestCase &tcase)
{
- typedef std::allocator<charT> Allocator;
typedef std::basic_string <charT, Traits, Allocator> String;
typedef typename String::iterator StringIter;
typedef typename UserTraits<charT>::MemFun UTMemFun;
@@ -557,8 +559,9 @@
// special processing for append_range to exercise all iterators
if (Append (range) == which) {
- test_append_range (wstr, str_len, warg, arg_len,
- res_len, (Traits*)0, tcase);
+ test_append_range (wstr, str_len, warg, arg_len, res_len,
+ (Traits*)0, (Allocator*)0, tcase);
+
if (wstr != wstr_buf)
delete[] wstr;
@@ -803,7 +806,7 @@
/**************************************************************************/
-DEFINE_TEST_DISPATCH (test_append);
+DEFINE_STRING_TEST_DISPATCH (test_append);
int main (int argc, char** argv)
{
Modified: incubator/stdcxx/trunk/tests/strings/21.string.assign.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/strings/21.string.assign.cpp?rev=407501&r1=407500&r2=407501&view=diff
==============================================================================
--- incubator/stdcxx/trunk/tests/strings/21.string.assign.cpp (original)
+++ incubator/stdcxx/trunk/tests/strings/21.string.assign.cpp Thu May 18 01:25:17 2006
@@ -32,13 +32,14 @@
#include <21.strings.h> // for StringMembers
#include <alg_test.h> // for InputIter
#include <driver.h> // for rw_test()
+#include <rw_allocator.h> // for UserAlloc
#include <rw_char.h> // for rw_expand()
#include <rw_new.h> // for bad_alloc, replacement operator new
/**************************************************************************/
// for convenience and brevity
-#define Assign(which) StringMembers::assign_ ## which
+#define Assign(which) StringMembers::assign_ ## which
typedef StringMembers::OverloadId AssignOverload;
typedef StringMembers::TestCase TestCase;
@@ -395,17 +396,17 @@
/**************************************************************************/
-template <class charT, class Traits, class Iterator>
+template <class charT, class Traits, class Allocator, class Iterator>
void test_assign_range (const charT *wstr,
std::size_t wstr_len,
const charT *warg,
std::size_t warg_len,
std::size_t res_len,
Traits*,
+ Allocator*,
const Iterator &it,
const TestCase &tcase)
{
- typedef std::allocator<charT> Allocator;
typedef std::basic_string <charT, Traits, Allocator> String;
typedef typename String::iterator StringIter;
@@ -459,20 +460,21 @@
/**************************************************************************/
-template <class charT, class Traits>
+template <class charT, class Traits, class Allocator>
void test_assign_range (const charT *wstr,
std::size_t wstr_len,
const charT *warg,
std::size_t warg_len,
std::size_t res_len,
Traits*,
+ Allocator*,
const TestCase &tcase)
{
if (tcase.bthrow) // this method doesn't throw
return;
test_assign_range (wstr, wstr_len, warg, warg_len, res_len, (Traits*)0,
- InputIter<charT>(0, 0, 0), tcase);
+ (Allocator*)0, InputIter<charT>(0, 0, 0), tcase);
// there is no need to call test_assign_range
// for other iterators in this case
@@ -480,23 +482,23 @@
return;
test_assign_range (wstr, wstr_len, warg, warg_len, res_len, (Traits*)0,
- ConstFwdIter<charT>(0, 0, 0), tcase);
+ (Allocator*)0, ConstFwdIter<charT>(0, 0, 0), tcase);
test_assign_range (wstr, wstr_len, warg, warg_len, res_len, (Traits*)0,
- ConstBidirIter<charT>(0, 0, 0), tcase);
+ (Allocator*)0, ConstBidirIter<charT>(0, 0, 0), tcase);
- test_assign_range (wstr, wstr_len, warg, warg_len, res_len, (Traits*)0,
+ test_assign_range (wstr, wstr_len, warg, warg_len, res_len,
+ (Traits*)0, (Allocator*)0,
ConstRandomAccessIter<charT>(0, 0, 0), tcase);
}
/**************************************************************************/
-template <class charT, class Traits>
-void test_assign (charT, Traits*,
+template <class charT, class Traits, class Allocator>
+void test_assign (charT, Traits*, Allocator*,
AssignOverload which,
const TestCase &tcase)
{
- typedef std::allocator<charT> Allocator;
typedef std::basic_string <charT, Traits, Allocator> String;
typedef typename String::iterator StringIter;
typedef typename UserTraits<charT>::MemFun UTMemFun;
@@ -519,7 +521,7 @@
// special processing for assign_range to exercise all iterators
if (Assign (range) == which) {
test_assign_range (wstr, str_len, warg, arg_len,
- res_len, (Traits*)0, tcase);
+ res_len, (Traits*)0, (Allocator*)0, tcase);
if (wstr != wstr_buf)
delete[] wstr;
@@ -762,7 +764,7 @@
/**************************************************************************/
-DEFINE_TEST_DISPATCH (test_assign);
+DEFINE_STRING_TEST_DISPATCH (test_assign);
int main (int argc, char** argv)
{
Modified: incubator/stdcxx/trunk/tests/strings/21.string.compare.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/strings/21.string.compare.cpp?rev=407501&r1=407500&r2=407501&view=diff
==============================================================================
--- incubator/stdcxx/trunk/tests/strings/21.string.compare.cpp (original)
+++ incubator/stdcxx/trunk/tests/strings/21.string.compare.cpp Thu May 18 01:25:17 2006
@@ -25,19 +25,20 @@
*
**************************************************************************/
-#include <string> // for string
-#include <cstddef> // for size_t
-#include <stdexcept> // for out_of_range, length_error
-
-#include <21.strings.h> // for StringMembers
-#include <driver.h> // for rw_assert()
-#include <rw_char.h> // for rw_expand()
+#include <string> // for string
+#include <cstddef> // for size_t
+#include <stdexcept> // for out_of_range, length_error
+
+#include <21.strings.h> // for StringMembers
+#include <driver.h> // for rw_assert()
+#include <rw_allocator.h> // for UserAlloc
+#include <rw_char.h> // for rw_expand()
/**************************************************************************/
// for convenience and brevity
-#define NPOS _RWSTD_SIZE_MAX
-#define Compare(which) StringMembers::compare_ ## which
+#define NPOS _RWSTD_SIZE_MAX
+#define Compare(which) StringMembers::compare_ ## which
typedef StringMembers::OverloadId OverloadId;
typedef StringMembers::TestCase TestCase;
@@ -696,12 +697,11 @@
/**************************************************************************/
-template <class charT, class Traits>
-void test_compare (charT, Traits*,
+template <class charT, class Traits, class Allocator>
+void test_compare (charT, Traits*, Allocator*,
OverloadId which,
const TestCase &tcase)
{
- typedef std::allocator<charT> Allocator;
typedef std::basic_string <charT, Traits, Allocator> String;
typedef typename UserTraits<charT>::MemFun UTMemFun;
@@ -871,7 +871,7 @@
/**************************************************************************/
-DEFINE_TEST_DISPATCH (test_compare);
+DEFINE_STRING_TEST_DISPATCH (test_compare);
int main (int argc, char** argv)
{
Modified: incubator/stdcxx/trunk/tests/strings/21.string.cons.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/strings/21.string.cons.cpp?rev=407501&r1=407500&r2=407501&view=diff
==============================================================================
--- incubator/stdcxx/trunk/tests/strings/21.string.cons.cpp (original)
+++ incubator/stdcxx/trunk/tests/strings/21.string.cons.cpp Thu May 18 01:25:17 2006
@@ -19,17 +19,18 @@
*
**************************************************************************/
-#include <string> // for string
-#include <stdexcept> // for out_of_range, length_error
-#include <cstddef> // for size_t
+#include <string> // for string
+#include <stdexcept> // for out_of_range, length_error
+#include <cstddef> // for size_t
#include <21.strings.h>
-#include <alg_test.h> // for InputIter
-#include <cmdopt.h> // for rw_enabled()
-#include <driver.h> // for rw_test()
-#include <rw_char.h> // for rw_expand()
-#include <rw_new.h> // for bad_alloc, replacement operator new
-#include <rw_printf.h> // for rw_asnprintf()
+#include <alg_test.h> // for InputIter
+#include <cmdopt.h> // for rw_enabled()
+#include <driver.h> // for rw_test()
+#include <rw_allocator.h> // for UserAlloc
+#include <rw_char.h> // for rw_expand()
+#include <rw_new.h> // for bad_alloc, replacement operator new
+#include <rw_printf.h> // for rw_asnprintf()
/**************************************************************************/
@@ -461,15 +462,14 @@
/**************************************************************************/
-template <class charT, class Traits, class Iterator>
+template <class charT, class Traits, class Allocator, class Iterator>
void test_ctor_range (const charT* warg,
std::size_t warg_len,
std::size_t res_len,
- Traits*,
+ Traits*, Allocator*,
const Iterator &it,
const TestCase &tcase)
{
- typedef std::allocator<charT> Allocator;
typedef std::basic_string <charT, Traits, Allocator> String;
typedef typename String::iterator StringIter;
@@ -500,37 +500,36 @@
/**************************************************************************/
-template <class charT, class Traits>
+template <class charT, class Traits, class Allocator>
void test_ctor_range (const charT* warg,
std::size_t warg_len,
std::size_t res_len,
- Traits*,
+ Traits*, Allocator*,
const TestCase &tcase)
{
if (tcase.bthrow) // this method doesn't throw
return;
- test_ctor_range (warg, warg_len, res_len, (Traits*)0,
+ test_ctor_range (warg, warg_len, res_len, (Traits*)0, (Allocator*)0,
InputIter<charT>(0, 0, 0), tcase);
- test_ctor_range (warg, warg_len, res_len, (Traits*)0,
+ test_ctor_range (warg, warg_len, res_len, (Traits*)0, (Allocator*)0,
ConstFwdIter<charT>(0, 0, 0), tcase);
- test_ctor_range (warg, warg_len, res_len, (Traits*)0,
+ test_ctor_range (warg, warg_len, res_len, (Traits*)0, (Allocator*)0,
ConstBidirIter<charT>(0, 0, 0), tcase);
- test_ctor_range (warg, warg_len, res_len, (Traits*)0,
+ test_ctor_range (warg, warg_len, res_len, (Traits*)0, (Allocator*)0,
ConstRandomAccessIter<charT>(0, 0, 0), tcase);
}
/**************************************************************************/
-template <class charT, class Traits>
-void test_ctor (charT, Traits*,
+template <class charT, class Traits, class Allocator>
+void test_ctor (charT, Traits*, Allocator*,
OverloadId which,
const TestCase &tcase)
{
- typedef std::allocator<charT> Allocator;
typedef std::basic_string <charT, Traits, Allocator> String;
static const std::size_t BUFSIZE = 256;
@@ -543,9 +542,9 @@
std::size_t res_len = sizeof wres_buf / sizeof *wres_buf;
charT* wres = rw_expand (wres_buf, tcase.res, tcase.nres, &res_len);
- // special processing for ctor_range to exercise all iterators
if (Ctor (range) == which) {
- test_ctor_range (warg, arg_len, res_len, (Traits*)0, tcase);
+ test_ctor_range (warg, arg_len, res_len,
+ (Traits*)0, (Allocator*)0, tcase);
if (warg != warg_buf)
delete[] warg;
@@ -558,7 +557,7 @@
// construct the string object to be modified
// and the (possibly unused) argument string
- const String arg (warg, arg_len);
+ const String arg (warg, arg_len, Allocator ());
if (warg != warg_buf)
delete[] warg;
@@ -604,11 +603,11 @@
try {
switch (which) {
case Ctor (void): {
- ret_ptr = new String ();
+ ret_ptr = new String (Allocator ());
break;
}
case Ctor (ptr): {
- ret_ptr = new String (arg_ptr);
+ ret_ptr = new String (arg_ptr, Allocator ());
break;
}
case Ctor (str): {
@@ -616,7 +615,7 @@
break;
}
case Ctor (ptr_size): {
- ret_ptr = new String (arg_ptr, arg_size);
+ ret_ptr = new String (arg_ptr, arg_size, Allocator ());
break;
}
case Ctor (str_size): {
@@ -624,11 +623,11 @@
break;
}
case Ctor (str_size_size): {
- ret_ptr = new String (arg_str, arg_off, arg_size);
+ ret_ptr = new String (arg_str, arg_off, arg_size, Allocator ());
break;
}
case Ctor (size_val): {
- ret_ptr = new String (tcase.size, arg_val);
+ ret_ptr = new String (tcase.size, arg_val, Allocator ());
break;
}
@@ -737,12 +736,11 @@
/**************************************************************************/
-template <class charT, class Traits>
-void test_op_set (charT, Traits*,
+template <class charT, class Traits, class Allocator>
+void test_op_set (charT, Traits*, Allocator*,
OverloadId which,
const TestCase &tcase)
{
- typedef std::allocator<charT> Allocator;
typedef std::basic_string <charT, Traits, Allocator> String;
typedef typename UserTraits<charT>::MemFun UTMemFun;
@@ -759,8 +757,8 @@
// construct the string object to be modified
// and the (possibly unused) argument string
- /* const */ String str (wstr, str_len);
- const String arg (warg, arg_len);
+ /* const */ String str (wstr, str_len, Allocator ());
+ const String arg (warg, arg_len, Allocator ());
if (wstr != wstr_buf)
delete[] wstr;
@@ -955,20 +953,20 @@
/**************************************************************************/
-template <class charT, class Traits>
-void test_cons (charT, Traits*,
+template <class charT, class Traits, class Allocator>
+void test_cons (charT, Traits*, Allocator*,
OverloadId which,
const TestCase &tcase)
{
if (OpSet(ptr) <= which)
- test_op_set (charT (), (Traits*)0, which, tcase);
+ test_op_set (charT (), (Traits*)0, (Allocator*)0, which, tcase);
else
- test_ctor (charT (), (Traits*)0, which, tcase);
+ test_ctor (charT (), (Traits*)0, (Allocator*)0, which, tcase);
}
/**************************************************************************/
-DEFINE_TEST_DISPATCH (test_cons);
+DEFINE_STRING_TEST_DISPATCH (test_cons);
int main (int argc, char** argv)
{
Modified: incubator/stdcxx/trunk/tests/strings/21.string.copy.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/strings/21.string.copy.cpp?rev=407501&r1=407500&r2=407501&view=diff
==============================================================================
--- incubator/stdcxx/trunk/tests/strings/21.string.copy.cpp (original)
+++ incubator/stdcxx/trunk/tests/strings/21.string.copy.cpp Thu May 18 01:25:17 2006
@@ -25,20 +25,20 @@
*
**************************************************************************/
-#include <string> // for string
-#include <cstddef> // size_t
-#include <stdexcept> // for out_of_range
-
-#include <21.strings.h> // for StringMembers
-#include <driver.h> // for rw_assert()
-#include <rw_char.h> // for rw_expand()
+#include <string> // for string
+#include <cstddef> // size_t
+#include <stdexcept> // for out_of_range
+
+#include <21.strings.h> // for StringMembers
+#include <driver.h> // for rw_assert()
+#include <rw_allocator.h> // for UserAlloc
+#include <rw_char.h> // for rw_expand()
/**************************************************************************/
// for convenience and brevity
-
-#define NPOS _RWSTD_SIZE_MAX
-#define Copy(which) StringMembers::copy_ ## which
+#define NPOS _RWSTD_SIZE_MAX
+#define Copy(which) StringMembers::copy_ ## which
typedef StringMembers::OverloadId OverloadId;
typedef StringMembers::TestCase TestCase;
@@ -160,12 +160,11 @@
/**************************************************************************/
-template <class charT, class Traits>
-void test_copy (charT, Traits*,
+template <class charT, class Traits, class Allocator>
+void test_copy (charT, Traits*, Allocator*,
OverloadId which,
const TestCase &tcase)
{
- typedef std::allocator<charT> Allocator;
typedef std::basic_string <charT, Traits, Allocator> String;
static const std::size_t BUFSIZE = 256;
@@ -303,7 +302,7 @@
/**************************************************************************/
-DEFINE_TEST_DISPATCH (test_copy);
+DEFINE_STRING_TEST_DISPATCH (test_copy);
int main (int argc, char** argv)
{
Modified: incubator/stdcxx/trunk/tests/strings/21.string.erase.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/strings/21.string.erase.cpp?rev=407501&r1=407500&r2=407501&view=diff
==============================================================================
--- incubator/stdcxx/trunk/tests/strings/21.string.erase.cpp (original)
+++ incubator/stdcxx/trunk/tests/strings/21.string.erase.cpp Thu May 18 01:25:17 2006
@@ -25,19 +25,20 @@
*
**************************************************************************/
-#include <string> // for string
-#include <cstdlib> // for free(), size_t
-#include <stdexcept> // for out_of_range
-
-#include <21.strings.h> // for StringMembers
-#include <driver.h> // for rw_test()
-#include <rw_char.h> // for rw_expand()
-#include <rw_new.h> // for bad_alloc, replacement operator new
+#include <string> // for string
+#include <cstdlib> // for free(), size_t
+#include <stdexcept> // for out_of_range
+
+#include <21.strings.h> // for StringMembers
+#include <driver.h> // for rw_test()
+#include <rw_allocator.h> // for UserAlloc
+#include <rw_char.h> // for rw_expand()
+#include <rw_new.h> // for bad_alloc, replacement operator new
/**************************************************************************/
// for convenience and brevity
-#define Erase(which) StringMembers::erase_ ## which
+#define Erase(which) StringMembers::erase_ ## which
typedef StringMembers::OverloadId OverloadId;
typedef StringMembers::TestCase TestCase;
@@ -277,12 +278,11 @@
/**************************************************************************/
// exercises basic_string::erase, 21.3.5.5
-template <class charT, class Traits>
-void test_erase (charT, Traits*,
+template <class charT, class Traits, class Allocator>
+void test_erase (charT, Traits*, Allocator*,
OverloadId which,
const TestCase &cs)
{
- typedef std::allocator<charT> Allocator;
typedef std::basic_string <charT, Traits, Allocator> String;
typedef typename String::iterator StringIter;
typedef typename String::const_iterator ConstStringIter;
@@ -487,7 +487,7 @@
/**************************************************************************/
-DEFINE_TEST_DISPATCH (test_erase);
+DEFINE_STRING_TEST_DISPATCH (test_erase);
int main (int argc, char** argv)
{
Modified: incubator/stdcxx/trunk/tests/strings/21.string.find.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/strings/21.string.find.cpp?rev=407501&r1=407500&r2=407501&view=diff
==============================================================================
--- incubator/stdcxx/trunk/tests/strings/21.string.find.cpp (original)
+++ incubator/stdcxx/trunk/tests/strings/21.string.find.cpp Thu May 18 01:25:17 2006
@@ -25,19 +25,20 @@
*
**************************************************************************/
-#include <string> // for string
-#include <cstddef> // size_t
-#include <exception> // for exception
-
-#include <21.strings.h> // for StringMembers
-#include <driver.h> // for rw_assert()
-#include <rw_char.h> // for rw_expand()
+#include <string> // for string
+#include <cstddef> // size_t
+#include <exception> // for exception
+
+#include <21.strings.h> // for StringMembers
+#include <driver.h> // for rw_assert()
+#include <rw_allocator.h> // for UserAlloc
+#include <rw_char.h> // for rw_expand()
/**************************************************************************/
// for convenience and brevity
-#define NPOS _RWSTD_SIZE_MAX
-#define Find(which) StringMembers::find_ ## which
+#define NPOS _RWSTD_SIZE_MAX
+#define Find(which) StringMembers::find_ ## which
typedef StringMembers::OverloadId OverloadId;
typedef StringMembers::TestCase TestCase;
@@ -638,12 +639,11 @@
/**************************************************************************/
-template <class charT, class Traits>
-void test_find (charT, Traits*,
+template <class charT, class Traits, class Allocator>
+void test_find (charT, Traits*, Allocator*,
OverloadId which,
const TestCase &tcase)
{
- typedef std::allocator<charT> Allocator;
typedef std::basic_string <charT, Traits, Allocator> String;
static const std::size_t BUFSIZE = 256;
@@ -783,7 +783,7 @@
/**************************************************************************/
-DEFINE_TEST_DISPATCH (test_find);
+DEFINE_STRING_TEST_DISPATCH (test_find);
int main (int argc, char** argv)
{
Modified: incubator/stdcxx/trunk/tests/strings/21.string.find.first.not.of.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/strings/21.string.find.first.not.of.cpp?rev=407501&r1=407500&r2=407501&view=diff
==============================================================================
--- incubator/stdcxx/trunk/tests/strings/21.string.find.first.not.of.cpp (original)
+++ incubator/stdcxx/trunk/tests/strings/21.string.find.first.not.of.cpp Thu May 18 01:25:17 2006
@@ -26,13 +26,14 @@
*
**************************************************************************/
-#include <string> // for string
-#include <cstdlib> // for free(), size_t
-#include <stdexcept> // for length_error
-
-#include <21.strings.h> // for StringMembers
-#include <driver.h> // for rw_test()
-#include <rw_char.h> // for rw_expand()
+#include <string> // for string
+#include <cstdlib> // for free(), size_t
+#include <stdexcept> // for length_error
+
+#include <21.strings.h> // for StringMembers
+#include <driver.h> // for rw_test()
+#include <rw_allocator.h> // for UserAlloc
+#include <rw_char.h> // for rw_expand()
/**************************************************************************/
@@ -607,12 +608,11 @@
/**************************************************************************/
-template <class charT, class Traits>
-void test_find_first_not_of (charT, Traits*,
+template <class charT, class Traits, class Allocator>
+void test_find_first_not_of (charT, Traits*, Allocator*,
OverloadId which,
const TestCase &cs)
{
- typedef std::allocator<charT> Allocator;
typedef std::basic_string <charT, Traits, Allocator> String;
static const std::size_t BUFSIZE = 256;
@@ -761,7 +761,7 @@
/**************************************************************************/
-DEFINE_TEST_DISPATCH (test_find_first_not_of);
+DEFINE_STRING_TEST_DISPATCH (test_find_first_not_of);
int main (int argc, char** argv)
{
Modified: incubator/stdcxx/trunk/tests/strings/21.string.find.first.of.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/strings/21.string.find.first.of.cpp?rev=407501&r1=407500&r2=407501&view=diff
==============================================================================
--- incubator/stdcxx/trunk/tests/strings/21.string.find.first.of.cpp (original)
+++ incubator/stdcxx/trunk/tests/strings/21.string.find.first.of.cpp Thu May 18 01:25:17 2006
@@ -26,13 +26,14 @@
*
**************************************************************************/
-#include <string> // for string
-#include <cstdlib> // for free(), size_t
-#include <stdexcept> // for length_error
-
-#include <21.strings.h> // for StringMembers
-#include <driver.h> // for rw_test()
-#include <rw_char.h> // for rw_expand()
+#include <string> // for string
+#include <cstdlib> // for free(), size_t
+#include <stdexcept> // for length_error
+
+#include <21.strings.h> // for StringMembers
+#include <driver.h> // for rw_test()
+#include <rw_allocator.h> // for UserAlloc
+#include <rw_char.h> // for rw_expand()
/**************************************************************************/
@@ -617,12 +618,11 @@
/**************************************************************************/
-template <class charT, class Traits>
-void test_find_first_of (charT, Traits*,
+template <class charT, class Traits, class Allocator>
+void test_find_first_of (charT, Traits*, Allocator*,
OverloadId which,
const TestCase &cs)
{
- typedef std::allocator<charT> Allocator;
typedef std::basic_string <charT, Traits, Allocator> String;
static const std::size_t BUFSIZE = 256;
@@ -771,7 +771,7 @@
/**************************************************************************/
-DEFINE_TEST_DISPATCH (test_find_first_of);
+DEFINE_STRING_TEST_DISPATCH (test_find_first_of);
int main (int argc, char** argv)
{
Modified: incubator/stdcxx/trunk/tests/strings/21.string.find.last.not.of.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/strings/21.string.find.last.not.of.cpp?rev=407501&r1=407500&r2=407501&view=diff
==============================================================================
--- incubator/stdcxx/trunk/tests/strings/21.string.find.last.not.of.cpp (original)
+++ incubator/stdcxx/trunk/tests/strings/21.string.find.last.not.of.cpp Thu May 18 01:25:17 2006
@@ -26,13 +26,14 @@
*
**************************************************************************/
-#include <string> // for string
-#include <cstdlib> // for free(), size_t
-#include <stdexcept> // for length_error
-
-#include <21.strings.h> // for StringMembers
-#include <driver.h> // for rw_test()
-#include <rw_char.h> // for rw_expand()
+#include <string> // for string
+#include <cstdlib> // for free(), size_t
+#include <stdexcept> // for length_error
+
+#include <21.strings.h> // for StringMembers
+#include <driver.h> // for rw_test()
+#include <rw_allocator.h> // for UserAlloc
+#include <rw_char.h> // for rw_expand()
/**************************************************************************/
@@ -619,12 +620,11 @@
/**************************************************************************/
-template <class charT, class Traits>
-void test_find_last_not_of (charT, Traits*,
+template <class charT, class Traits, class Allocator>
+void test_find_last_not_of (charT, Traits*, Allocator*,
OverloadId which,
const TestCase &cs)
{
- typedef std::allocator<charT> Allocator;
typedef std::basic_string <charT, Traits, Allocator> String;
static const std::size_t BUFSIZE = 256;
@@ -773,7 +773,7 @@
/**************************************************************************/
-DEFINE_TEST_DISPATCH (test_find_last_not_of);
+DEFINE_STRING_TEST_DISPATCH (test_find_last_not_of);
int main (int argc, char** argv)
{
Modified: incubator/stdcxx/trunk/tests/strings/21.string.find.last.of.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/strings/21.string.find.last.of.cpp?rev=407501&r1=407500&r2=407501&view=diff
==============================================================================
--- incubator/stdcxx/trunk/tests/strings/21.string.find.last.of.cpp (original)
+++ incubator/stdcxx/trunk/tests/strings/21.string.find.last.of.cpp Thu May 18 01:25:17 2006
@@ -26,13 +26,14 @@
*
**************************************************************************/
-#include <string> // for string
-#include <cstdlib> // for free(), size_t
-#include <stdexcept> // for length_error
-
-#include <21.strings.h> // for StringMembers
-#include <driver.h> // for rw_test()
-#include <rw_char.h> // for rw_expand()
+#include <string> // for string
+#include <cstdlib> // for free(), size_t
+#include <stdexcept> // for length_error
+
+#include <21.strings.h> // for StringMembers
+#include <driver.h> // for rw_test()
+#include <rw_allocator.h> // for UserAlloc
+#include <rw_char.h> // for rw_expand()
/**************************************************************************/
@@ -633,12 +634,11 @@
/**************************************************************************/
-template <class charT, class Traits>
-void test_find_last_of (charT, Traits*,
+template <class charT, class Traits, class Allocator>
+void test_find_last_of (charT, Traits*, Allocator*,
OverloadId which,
const TestCase &cs)
{
- typedef std::allocator<charT> Allocator;
typedef std::basic_string <charT, Traits, Allocator> String;
static const std::size_t BUFSIZE = 256;
@@ -787,7 +787,7 @@
/**************************************************************************/
-DEFINE_TEST_DISPATCH (test_find_last_of);
+DEFINE_STRING_TEST_DISPATCH (test_find_last_of);
int main (int argc, char** argv)
{
Modified: incubator/stdcxx/trunk/tests/strings/21.string.insert.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/strings/21.string.insert.cpp?rev=407501&r1=407500&r2=407501&view=diff
==============================================================================
--- incubator/stdcxx/trunk/tests/strings/21.string.insert.cpp (original)
+++ incubator/stdcxx/trunk/tests/strings/21.string.insert.cpp Thu May 18 01:25:17 2006
@@ -32,13 +32,14 @@
#include <21.strings.h> // for StringMembers
#include <alg_test.h> // for InputIter
#include <driver.h> // for rw_test()
+#include <rw_allocator.h> // for UserAlloc
#include <rw_char.h> // for rw_expand()
#include <rw_new.h> // for bad_alloc, replacement operator new
/**************************************************************************/
// for convenience and brevity
-#define Insert(which) StringMembers::insert_ ## which
+#define Insert(which) StringMembers::insert_ ## which
typedef StringMembers::OverloadId OverloadId;
typedef StringMembers::TestCase TestCase;
@@ -495,17 +496,17 @@
/**************************************************************************/
-template <class charT, class Traits, class Iterator>
+template <class charT, class Traits, class Allocator, class Iterator>
void test_insert_range (const charT *wstr,
std::size_t wstr_len,
const charT *warg,
std::size_t warg_len,
std::size_t res_len,
Traits*,
+ Allocator*,
const Iterator &it,
const TestCase &tcase)
{
- typedef std::allocator<charT> Allocator;
typedef std::basic_string <charT, Traits, Allocator> String;
typedef typename String::iterator StringIter;
@@ -567,20 +568,21 @@
/**************************************************************************/
-template <class charT, class Traits>
+template <class charT, class Traits, class Allocator>
void test_insert_range (const charT *wstr,
std::size_t wstr_len,
const charT *warg,
std::size_t warg_len,
std::size_t res_len,
Traits*,
+ Allocator*,
const TestCase &tcase)
{
if (tcase.bthrow) // this method doesn't throw
return;
test_insert_range (wstr, wstr_len, warg, warg_len, res_len, (Traits*)0,
- InputIter<charT>(0, 0, 0), tcase);
+ (Allocator*)0, InputIter<charT>(0, 0, 0), tcase);
// there is no need to call test_insert_range
// for other iterators in this case
@@ -588,23 +590,23 @@
return;
test_insert_range (wstr, wstr_len, warg, warg_len, res_len, (Traits*)0,
- ConstFwdIter<charT>(0, 0, 0), tcase);
+ (Allocator*)0, ConstFwdIter<charT>(0, 0, 0), tcase);
test_insert_range (wstr, wstr_len, warg, warg_len, res_len, (Traits*)0,
- ConstBidirIter<charT>(0, 0, 0), tcase);
+ (Allocator*)0, ConstBidirIter<charT>(0, 0, 0), tcase);
- test_insert_range (wstr, wstr_len, warg, warg_len, res_len, (Traits*)0,
+ test_insert_range (wstr, wstr_len, warg, warg_len, res_len,
+ (Traits*)0, (Allocator*)0,
ConstRandomAccessIter<charT>(0, 0, 0), tcase);
}
/**************************************************************************/
-template <class charT, class Traits>
-void test_insert (charT, Traits*,
+template <class charT, class Traits, class Allocator>
+void test_insert (charT, Traits*, Allocator*,
OverloadId which,
const TestCase &tcase)
{
- typedef std::allocator<charT> Allocator;
typedef std::basic_string <charT, Traits, Allocator> String;
typedef typename String::iterator StringIter;
typedef typename UserTraits<charT>::MemFun UTMemFun;
@@ -627,7 +629,7 @@
// special processing for insert_range to exercise all iterators
if (Insert (range) == which) {
test_insert_range (wstr, str_len, warg, arg_len,
- res_len, (Traits*)0, tcase);
+ res_len, (Traits*)0, (Allocator*)0, tcase);
if (wstr != wstr_buf)
delete[] wstr;
@@ -891,7 +893,7 @@
/**************************************************************************/
-DEFINE_TEST_DISPATCH (test_insert);
+DEFINE_STRING_TEST_DISPATCH (test_insert);
int main (int argc, char** argv)
{
Modified: incubator/stdcxx/trunk/tests/strings/21.string.op.plus.equal.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/strings/21.string.op.plus.equal.cpp?rev=407501&r1=407500&r2=407501&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 18 01:25:17 2006
@@ -33,13 +33,14 @@
#include <21.strings.h> // for StringMembers
#include <alg_test.h> // for InputIter
#include <driver.h> // for rw_test()
+#include <rw_allocator.h> // for UserAlloc
#include <rw_char.h> // for rw_expand()
#include <rw_new.h> // for bad_alloc, replacement operator new
/**************************************************************************/
// for convenience and brevity
-#define OpPlusEq(which) StringMembers::op_plus_eq_ ## which
+#define OpPlusEq(which) StringMembers::op_plus_eq_ ## which
typedef StringMembers::OverloadId OverloadId;
typedef StringMembers::TestCase TestCase;
@@ -216,12 +217,11 @@
/**************************************************************************/
-template <class charT, class Traits>
-void test_op_plus_eq (charT, Traits*,
+template <class charT, class Traits, class Allocator>
+void test_op_plus_eq (charT, Traits*, Allocator*,
OverloadId which,
const TestCase &tcase)
{
- typedef std::allocator<charT> Allocator;
typedef std::basic_string <charT, Traits, Allocator> String;
typedef typename String::iterator StringIter;
typedef typename UserTraits<charT>::MemFun UTMemFun;
@@ -444,7 +444,7 @@
/**************************************************************************/
-DEFINE_TEST_DISPATCH (test_op_plus_eq);
+DEFINE_STRING_TEST_DISPATCH (test_op_plus_eq);
int main (int argc, char** argv)
{
Modified: incubator/stdcxx/trunk/tests/strings/21.string.rfind.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/strings/21.string.rfind.cpp?rev=407501&r1=407500&r2=407501&view=diff
==============================================================================
--- incubator/stdcxx/trunk/tests/strings/21.string.rfind.cpp (original)
+++ incubator/stdcxx/trunk/tests/strings/21.string.rfind.cpp Thu May 18 01:25:17 2006
@@ -25,13 +25,14 @@
*
**************************************************************************/
-#include <string> // for string
-#include <cstdlib> // for free(), size_t
-#include <stdexcept> // for length_error
-
-#include <21.strings.h> // for StringMembers
-#include <driver.h> // for rw_test()
-#include <rw_char.h> // for rw_expand()
+#include <string> // for string
+#include <cstdlib> // for free(), size_t
+#include <stdexcept> // for length_error
+
+#include <21.strings.h> // for StringMembers
+#include <driver.h> // for rw_test()
+#include <rw_allocator.h> // for UserAlloc
+#include <rw_char.h> // for rw_expand()
/**************************************************************************/
@@ -621,12 +622,11 @@
/**************************************************************************/
-template <class charT, class Traits>
-void test_rfind (charT, Traits*,
+template <class charT, class Traits, class Allocator>
+void test_rfind (charT, Traits*, Allocator*,
OverloadId which,
const TestCase &cs)
{
- typedef std::allocator<charT> Allocator;
typedef std::basic_string <charT, Traits, Allocator> String;
static const std::size_t BUFSIZE = 256;
@@ -775,7 +775,7 @@
/**************************************************************************/
-DEFINE_TEST_DISPATCH (test_rfind);
+DEFINE_STRING_TEST_DISPATCH (test_rfind);
int main (int argc, char** argv)
{
Modified: incubator/stdcxx/trunk/tests/strings/21.string.substr.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/strings/21.string.substr.cpp?rev=407501&r1=407500&r2=407501&view=diff
==============================================================================
--- incubator/stdcxx/trunk/tests/strings/21.string.substr.cpp (original)
+++ incubator/stdcxx/trunk/tests/strings/21.string.substr.cpp Thu May 18 01:25:17 2006
@@ -25,18 +25,19 @@
*
**************************************************************************/
-#include <string> // for string
-#include <cstddef> // for size_t
-#include <stdexcept> // for out_of_range
-
-#include <21.strings.h> // for StringMembers
-#include <driver.h> // for rw_test()
-#include <rw_char.h> // for rw_expand()
+#include <string> // for string
+#include <cstddef> // for size_t
+#include <stdexcept> // for out_of_range
+
+#include <21.strings.h> // for StringMembers
+#include <driver.h> // for rw_test()
+#include <rw_allocator.h> // for UserAlloc
+#include <rw_char.h> // for rw_expand()
/**************************************************************************/
// for convenience and brevity
-#define Substr(which) StringMembers::substr_ ## which
+#define Substr(which) StringMembers::substr_ ## which
typedef StringMembers::OverloadId OverloadId;
typedef StringMembers::TestCase TestCase;
@@ -209,12 +210,11 @@
/**************************************************************************/
-template <class charT, class Traits>
-void test_substr (charT, Traits*,
+template <class charT, class Traits, class Allocator>
+void test_substr (charT, Traits*, Allocator*,
OverloadId which,
const TestCase &cs)
{
- typedef std::allocator<charT> Allocator;
typedef std::basic_string <charT, Traits, Allocator> String;
static const std::size_t BUFSIZE = 256;
@@ -342,7 +342,7 @@
/**************************************************************************/
-DEFINE_TEST_DISPATCH (test_substr);
+DEFINE_STRING_TEST_DISPATCH (test_substr);
int main (int argc, char** argv)
{
Modified: incubator/stdcxx/trunk/tests/strings/21.string.swap.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/strings/21.string.swap.cpp?rev=407501&r1=407500&r2=407501&view=diff
==============================================================================
--- incubator/stdcxx/trunk/tests/strings/21.string.swap.cpp (original)
+++ incubator/stdcxx/trunk/tests/strings/21.string.swap.cpp Thu May 18 01:25:17 2006
@@ -25,14 +25,15 @@
*
**************************************************************************/
-#include <string> // for string
-#include <cstddef> // size_t
-#include <exception> // for exception
-
-#include <21.strings.h> // for StringMembers
-#include <driver.h> // for rw_assert()
-#include <rw_char.h> // for rw_expand()
-#include <rw_new.h> // for bad_alloc, replacement operator new
+#include <string> // for string
+#include <cstddef> // size_t
+#include <exception> // for exception
+
+#include <21.strings.h> // for StringMembers
+#include <driver.h> // for rw_assert()
+#include <rw_allocator.h> // foir UserAlloc
+#include <rw_char.h> // for rw_expand()
+#include <rw_new.h> // for bad_alloc, replacement operator new
/**************************************************************************/
@@ -107,12 +108,11 @@
/**************************************************************************/
-template <class charT, class Traits>
-void test_swap (charT, Traits*,
+template <class charT, class Traits, class Allocator>
+void test_swap (charT, Traits*, Allocator*,
OverloadId which,
const TestCase &tcase)
{
- typedef std::allocator<charT> Allocator;
typedef std::basic_string <charT, Traits, Allocator> String;
typedef UserTraits<UserChar>::MemFun UTMemFun;
@@ -298,7 +298,7 @@
/**************************************************************************/
-DEFINE_TEST_DISPATCH (test_swap);
+DEFINE_STRING_TEST_DISPATCH (test_swap);
int main (int argc, char** argv)
{