Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
Macros | Functions
27.istream.unformatted.get.cpp File Reference
#include <fstream>
#include <istream>
#include <sstream>
#include <cstddef>
#include <rw_driver.h>
#include <rw_char.h>
#include <rw_streambuf.h>
Include dependency graph for 27.istream.unformatted.get.cpp:

Go to the source code of this file.

Macros

#define Bad   std::ios_base::badbit
 
#define Eof   std::ios_base::eofbit
 
#define Fail   std::ios_base::failbit
 
#define Good   std::ios_base::goodbit
 
#define TRY_GET(expr)
 
#define T   charT (), cname, (UserTraits<charT>*)0, __LINE__
 
#define TEST   test_get_void
 
#define T   charT (), cname, (UserTraits<charT>*)0, __LINE__
 
#define TEST   test_get_char
 
#define MAXCHARS   (4096U * 4U)
 
#define T   charT (), cname, (UserTraits<charT>*)0, __LINE__
 
#define TEST   test_get_char_array
 
#define T   charT (), cname, (UserTraits<charT>*)0, __LINE__
 
#define TEST   test_get_streambuf
 
#define TEST(T, arg)
 

Functions

template<class charT , class Traits >
void check_failure (const MyStreambuf< charT, Traits > &sb, const char *cname, int lineno, const char *fun, std::basic_istream< charT, Traits > &strm, int gcount, int nexpect, int rdstate, int exceptions, int caught)
 
template<class charT , class Traits >
void test_get_void (charT, const char *cname, const Traits *, int lineno, const char *str, std::size_t strsize, int ival, int rdstate, int exceptions, int failure, int fail_when)
 
template<class charT >
void test_get_void (charT, const char *cname)
 
template<class charT , class Traits >
void test_get_char (charT, const char *cname, const Traits *, int lineno, const char *str, std::size_t strsize, char initval, char expectval, int rdstate, int exceptions, int failure, int fail_when)
 
template<class charT >
void test_get_char (charT, const char *cname)
 
template<class charT , class Traits >
void test_get_char_array (charT, const char *cname, const Traits *, int lineno, const char *str, std::size_t strsize, int nread, int idelim, int nexpect, int rdstate, int exceptions, int failure, int fail_when)
 
template<class charT >
void test_get_char_array (charT, const char *cname)
 
template<class charT , class Traits >
void test_get_streambuf (charT, const char *cname, const Traits *, int lineno, const char *str, std::size_t strsize, int idelim, int nexpect, int rdstate, int exceptions, int failure, int fail_when)
 
template<class charT >
void test_get_streambuf (charT, const char *cname)
 
int main (int argc, char *argv[])
 

Macro Definition Documentation

◆ Bad

#define Bad   std::ios_base::badbit

27.istream.unformatted.get.cpp - test exercising overloads of basic_istream::get()

$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 2003-2006 Rogue Wave Software.

Definition at line 41 of file 27.istream.unformatted.get.cpp.

◆ Eof

#define Eof   std::ios_base::eofbit

Definition at line 42 of file 27.istream.unformatted.get.cpp.

◆ Fail

#define Fail   std::ios_base::failbit

Definition at line 43 of file 27.istream.unformatted.get.cpp.

◆ Good

#define Good   std::ios_base::goodbit

Definition at line 44 of file 27.istream.unformatted.get.cpp.

◆ MAXCHARS

#define MAXCHARS   (4096U * 4U)

Definition at line 383 of file 27.istream.unformatted.get.cpp.

◆ T [1/4]

#define T   charT (), cname, (UserTraits<charT>*)0, __LINE__

◆ T [2/4]

#define T   charT (), cname, (UserTraits<charT>*)0, __LINE__

◆ T [3/4]

#define T   charT (), cname, (UserTraits<charT>*)0, __LINE__

◆ T [4/4]

#define T   charT (), cname, (UserTraits<charT>*)0, __LINE__

◆ TEST [1/5]

