Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
Data Structures | Namespaces | Macros | Typedefs | Enumerations | Functions | Variables
23.deque.modifiers.cpp File Reference
#include <deque>
#include <cstdlib>
#include <rw_new.h>
#include <rw_value.h>
#include <rw_driver.h>
#include <rw_printf.h>
Include dependency graph for 23.deque.modifiers.cpp:

Go to the source code of this file.

Data Structures

struct  DR_438
 

Namespaces

namespace  __rw
 

Macros

#define TEST(seq, off, ins, res)
 
#define UPPER   "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
 
#define LOWER   "abcdefghijklmnopqrstuvwxyz"
 
#define TEST(seq, off, ins, res)
 
#define A_to_B   "AB"
 
#define A_to_C   "ABC"
 
#define A_to_D   "ABCD"
 
#define A_to_E   "ABCDE"
 
#define A_to_F   "ABCDEF"
 
#define A_to_G   "ABCDEFG"
 
#define A_to_H   "ABCDEFGH"
 
#define A_to_I   "ABCDEFGHI"
 
#define A_to_J   "ABCDEFGHIJ"
 
#define A_to_K   "ABCDEFGHIJK"
 
#define A_to_L   "ABCDEFGHIJKL"
 
#define A_to_M   "ABCDEFGHIJKLM"
 
#define A_to_N   "ABCDEFGHIJKLMN"
 
#define A_to_O   "ABCDEFGHIJKLMNO"
 
#define A_to_P   "ABCDEFGHIJKLMNOP"
 
#define A_to_Q   "ABCDEFGHIJKLMNOPQ"
 
#define A_to_R   "ABCDEFGHIJKLMNOPQR"
 
#define A_to_S   "ABCDEFGHIJKLMNOPQRS"
 
#define A_to_T   "ABCDEFGHIJKLMNOPQRST"
 
#define A_to_U   "ABCDEFGHIJKLMNOPQRSTU"
 
#define A_to_V   "ABCDEFGHIJKLMNOPQRSTUV"
 
#define A_to_W   "ABCDEFGHIJKLMNOPQRSTUVW"
 
#define A_to_X   "ABCDEFGHIJKLMNOPQRSTUVWX"
 
#define A_to_Y   "ABCDEFGHIJKLMNOPQRSTUVWXY"
 
#define A_to_Z   "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
 
#define B_to_Z   "BCDEFGHIJKLMNOPQRSTUVWXYZ"
 
#define C_to_Z   "CDEFGHIJKLMNOPQRSTUVWXYZ"
 
#define D_to_Z   "DEFGHIJKLMNOPQRSTUVWXYZ"
 
#define E_to_Z   "EFGHIJKLMNOPQRSTUVWXYZ"
 
#define F_to_Z   "FGHIJKLMNOPQRSTUVWXYZ"
 
#define G_to_Z   "GHIJKLMNOPQRSTUVWXYZ"
 
#define H_to_Z   "HIJKLMNOPQRSTUVWXYZ"
 
#define I_to_Z   "IJKLMNOPQRSTUVWXYZ"
 
#define J_to_Z   "JKLMNOPQRSTUVWXYZ"
 
#define K_to_Z   "KLMNOPQRSTUVWXYZ"
 
#define L_to_Z   "LMNOPQRSTUVWXYZ"
 
#define M_to_Z   "MNOPQRSTUVWXYZ"
 
#define N_to_Z   "NOPQRSTUVWXYZ"
 
#define O_to_Z   "OPQRSTUVWXYZ"
 
#define P_to_Z   "PQRSTUVWXYZ"
 
#define Q_to_Z   "QRSTUVWXYZ"
 
#define R_to_Z   "RSTUVWXYZ"
 
#define S_to_Z   "STUVWXYZ"
 
#define T_to_Z   "TUVWXYZ"
 
#define U_to_Z   "UVWXYZ"
 
#define V_to_Z   "VWXYZ"
 
#define W_to_Z   "WXYZ"
 
#define X_to_Z   "XYZ"
 
#define Y_to_Z   "YZ"
 
#define TEST(seq, off, n, ins, res)
 
#define TEST(seq, off, res)
 

Typedefs

typedef unsigned char UChar
 
typedef std::deque< UserClass, std::allocator< UserClass > > Deque
 

Enumerations

enum  { NewThrows = 0x1 , CopyCtorThrows = 0x2 , AssignmentThrows = 0x4 }
 
enum  MemberFunction {
  Assign_n , AssignRange , Erase_1 , EraseRange ,
  Insert_1 , Insert_n , InsertRange
}
 

Functions

_RWSTD_SPECIALIZED_FUNCTION Deque::size_type __rw::__rw_new_capacity< Deque > (Deque::size_type n, const Deque *)
 
