Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
Data Structures | Macros | Functions | Variables
27.stringbuf.virtuals.cpp File Reference
#include <sstream>
#include <cstring>
#include <rw_cmdopt.h>
#include <rw_driver.h>
#include <rw_char.h>
Include dependency graph for 27.stringbuf.virtuals.cpp:

Go to the source code of this file.

Data Structures

struct  PubBuf< charT, Traits >
 
struct  CharTraits< charT >
 
struct  VFun
 

Macros

#define EOF   (_RWSTD_INT_MIN + 2)
 
#define NOT_EOF   (_RWSTD_INT_MIN + 1)
 
#define IGN   _RWSTD_INT_MIN
 
#define NPOS   -1
 
#define MAYBE_1   0
 
#define AT_LEAST_1   1
 
#define CALLFMT
 
#define CALLARGS
 
#define TEST(charT, Traits)
 
#define TEST(str, mode, gbump, sarg, result, pback, read, write)
 
#define TEST(str, mode, len, result, seq, read)
 
#define TEST(len, mode, gbump, arg_len, result, pback, read, write)
 
#define CAP   stringbuf_capacity
 
#define TEST(str, mode, gbump, arg, result, pback, read, write)
 
#define TEST(str, mode, gbump, arg, result, pback, read, write)
 
#define TEST(str, mode, gbump, result, pback, read, write)
 
#define TEST(str, mode, gbump, off, which, res, pback, read, write)
 
#define TEST(str, mode, gbump, off, way, which, res, pback, read, write)
 
#define TEST(function)
 

Functions

template<class charT , class Traits >
void test_virtual (charT, Traits, const VFun *pfid, int line, const char *str, std::size_t, int mode, int gbump, int arg0, int arg1, int arg2, int ret_expect, int pback_expect, int read_expect, int write_expect)
 
void test_virtual (VFun *pfid, int line, const char *str, std::size_t str_len, int mode, int gbump, int arg0, int arg1, int arg2, int ret_expect, int pback_expect, int read_expect, int write_expect)
 
int main (int argc, char *argv[])
 

Variables

int traits_eof = -1
 
const int in = std::ios::in
 
const int out = std::ios::out
 
const int ate = std::ios::ate
 
const int cur = std::ios::cur
 
const int end = std::ios::end
 

Macro Definition Documentation

◆ AT_LEAST_1

#define AT_LEAST_1   1

Definition at line 49 of file 27.stringbuf.virtuals.cpp.

◆ CALLARGS

#define CALLARGS
Value:
__LINE__, \
0 != pfid->tname_, 'w' == *pfid->cname_, 0 != pfid->tname_, \
pfid->cname_, 0 != pfid->tname_, pfid->tname_, \
0 != str, int (sizeof *wstr), wstr, -1 < mode, mode, -1 < mode, mode, \
pfid->fname_, pfid->vfun_ == VFun::xsputn, 0 != pfid->strarg_, \
int (sizeof *warg), warg, arg0, \
!is_seek, \
IGN != arg0, arg_int, \
arg0, VFun::seekoff == pfid->vfun_, arg1, IGN != arg2, arg2, \
IGN != arg1, arg1
#define mode
Definition 17.names.cpp:497
#define IGN
const char * str
Definition exec.cpp:170

◆ CALLFMT

#define CALLFMT
Value:
"line %d. " \
"%{?}basic_%{:}%{?}w%{;}%{;}stringbuf%{?}<%s%{?}, %s%{;}>%{;}" \
"(%{?}%{*Ac}%{?}, %{Io}%{;}%{:}%{?}%{Io}%{;}%{;})" \
".%s (%{?}%{?}%{*Ac}%{:}pptr()%{;}, %d" /* xsputn */ \
"%{:}%{?}" /* pbackfail, over/underflow argument */ \
"%{?}%{#lc}%{;}" \
"%{:}" /* seekoff and seekpos */ \
"%d%{?}, %{Iw}%{?}, %{Io}%{;}" \
"%{:}%{?}, %{Io}%{;}%{;}" \
"%{;}%{;})"

◆ CAP

#define CAP   stringbuf_capacity

◆ EOF

#define EOF   (_RWSTD_INT_MIN + 2)

27.stringbuf.virtuals.cpp - test exercising lib.stringbuf.virtuals

$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.

Definition at line 37 of file 27.stringbuf.virtuals.cpp.

◆ IGN

#define IGN   _RWSTD_INT_MIN

Definition at line 43 of file 27.stringbuf.virtuals.cpp.

◆ MAYBE_1

#define MAYBE_1   0

Definition at line 48 of file 27.stringbuf.virtuals.cpp.

◆ NOT_EOF

#define NOT_EOF   (_RWSTD_INT_MIN + 1)

Definition at line 40 of file 27.stringbuf.virtuals.cpp.

◆ NPOS

#define NPOS   -1

Definition at line 46 of file 27.stringbuf.virtuals.cpp.

◆ TEST [1/10]