#define TEST   test_get_void

◆ TEST [2/5]

#define TEST   test_get_char

◆ TEST [3/5]

#define TEST   test_get_char_array

◆ TEST [4/5]

#define TEST   test_get_streambuf

◆ TEST [5/5]

#define TEST (   T,
  arg 
)
Value:
if (rw_opt_no_get_ ## arg) \
rw_note (0, 0, 0, \
"basic_istream::get(%s) test disabled", #arg); \
else \
test_get_ ## arg (T (), #T)
#define T
int arg
Definition locale.cpp:2806

◆ TRY_GET

#define TRY_GET (   expr)
Value:
try { \
expr; \
} \
catch (const std::ios_base::failure&) { \
caught = 1; \
} \
catch (Exception& e) { \
caught = ex_stream == e.id_ ? 2 : 3; \
} \
catch (...) { \
caught = 3; \
} (void)0
#define e
Definition 17.names.cpp:118
int caught
@ ex_stream

Definition at line 137 of file 27.istream.unformatted.get.cpp.

Function Documentation

◆ check_failure()

template<class charT , class Traits >
void check_failure ( const MyStreambuf< charT, Traits > &  sb,
const char *  cname,
int  lineno,
const char *  fun,
std::basic_istream< charT, Traits > &  strm,
int  gcount,
int  nexpect,
int  rdstate,
int  exceptions,
int  caught 
)

Definition at line 49 of file 27.istream.unformatted.get.cpp.

◆ main()

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

Definition at line 787 of file 27.istream.unformatted.get.cpp.

◆ test_get_char() [1/2]

template<class charT >
void test_get_char ( charT  ,
const char *  cname 
)

Definition at line 338 of file 27.istream.unformatted.get.cpp.

◆ test_get_char() [2/2]

template<class charT , class Traits >
void test_get_char ( charT  ,
const char *  cname,
const Traits *  ,
int  lineno,
const char *  str,
std::size_t  strsize,
char  initval,
char  expectval,
int  rdstate,
int  exceptions,
int  failure,
int  fail_when 
)

Definition at line 275 of file 27.istream.unformatted.get.cpp.

◆ test_get_char_array() [1/2]

template<class charT >
void test_get_char_array ( charT  ,
const char *  cname 
)

Definition at line 485 of file 27.istream.unformatted.get.cpp.

◆ test_get_char_array() [2/2]

template<class charT , class Traits >
void test_get_char_array ( charT  ,
const char *  cname,
const Traits *  ,
int  lineno,
const char *  str,
std::size_t  strsize,
int  nread,
int  idelim,
int  nexpect,
int  rdstate,
int  exceptions,
int  failure,
int  fail_when 
)

Definition at line 387 of file 27.istream.unformatted.get.cpp.

◆ test_get_streambuf() [1/2]

template<class charT >
void test_get_streambuf ( charT  ,
const char *  cname 
)

Definition at line 670 of file 27.istream.unformatted.get.cpp.

◆ test_get_streambuf() [2/2]

template<class charT , class Traits >
void test_get_streambuf ( charT  ,
const char *  cname,
const Traits *  ,
int  lineno,
const char *  str,
std::size_t  strsize,
int  idelim,
int  nexpect,
int  rdstate,
int  exceptions,
int  failure,
int  fail_when 
)

Definition at line 580 of file 27.istream.unformatted.get.cpp.

◆ test_get_void() [1/2]

template<class charT >
void test_get_void ( charT  ,
const char *  cname 
)

Definition at line 235 of file 27.istream.unformatted.get.cpp.

◆ test_get_void() [2/2]

template<class charT , class Traits >
void test_get_void ( charT  ,
const char *  cname,
const Traits *  ,
int  lineno,
const char *  str,
std::size_t  strsize,
int  ival,
int  rdstate,
int  exceptions,
int  failure,
int  fail_when 
)

Definition at line 171 of file 27.istream.unformatted.get.cpp.