template<class Iterator >
void exception_loop (int line, MemberFunction mfun, const char *fcall, int exceptions, Deque &deq, const Deque::iterator &it, int n, const UserClass *x, const Iterator &first, const Iterator &last, std::size_t *n_copy, std::size_t *n_asgn)
 
bool is_bidirectional (std::input_iterator_tag)
 
bool is_bidirectional (std::bidirectional_iterator_tag)
 
template<class Iterator >
std::size_t insert_assignments (Iterator it, int nelems, std::size_t off, std::size_t seqlen, std::size_t inslen)
 
template<class Iterator >
void test_insert (int line, int exceptions, const Iterator &dummy, int nelems, const char *seq, std::size_t seqlen, std::size_t off, const char *ins, std::size_t inslen, const char *res, std::size_t reslen)
 
template<class Iterator >
void test_insert_range (const Iterator &it, const char *itname)
 
template<class T , class IntType >
void test_insert_int_range (const T &, const IntType &, const char *t_name, const char *int_name)
 
template<class T >
void test_insert_int_range (const T &dummy, const char *tname)
 
void test_insert ()
 
template<class Iterator >
void test_assign (int line, int exceptions, const Iterator &dummy, int nelems, const char *seq, std::size_t seqlen, const char *asn, std::size_t asnlen, const char *res, std::size_t reslen)
 
template<class Iterator >
void test_assign_range (const Iterator &it, const char *itname)
 
void test_assign ()
 
void test_erase (int line, const char *seq, std::size_t seqlen, std::size_t begoff, std::size_t len, const char *res, std::size_t reslen)
 
void test_erase ()
 
void test_dr_438 ()
 
int run_test (int, char **)
 
int main (int argc, char **argv)
 

Variables

int rw_opt_no_assign = 0
 
int rw_opt_no_erase = 0
 
int rw_opt_no_insert = 0
 
int rw_opt_no_dr438 = 0
 
int rw_opt_no_input_iterator = 0
 
int rw_opt_no_forward_iterator = 0
 
int rw_opt_no_bidirectional_iterator = 0
 
int rw_opt_no_random_iterator = 0
 
int rw_opt_no_right_thing = 0
 
Deque::size_type new_capacity
 

Macro Definition Documentation

◆ A_to_B

#define A_to_B   "AB"

◆ A_to_C

#define A_to_C   "ABC"

◆ A_to_D

#define A_to_D   "ABCD"

◆ A_to_E

#define A_to_E   "ABCDE"

◆ A_to_F

#define A_to_F   "ABCDEF"

◆ A_to_G

#define A_to_G   "ABCDEFG"

◆ A_to_H

#define A_to_H   "ABCDEFGH"

◆ A_to_I

#define A_to_I   "ABCDEFGHI"

◆ A_to_J

#define A_to_J   "ABCDEFGHIJ"

◆ A_to_K

#define A_to_K   "ABCDEFGHIJK"

◆ A_to_L

#define A_to_L   "ABCDEFGHIJKL"

◆ A_to_M

#define A_to_M   "ABCDEFGHIJKLM"

◆ A_to_N

#define A_to_N   "ABCDEFGHIJKLMN"

◆ A_to_O

#define A_to_O   "ABCDEFGHIJKLMNO"

◆ A_to_P

#define A_to_P   "ABCDEFGHIJKLMNOP"

◆ A_to_Q

#define A_to_Q   "ABCDEFGHIJKLMNOPQ"

◆ A_to_R

#define A_to_R   "ABCDEFGHIJKLMNOPQR"

◆ A_to_S

#define A_to_S   "ABCDEFGHIJKLMNOPQRS"

◆ A_to_T

#define A_to_T   "ABCDEFGHIJKLMNOPQRST"

◆ A_to_U

#define A_to_U   "ABCDEFGHIJKLMNOPQRSTU"

◆ A_to_V

#define A_to_V   "ABCDEFGHIJKLMNOPQRSTUV"

◆ A_to_W

#define A_to_W   "ABCDEFGHIJKLMNOPQRSTUVW"

◆ A_to_X

#define A_to_X   "ABCDEFGHIJKLMNOPQRSTUVWX"

◆ A_to_Y

#define A_to_Y   "ABCDEFGHIJKLMNOPQRSTUVWXY"

◆ A_to_Z

#define A_to_Z   "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

◆ B_to_Z

#define B_to_Z   "BCDEFGHIJKLMNOPQRSTUVWXYZ"

◆ C_to_Z

#define C_to_Z   "CDEFGHIJKLMNOPQRSTUVWXYZ"

◆ D_to_Z

#define D_to_Z   "DEFGHIJKLMNOPQRSTUVWXYZ"

