30#define _RWSTD_TEST_SRC
95 : data_ (), id_ (++id_gen_), origin_ (id_), src_id_ (id_),
96 n_copy_ctor_ (0), n_op_assign_ (0), n_op_eq_ (0), n_op_lt_ (0)
102#ifndef _RWSTD_NO_EXCEPTIONS
122 : data_ (
rhs.data_), id_ (++id_gen_), origin_ (
rhs.origin_),
124 n_copy_ctor_ (0), n_op_assign_ (0), n_op_eq_ (0), n_op_lt_ (0)
137#ifndef _RWSTD_NO_EXCEPTIONS
163#ifndef _RWSTD_NO_EXCEPTIONS
194 size_t *p_total_op = 0;
201 OpPlusAssign ex_plus_assign;
202 OpMinusAssign ex_minus_assign;
203 OpTimesAssign ex_times_assign;
204 OpDivAssign ex_div_assign;
214 new_val =
rhs.data_.val_;
221 pex = &ex_plus_assign;
225 case op_minus_assign:
229 pex = &ex_minus_assign;
233 case op_times_assign:
237 pex = &ex_times_assign;
245 pex = &ex_div_assign;
262#ifndef _RWSTD_NO_EXCEPTIONS
267 if (p_throw && *p_throw == *p_total_op) {
348#ifndef _RWSTD_NO_EXCEPTIONS
385#ifndef _RWSTD_NO_EXCEPTIONS
406 size_t n_op_lt)
const
411 return (
size_t (-1) == n_copy_ctor ||
n_copy_ctor_ == n_copy_ctor)
412 && (size_t (-1) == n_op_assign ||
n_op_assign_ == n_op_assign)
413 && (
size_t (-1) == n_op_eq ||
n_op_eq_ == n_op_eq)
414 && (
size_t (-1) == n_op_lt ||
n_op_lt_ == n_op_lt);
442 if (xarray [
inx] < xarray [
inx - 1])
447 return inx < nelems ? xarray +
inx : 0;
467__rw_from_char (
T*,
const char *
str,
size_t len,
bool sorted)
475 size_t strlen_ =
sizeof (str_buf_);
480 for (
size_t i = 1;
i < strlen_; ++
i) {
481 if (str_ [
i] < str_ [
i - 1]) {
482 if (str_buf_ != str_)
496 if (str_buf_ != str_)
502 typedef unsigned char UChar;
509 for (
size_t i = 0;
i < strlen_; ++
i)
512 if (str_buf_ != str_)
521__rw_mismatch (
const T *xarray,
const char *
str,
size_t len)
526 if (
size_t (-1) ==
len)
529 for (
size_t i = 0;
i !=
len; ++
i) {
533 if (
val != xarray [
i].data_.val_)
553 return __rw_mismatch (xarray,
str,
len);
584 for (
size_t i = 0;
i !=
count; ++
i) {
586 return x [
i].data_.val_ -
y [
i].data_.val_;
605 return __rw_mismatch (xarray,
str,
len);
648 size_t BinaryPredicate::n_total_op_fcall_;
685_rw_advance (
const void*& parray,
int idx,
bool is_class)
694_rw_fmtxarrayv (
char **pbuf,
size_t *pbufsize,
const char *fmt, va_list va)
700 bool fl_plus =
false;
701 bool fl_pound =
false;
705 const void* pelem = 0;
724 if (
'X' != fmt [0] ||
'=' != fmt [1])
725 return _RWSTD_INT_MIN;
728 va_list*
const pva =
va_arg (va, va_list*);
732 const int cwidth =
va_arg (*pva,
int);
735 const bool is_class = (
sizeof (
UserClass) == cwidth);
755 nelems =
va_arg (*pva,
int);
758 else if (isdigit (*fmt)) {
761 const int arg = int (strtol (fmt, &end, 10));
773 cursor =
va_arg (*pva,
int);
776 else if (
'@' == *fmt) {
779 pelem =
va_arg (*pva,
void*);
782 else if (isdigit (*fmt)) {
784 cursor = int (strtol (fmt, &end, 10));
793 const void*
const xbeg =
va_arg (*pva,
const void*);
805 const void**
const pparam =
va_arg (va,
const void**);
812 const size_t buflen_0 = *pbuf ? strlen (*pbuf) : 0;
822 const char* pointer [2];
823 const void* px = xbeg;
825 for (
int i = 0;
i != nelems; ++
i) {
856 "%{?}%d%s%{?},%{;}%{:}%{lc}%s%{;}",
875 const size_t buflen_1 = *pbuf ? strlen (*pbuf) : 0;
880 RW_ASSERT (buflen_1 == buflen_0 + nbytes);
888_rw_fmtxarray (
char **pbuf,
size_t *pbufsize,
const char *fmt, ...)
893 const int nbytes = _rw_fmtxarrayv (pbuf, pbufsize, fmt, va);
907 static int format_init =
rw_printf (
"%{+!}", _rw_fmtxarray);
void count(T, T, const U &,...)
void _rw_advance(InputIterator &it, Distance dist)
#define va_start(va, name)
#define _RWSTD_UNUSED(arg)
#define _RWSTD_STATIC_CAST(T, x)
#define _RWSTD_CONST_CAST(T, x)
_TEST_EXPORT char * rw_expand(char *, const char *, _RWSTD_SIZE_T=_RWSTD_SIZE_MAX, _RWSTD_SIZE_T *=0)
_TEST_EXPORT int rw_printf(const char *,...)
_TEST_EXPORT int rw_asnprintf(char **pbuf, _RWSTD_SIZE_T *pbufsize, const char *fmt,...)
static _RWSTD_SIZE_T n_total_op_fcall_
virtual ~BinaryPredicate()
virtual ~UnaryPredicate()
UnaryPredicate & operator=(const UnaryPredicate &)
virtual conv_to_bool operator()(const UserClass &) const
static _RWSTD_SIZE_T n_total_op_fcall_
_RWSTD_SIZE_T n_copy_ctor_
_RWSTD_SIZE_T n_op_minus_assign_
static _RWSTD_SIZE_T n_total_op_eq_
static _RWSTD_SIZE_T n_total_op_times_assign_
static _RWSTD_SIZE_T * op_minus_assign_throw_ptr_
static _RWSTD_SIZE_T * op_lt_throw_ptr_
static _RWSTD_SIZE_T n_total_dtor_
static _RWSTD_SIZE_T dtor_throw_count_
static _RWSTD_SIZE_T * op_eq_throw_ptr_
static _RWSTD_SIZE_T n_total_op_assign_
bool is_count(_RWSTD_SIZE_T copy_ctor, _RWSTD_SIZE_T op_assign, _RWSTD_SIZE_T op_eq, _RWSTD_SIZE_T op_lt) const
static _RWSTD_SIZE_T * op_div_assign_throw_ptr_
static const UserClass * mismatch(const UserClass *, const char *, _RWSTD_SIZE_T)
_RWSTD_SIZE_T n_op_times_assign_
_RWSTD_SIZE_T n_op_assign_
static _RWSTD_SIZE_T * def_ctor_throw_ptr_
static _RWSTD_SIZE_T * op_plus_assign_throw_ptr_
static UserClass from_char(char c)
static bool is_total(_RWSTD_SIZE_T count, _RWSTD_SIZE_T n_def_ctor, _RWSTD_SIZE_T n_copy_ctor, _RWSTD_SIZE_T n_op_assign, _RWSTD_SIZE_T n_op_eq, _RWSTD_SIZE_T n_op_lt)
UserClass & operator-=(const UserClass &)
UserClass & operator+=(const UserClass &)
static _RWSTD_SIZE_T * copy_ctor_throw_ptr_
UserClass & operator=(const UserClass &)
static _RWSTD_SIZE_T def_ctor_throw_count_
static _RWSTD_SIZE_T * dtor_throw_ptr_
static _RWSTD_SIZE_T copy_ctor_throw_count_
_RWSTD_SIZE_T n_op_div_assign_
static _RWSTD_SIZE_T n_total_op_minus_assign_
static _RWSTD_SIZE_T op_eq_throw_count_
static _RWSTD_SIZE_T op_times_assign_throw_count_
static _RWSTD_SIZE_T op_plus_assign_throw_count_
static _RWSTD_SIZE_T count_
static _RWSTD_SIZE_T n_total_op_div_assign_
UserClass & operator/=(const UserClass &)
static _RWSTD_SIZE_T op_lt_throw_count_
bool operator<(const UserClass &) const
UserClass & operator*=(const UserClass &)
static _RWSTD_SIZE_T n_total_op_plus_assign_
static _RWSTD_SIZE_T n_total_op_lt_
bool operator==(const UserClass &) const
_RWSTD_SIZE_T n_op_plus_assign_
static void reset_totals()
static const UserClass * first_less(const UserClass *, _RWSTD_SIZE_T)
static int compare(const UserClass *, const char *, _RWSTD_SIZE_T=_RWSTD_SIZE_MAX)
static _RWSTD_SIZE_T * op_assign_throw_ptr_
static _RWSTD_SIZE_T op_assign_throw_count_
static _RWSTD_SIZE_T op_minus_assign_throw_count_
static _RWSTD_SIZE_T * op_times_assign_throw_ptr_
static _RWSTD_SIZE_T n_total_def_ctor_
static _RWSTD_SIZE_T n_total_copy_ctor_
static _RWSTD_SIZE_T op_div_assign_throw_count_
static const UserPOD * mismatch(const UserPOD *, const char *, _RWSTD_SIZE_T=_RWSTD_SIZE_MAX)
static UserPOD from_char(char c)
static conv_to_bool make(bool val)