Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
Data Structures | Macros | Functions
21.string.replace.cpp File Reference
#include <string>
#include <stdexcept>
#include <cstddef>
#include <rw_strings.h>
#include <rw_alg_test.h>
#include <rw_driver.h>
#include <rw_allocator.h>
#include <rw_new.h>
Include dependency graph for 21.string.replace.cpp:

Go to the source code of this file.

Data Structures

struct  ReplaceRange< String, Iterator >
 
struct  ReplaceRangeOverload< String, Iterator >
 

Macros

#define Replace(sig)   StringIds::replace_ ## sig
 
#define size_size_cptr_test_cases   iter_iter_cptr_test_cases
 
#define TEST(str, off, size, arg, res, bthrow)
 
#define size_size_cstr_test_cases   iter_iter_cstr_test_cases
 
#define TEST(s, off, size, arg, res, bthrow)
 
#define size_size_cptr_size_test_cases   iter_iter_cptr_size_test_cases
 
#define TEST(str, off, size, arg, count, res, bthrow)
 
#define size_size_cstr_size_size_test_cases   iter_iter_range_test_cases
 
#define TEST(str, off, size, arg, off2, size2, res, bthrow)
 
#define size_size_size_val_test_cases   iter_iter_size_val_test_cases
 
#define TEST(str, off, size, count, val, res, bthrow)
 
#define TEST(Iterator)
 
#define TEST(Iterator)
 
#define TEST(sig)
 

Functions

template<class charT , class Traits , class Allocator >
void test_replace (charT *, Traits *, Allocator *, const RangeBase< std::basic_string< charT, Traits, Allocator > > &rng, const StringTestCaseData< charT > &tdata)
 
template<class charT , class Traits , class Allocator >
void test_replace (charT *, Traits *, Allocator *, const StringTestCaseData< charT > &tdata)
 
 DEFINE_STRING_TEST_FUNCTIONS (test_replace)
 
int main (int argc, char **argv)
 

Macro Definition Documentation

◆ Replace

#define Replace (   sig)    StringIds::replace_ ## sig

21.string.replace.cpp - string test exercising lib.string.replace

$Id$

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2006 Rogue Wave Software.

Definition at line 42 of file 21.string.replace.cpp.

◆ size_size_cptr_size_test_cases

#define size_size_cptr_size_test_cases   iter_iter_cptr_size_test_cases

◆ size_size_cptr_test_cases

#define size_size_cptr_test_cases   iter_iter_cptr_test_cases

◆ size_size_cstr_size_size_test_cases

#define size_size_cstr_size_size_test_cases   iter_iter_range_test_cases

◆ size_size_cstr_test_cases

#define size_size_cstr_test_cases   iter_iter_cstr_test_cases

◆ size_size_size_val_test_cases

#define size_size_size_val_test_cases   iter_iter_size_val_test_cases

◆ TEST [1/8]

#define TEST (   Iterator)
Value:
do { \
typedef typename String::Iterator Iter; \
static const \
ReplaceRangeOverload<String, Iter> rng; \
test_replace ((charT*)0, (Traits*)0, (Allocator*)0, rng, tdata); \
} while (0)
#define charT
Definition 17.names.cpp:456
std::char_traits< S > Traits
std::ostream_iterator< int, char, std::char_traits< char > > Iter
Definition alg7.cpp:64

◆ TEST [2/8]

#define TEST (   Iterator)
Value:
do { \
typedef Iterator<charT> Iter; \
static const \
ReplaceRange<String, Iter> rng; \
test_replace ((charT*)0, (Traits*)0, (Allocator*)0, rng, tdata); \
} while (0)

◆ TEST [3/8]

#define TEST (   s,
  off,
  size,
  arg,
  res,
  bthrow 
)
Value:
{ \
__LINE__, off, size, -1, -1, -1, \
s, sizeof s - 1, \
arg, sizeof arg - 1, res, sizeof res - 1, bthrow \
}
#define res
Definition 17.names.cpp:531
#define off
Definition 17.names.cpp:507
#define s
int arg
Definition locale.cpp:2806

◆ TEST [4/8]

#define TEST (   sig)
Value:
{ \
Replace (sig), sig ## _test_cases, \
sizeof sig ## _test_cases / sizeof *sig ## _test_cases, \
}

◆ TEST [5/8]

#define TEST (   str,
  off,
  size,
  arg,
  count,
  res,
  bthrow 
)
Value:
{ \
__LINE__, off, size, -1, count, -1, \
str, sizeof str - 1, \
arg, sizeof arg - 1, res, sizeof res - 1, bthrow \
}
void count(T, T, const U &,...)
const char * str
Definition exec.cpp:170

◆ TEST [6/8]

#define TEST (   str,
  off,
  size,
  arg,
  off2,
  size2,
  res,
  bthrow 
)
Value:
{ \
__LINE__, off, size, off2, size2, -1, \
str, sizeof str - 1, \
arg, sizeof arg - 1, res, sizeof res - 1, bthrow \
}

◆ TEST [7/8]

#define TEST (   str,
  off,
  size,
  arg,
  res,
  bthrow 
)
Value:
{ \
__LINE__, off, size, -1, -1, -1, \
str, sizeof str - 1, \
arg, sizeof arg - 1, res, sizeof res - 1, bthrow \
}

◆ TEST [8/8]

#define TEST (   str,
  off,
  size,
  count,
  val,
  res,
  bthrow 
)
Value:
{ \
__LINE__, off, size, -1, count, val, \
str, sizeof str - 1, \
0, 0, res, sizeof res - 1, bthrow \
}
#define val
Definition 17.names.cpp:570

Function Documentation

◆ DEFINE_STRING_TEST_FUNCTIONS()

DEFINE_STRING_TEST_FUNCTIONS ( test_replace  )

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 1167 of file 21.string.replace.cpp.

◆ test_replace() [1/2]

template<class charT , class Traits , class Allocator >
void test_replace ( charT *  ,
Traits *  ,
Allocator *  ,
const RangeBase< std::basic_string< charT, Traits, Allocator > > &  rng,
const StringTestCaseData< charT > &  tdata 
)

Definition at line 809 of file 21.string.replace.cpp.

◆ test_replace() [2/2]

template<class charT , class Traits , class Allocator >
void test_replace ( charT *  ,
Traits *  ,
Allocator *  ,
const StringTestCaseData< charT > &  tdata 
)

Definition at line 1109 of file 21.string.replace.cpp.