◆ E_to_Z

#define E_to_Z   "EFGHIJKLMNOPQRSTUVWXYZ"

◆ F_to_Z

#define F_to_Z   "FGHIJKLMNOPQRSTUVWXYZ"

◆ G_to_Z

#define G_to_Z   "GHIJKLMNOPQRSTUVWXYZ"

◆ H_to_Z

#define H_to_Z   "HIJKLMNOPQRSTUVWXYZ"

◆ I_to_Z

#define I_to_Z   "IJKLMNOPQRSTUVWXYZ"

◆ J_to_Z

#define J_to_Z   "JKLMNOPQRSTUVWXYZ"

◆ K_to_Z

#define K_to_Z   "KLMNOPQRSTUVWXYZ"

◆ L_to_Z

#define L_to_Z   "LMNOPQRSTUVWXYZ"

◆ LOWER

#define LOWER   "abcdefghijklmnopqrstuvwxyz"

◆ M_to_Z

#define M_to_Z   "MNOPQRSTUVWXYZ"

◆ N_to_Z

#define N_to_Z   "NOPQRSTUVWXYZ"

◆ O_to_Z

#define O_to_Z   "OPQRSTUVWXYZ"

◆ P_to_Z

#define P_to_Z   "PQRSTUVWXYZ"

◆ Q_to_Z

#define Q_to_Z   "QRSTUVWXYZ"

◆ R_to_Z

#define R_to_Z   "RSTUVWXYZ"

◆ S_to_Z

#define S_to_Z   "STUVWXYZ"

◆ T_to_Z

#define T_to_Z   "TUVWXYZ"

◆ TEST [1/4]

#define TEST (   seq,
  off,
  ins,
  res 
)
Value:
test_insert (__LINE__, -1, \
it, -1, \
seq, sizeof seq - 1, \
std::size_t (off), \
ins, sizeof ins - 1, \
res, sizeof res - 1)
#define res
Definition 17.names.cpp:531
#define off
Definition 17.names.cpp:507
void test_insert()

◆ TEST [2/4]

#define TEST (   seq,
  off,
  ins,
  res 
)
Value:
do { \
const char insseq [] = { ins, '\0' }; \
test_insert (__LINE__, -1, \
(UserClass*)0, -2, \
seq, sizeof seq - 1, \
std::size_t (off), \
insseq, 1, \
res, sizeof res - 1); \
} while (0)

◆ TEST [3/4]

#define TEST (   seq,
  off,
  n,
  ins,
  res 
)
Value:
do { \
const char insseq [] = { ins, '\0' }; \
test_insert (__LINE__, -1, \
(UserClass*)0, n, \
seq, sizeof seq - 1, \
std::size_t (off), \
insseq, 1, \
res, sizeof res - 1); \
} while (0)
#define n
Definition 17.names.cpp:130

◆ TEST [4/4]

#define TEST (   seq,
  off,
  res 
)
Value:
do { \
test_erase (__LINE__, \
seq, sizeof seq - 1, \
std::size_t (off), \
std::size_t (-1), \
res, sizeof res - 1); \
} while (0)

◆ U_to_Z

#define U_to_Z   "UVWXYZ"

◆ UPPER

#define UPPER   "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

◆ V_to_Z

#define V_to_Z   "VWXYZ"

◆ W_to_Z

#define W_to_Z   "WXYZ"

◆ X_to_Z

#define X_to_Z   "XYZ"

◆ Y_to_Z

#define Y_to_Z   "YZ"

Typedef Documentation

◆ Deque

typedef std::deque<UserClass, std::allocator<UserClass> > Deque

Definition at line 73 of file 23.deque.modifiers.cpp.

◆ UChar

typedef unsigned char UChar

Definition at line 69 of file 23.deque.modifiers.cpp.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
NewThrows 
CopyCtorThrows 
AssignmentThrows 

Definition at line 100 of file 23.deque.modifiers.cpp.

◆ MemberFunction

Enumerator
Assign_n 
AssignRange 
Erase_1 
EraseRange 
Insert_1 
Insert_n 
InsertRange 

Definition at line 106 of file 23.deque.modifiers.cpp.

Function Documentation

◆ exception_loop()

template<class Iterator >
void exception_loop ( int  line,
MemberFunction  mfun,
const char *  fcall,
int  exceptions,
Deque &  deq,
const Deque::iterator &  it,
int  n,
const UserClass *  x,
const Iterator &  first,
const Iterator &  last,
std::size_t *  n_copy,
std::size_t *  n_asgn 
)

Definition at line 124 of file 23.deque.modifiers.cpp.

◆ insert_assignments()