#define TEST (   charT,
  Traits 
)
Value:
test_virtual (charT (), Traits (), pfid, line, \
str, str_len, mode, gbump, \
arg0, arg1, arg2, ret_expect, \
pback_expect, read_expect, write_expect)
#define line
Definition 17.names.cpp:490
#define charT
Definition 17.names.cpp:456
std::char_traits< S > Traits
void test_virtual(charT, Traits, const VFun *pfid, int line, const char *str, std::size_t, int mode, int gbump, int arg0, int arg1, int arg2, int ret_expect, int pback_expect, int read_expect, int write_expect)

◆ TEST [2/10]

#define TEST (   function)
Value:
if (rw_opt_no_ ## function) \
rw_note (1 < rw_opt_no_ ## function++, 0, 0, \
"%s test disabled", #function); \
else \
test_ ## function (pfid)

◆ TEST [3/10]

#define TEST (   len,
  mode,
  gbump,
  arg_len,
  result,
  pback,
  read,
  write 
)
Value:
pfid->strarg_ = long_string + (sizeof long_string - 1 - len), \
test_virtual (pfid, __LINE__, pfid->strarg_, \
len, mode, gbump, arg_len, IGN, IGN, \
result, pback, read, write)
#define len
Definition 17.names.cpp:488
volatile int result

◆ TEST [4/10]

#define TEST (   str,
  mode,
  gbump,
  arg,
  result,
  pback,
  read,
  write 
)
Value:
test_virtual (pfid, __LINE__, str, sizeof str - 1, mode, \
gbump, arg, IGN, IGN, result, pback, read, write)
int arg
Definition locale.cpp:2806

◆ TEST [5/10]

#define TEST (   str,
  mode,
  gbump,
  arg,
  result,
  pback,
  read,
  write 
)
Value:
test_virtual (pfid, __LINE__, str, sizeof str - 1, mode, gbump, \
arg, IGN, IGN, result, pback, read, write);

◆ TEST [6/10]

#define TEST (   str,
  mode,
  gbump,
  off,
  way,
  which,
  res,
  pback,
  read,
  write 
)
Value:
test_virtual (pfid, __LINE__, str, sizeof str - 1, mode, gbump, \
off, way, which, res, pback, read, write)
#define res
Definition 17.names.cpp:531
#define which
Definition 17.names.cpp:575
#define way
Definition 17.names.cpp:574
#define off
Definition 17.names.cpp:507

◆ TEST [7/10]

#define TEST (   str,
  mode,
  gbump,
  off,
  which,
  res,
  pback,
  read,
  write 
)
Value:
test_virtual (pfid, __LINE__, str, sizeof str - 1, mode, gbump, \
off, std::ios::beg, which, res, pback, read, write)

◆ TEST [8/10]

#define TEST (   str,
  mode,
  gbump,
  result,
  pback,
  read,
  write 
)
Value:
test_virtual (pfid, __LINE__, str, sizeof str - 1, mode, gbump, \
IGN, IGN, IGN, result, pback, read, write);

◆ TEST [9/10]

#define TEST (   str,
  mode,
  gbump,
  sarg,
  result,
  pback,
  read,
  write 
)
Value:
pfid->strarg_ = sarg; \
test_virtual (pfid, __LINE__, str, sizeof str - 1, mode, \
gbump, int (sizeof sarg - 1), IGN, IGN, result, \
pback, read, write)

◆ TEST [10/10]

#define TEST (   str,
  mode,
  len,
  result,
  seq,
  read 
)
Value:
pfid->strarg_ = 0; pfid->sequence_ = seq; \
test_virtual (pfid, __LINE__, str, sizeof str - 1, mode, \
0, len, IGN, IGN, result, \
0, read, MAYBE_1)
#define MAYBE_1

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 1194 of file 27.stringbuf.virtuals.cpp.

◆ test_virtual() [1/2]

template<class charT , class Traits >
void test_virtual ( charT  ,
Traits  ,
const VFun *  pfid,
int  line,
const char *  str,
std::size_t  ,
int  mode,
int  gbump,
int  arg0,
int  arg1,
int  arg2,
int  ret_expect,
int  pback_expect,
int  read_expect,
int  write_expect 
)

Definition at line 156 of file 27.stringbuf.virtuals.cpp.

◆ test_virtual() [2/2]

void test_virtual ( VFun *  pfid,
int  line,
const char *  str,
std::size_t  str_len,
int  mode,
int  gbump,
int  arg0,
int  arg1,
int  arg2,
int  ret_expect,
int  pback_expect,
int  read_expect,
int  write_expect 
)

Definition at line 385 of file 27.stringbuf.virtuals.cpp.

Variable Documentation

◆ ate

const int ate = std::ios::ate

Definition at line 444 of file 27.stringbuf.virtuals.cpp.

◆ cur

const int cur = std::ios::cur

Definition at line 446 of file 27.stringbuf.virtuals.cpp.

◆ end

const int end = std::ios::end

Definition at line 447 of file 27.stringbuf.virtuals.cpp.

◆ in

const int in = std::ios::in

Definition at line 442 of file 27.stringbuf.virtuals.cpp.

◆ out

const int out = std::ios::out

Definition at line 443 of file 27.stringbuf.virtuals.cpp.

◆ traits_eof

int traits_eof = -1

Definition at line 106 of file 27.stringbuf.virtuals.cpp.