template<class Iterator >
std::size_t insert_assignments ( Iterator  it,
int  nelems,
std::size_t  off,
std::size_t  seqlen,
std::size_t  inslen 
)

Definition at line 304 of file 23.deque.modifiers.cpp.

◆ is_bidirectional() [1/2]

bool is_bidirectional ( std::bidirectional_iterator_tag  )

Definition at line 298 of file 23.deque.modifiers.cpp.

◆ is_bidirectional() [2/2]

bool is_bidirectional ( std::input_iterator_tag  )

Definition at line 297 of file 23.deque.modifiers.cpp.

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 1409 of file 23.deque.modifiers.cpp.

◆ run_test()

int run_test ( int  ,
char **   
)

Definition at line 1377 of file 23.deque.modifiers.cpp.

◆ test_assign() [1/2]

void test_assign ( )

Definition at line 1014 of file 23.deque.modifiers.cpp.

◆ test_assign() [2/2]

template<class Iterator >
void test_assign ( int  line,
int  exceptions,
const Iterator &  dummy,
int  nelems,
const char *  seq,
std::size_t  seqlen,
const char *  asn,
std::size_t  asnlen,
const char *  res,
std::size_t  reslen 
)

Definition at line 859 of file 23.deque.modifiers.cpp.

◆ test_assign_range()

template<class Iterator >
void test_assign_range ( const Iterator &  it,
const char *  itname 
)

Definition at line 998 of file 23.deque.modifiers.cpp.

◆ test_dr_438()

void test_dr_438 ( )

Definition at line 1291 of file 23.deque.modifiers.cpp.

◆ test_erase() [1/2]

void test_erase ( )

Definition at line 1202 of file 23.deque.modifiers.cpp.

◆ test_erase() [2/2]

void test_erase ( int  line,
const char *  seq,
std::size_t  seqlen,
std::size_t  begoff,
std::size_t  len,
const char *  res,
std::size_t  reslen 
)

Definition at line 1080 of file 23.deque.modifiers.cpp.

◆ test_insert() [1/2]

void test_insert ( )

Definition at line 619 of file 23.deque.modifiers.cpp.

◆ test_insert() [2/2]

template<class Iterator >
void test_insert ( int  line,
int  exceptions,
const Iterator &  dummy,
int  nelems,
const char *  seq,
std::size_t  seqlen,
std::size_t  off,
const char *  ins,
std::size_t  inslen,
const char *  res,
std::size_t  reslen 
)

Definition at line 333 of file 23.deque.modifiers.cpp.

◆ test_insert_int_range() [1/2]

template<class T , class IntType >
void test_insert_int_range ( const T &  ,
const IntType &  ,
const char *  t_name,
const char *  int_name 
)

Definition at line 555 of file 23.deque.modifiers.cpp.

◆ test_insert_int_range() [2/2]

template<class T >
void test_insert_int_range ( const T &  dummy,
const char *  tname 
)

Definition at line 595 of file 23.deque.modifiers.cpp.

◆ test_insert_range()

template<class Iterator >
void test_insert_range ( const Iterator &  it,
const char *  itname 
)

Definition at line 466 of file 23.deque.modifiers.cpp.

Variable Documentation

◆ new_capacity

Deque::size_type new_capacity

Definition at line 75 of file 23.deque.modifiers.cpp.

◆ rw_opt_no_assign

int rw_opt_no_assign = 0

23.deque.modifiers.cpp - test exercising [lib.deque.modifiers]

$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 1994-2008 Rogue Wave Software, Inc.

Definition at line 56 of file 23.deque.modifiers.cpp.

◆ rw_opt_no_bidirectional_iterator

int rw_opt_no_bidirectional_iterator = 0

Definition at line 62 of file 23.deque.modifiers.cpp.

◆ rw_opt_no_dr438

int rw_opt_no_dr438 = 0

Definition at line 59 of file 23.deque.modifiers.cpp.

◆ rw_opt_no_erase

int rw_opt_no_erase = 0

Definition at line 57 of file 23.deque.modifiers.cpp.

◆ rw_opt_no_forward_iterator

int rw_opt_no_forward_iterator = 0

Definition at line 61 of file 23.deque.modifiers.cpp.

◆ rw_opt_no_input_iterator

int rw_opt_no_input_iterator = 0

Definition at line 60 of file 23.deque.modifiers.cpp.

◆ rw_opt_no_insert

int rw_opt_no_insert = 0

Definition at line 58 of file 23.deque.modifiers.cpp.

◆ rw_opt_no_random_iterator

int rw_opt_no_random_iterator = 0

Definition at line 63 of file 23.deque.modifiers.cpp.

◆ rw_opt_no_right_thing

int rw_opt_no_right_thing = 0

Definition at line 64 of file 23.deque.modifiers.cpp.