Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
Data Structures | Macros | Functions | Variables
27.istream.fmat.arith.cpp File Reference
#include <cstddef>
#include <istream>
#include <rw_char.h>
#include <rw_ctype.h>
#include <rw_exception.h>
#include <rw_printf.h>
#include <rw_streambuf.h>
#include <rw_driver.h>
Include dependency graph for 27.istream.fmat.arith.cpp:

Go to the source code of this file.

Data Structures

struct  LocaleData
 

Macros

#define TEST(str, fl, is, ex, ee, es, ne, fw, iv, ev)
 
#define TEST(T, fmt, str, fl, is, ex, ee, es, ne, fw, iv, ev)
 
#define TEST_BOOL(ss, fl, is, ex, ee, es, ne, fw, iv, ev)    TEST (bool, "%b", ss, fl, is, ex, ee, es, ne, fw, iv, ev)
 
#define TEST_SHRT(ss, fl, is, ex, ee, es, ne, fw, iv, ev)    TEST (short, "%hi", ss, fl, is, ex, ee, es, ne, fw, iv, ev)
 
#define TEST_USHRT(ss, fl, is, ex, ee, es, ne, fw, iv, ev)    TEST (unsigned short, "%hu", ss, fl, is, ex, ee, es, ne, fw, iv, ev)
 
#define TEST_INT(ss, fl, is, ex, ee, es, ne, fw, iv, ev)    TEST (int, "%i", ss, fl, is, ex, ee, es, ne, fw, iv, ev)
 
#define TEST_UINT(ss, fl, is, ex, ee, es, ne, fw, iv, ev)    TEST (int, "%u", ss, fl, is, ex, ee, es, ne, fw, iv, ev)
 
#define TEST_LONG(ss, fl, is, ex, ee, es, ne, fw, iv, ev)    TEST (long, "%li", ss, fl, is, ex, ee, es, ne, fw, iv, ev)
 
#define TEST_ULONG(ss, fl, is, ex, ee, es, ne, fw, iv, ev)    TEST (unsigned long, "%lu", ss, fl, is, ex, ee, es, ne, fw, iv, ev)
 
#define TEST_LLONG(ss, fl, is, ex, ee, es, ne, fw, iv, ev)    TEST (long long, "%lli", ss, fl, is, ex, ee, es, ne, fw, iv, ev)
 
#define TEST_ULLONG(ss, fl, is, ex, ee, es, ne, fw, iv, ev)    TEST (unsigned long long, "%llu", ss, fl, is, ex, ee, es, ne, fw, iv, ev)
 
#define TEST_FLOATING(ss, fl, is, ex, ee, es, ne, fw, iv, ev)    TEST (T, fmt, ss, fl, is, ex, ee, es, ne, fw, T (iv), T (ev))
 
#define TEST_FLT(ss, fl, is, ex, ee, es, ne, fw, iv, ev)    TEST (float, fmt, ss, fl, is, ex, ee, es, ne, fw, iv, ev)
 
#define TEST_DBL(ss, fl, is, ex, ee, es, ne, fw, iv, ev)    TEST (double, fmt, ss, fl, is, ex, ee, es, ne, fw, iv, ev)
 
#define TEST_LDBL(ss, fl, is, ex, ee, es, ne, fw, iv, ev)    TEST (long double, fmt, ss, fl, is, ex, ee, es, ne, fw, iv, ev)
 
#define TEST(T)
 
#define TEST(CharT, Traits)    test_extractor ((CharT*)0, (Traits*)0, #CharT, #Traits)
 

Functions

template<class CharT >
const std::locale make_locale (const CharT *, const LocaleData &data)
 
template<class CharT , class Traits >
const std::locale make_locale (const CharT *, const Traits *, const LocaleData &data)
 
template<class CharT , class Traits , class ArithmeticType >
void test_extractor (CharT *, Traits *, ArithmeticType *, const char *cname, const char *tname, const char *aname, int line, const char *valfmt, const char *cbuf, std::size_t cbuf_size, const LocaleData &locale_data, int flags, int init_state, int exceptions, int expect_exception, int expect_state, int expect_extract, int fail_when, ArithmeticType init_value, ArithmeticType expect_value)
 
template<class CharT , class Traits , class ArithmeticType >
void test_extractor (CharT *, Traits *, ArithmeticType *, const char *cname, const char *tname, const char *aname, const char *fmt)
 
void info (const char *cname, const char *tname, const char *type)
 
template<class CharT , class Traits >
void test_bool (CharT *, Traits *, const char *cname, const char *tname)
 
template<class CharT , class Traits >
void test_shrt (CharT *, Traits *, const char *cname, const char *tname)
 
template<class CharT , class Traits >
void test_ushrt (CharT *, Traits *, const char *cname, const char *tname)
 
template<class CharT , class Traits >
void test_int (CharT *, Traits *, const char *cname, const char *tname)
 
template<class CharT , class Traits >
void test_uint (CharT *, Traits *, const char *cname, const char *tname)
 
template<class CharT , class Traits >
void test_long (CharT *, Traits *, const char *cname, const char *tname)
 
template<class CharT , class Traits >
void test_ulong (CharT *, Traits *, const char *cname, const char *tname)
 
template<class CharT , class Traits >
void test_llong (CharT *, Traits *, const char *cname, const char *tname)
 
template<class CharT , class Traits >
void test_ullong (CharT *, Traits *, const char *cname, const char *tname)
 
template<class CharT , class Traits , class FloatingType >
void test_floating (CharT *, Traits *, FloatingType *, const char *cname, const char *tname, const char *fname, const char *fmt)
 
template<class CharT , class Traits >
void test_flt (CharT *, Traits *, const char *cname, const char *tname)
 
template<class CharT , class Traits >
void test_dbl (CharT *, Traits *, const char *cname, const char *tname)
 
template<class CharT , class Traits >
void test_ldbl (CharT *, Traits *, const char *cname, const char *tname)
 
template<class CharT , class Traits >
void test_extractor (CharT *, Traits *, const char *cname, const char *tname)
 
int main (int argc, char *argv[])
 

Variables

int opt_no_gcount
 
const int ___ = 0
 
const int __f = 0 | 0 | std::ios::failbit
 
const int _e_ = 0 | std::ios::eofbit | 0
 
const int _ef = 0 | std::ios::eofbit | std::ios::failbit
 
const int b__ = std::ios::badbit | 0 | 0
 
const int b_f = std::ios::badbit | 0 | std::ios::failbit
 
const int be_ = std::ios::badbit | std::ios::eofbit | 0
 
const int bef = std::ios::badbit | std::ios::eofbit | std::ios::failbit
 
const int DEC = std::ios::dec
 
const int OCT = std::ios::oct
 
const int HEX = std::ios::hex
 
int opt_bool
 
int opt_shrt
 
int opt_ushrt
 
int opt_int
 
int opt_uint
 
int opt_long
 
int opt_ulong
 
int opt_llong
 
int opt_ullong
 
int opt_flt
 
int opt_dbl
 
int opt_ldbl
 

Macro Definition Documentation

◆ TEST [1/4]

#define TEST (   CharT,
  Traits 
)     test_extractor ((CharT*)0, (Traits*)0, #CharT, #Traits)

Definition at line 683 of file 27.istream.fmat.arith.cpp.

◆ TEST [2/4]

#define TEST (   str,
  fl,
  is,
  ex,
  ee,
  es,
  ne,
  fw,
  iv,
  ev 
)
Value:
if (is_signed || 0 <= ev) \
test_extractor ((CharT*)0, (Traits*)0, (T*)0, cname, tname, aname, \
__LINE__, fmt, str, sizeof str - 1, locale_data, \
fl, is, ex, ee, es, ne, fw, (T)(iv), (T)ev)
#define T
Definition 17.names.cpp:163
#define CharT
Definition 17.names.cpp:457
std::char_traits< S > Traits
const char * str
Definition exec.cpp:170

Definition at line 683 of file 27.istream.fmat.arith.cpp.

◆ TEST [3/4]

#define TEST (   T)
Value:
if (rw_note (0 == opt_ ## T, 0, __LINE__, "%s tests disabled", #T)) \
test_ ## T ((CharT*)0, (Traits*)0, cname, tname)
_TEST_EXPORT int rw_note(int, const char *, int, const char *,...)
Definition driver.cpp:1664

Definition at line 683 of file 27.istream.fmat.arith.cpp.

◆ TEST [4/4]

#define TEST (   T,
  fmt,
  str,
  fl,
  is,
  ex,
  ee,
  es,
  ne,
  fw,
  iv,
  ev 
)
Value:
test_extractor ((CharT*)0, (Traits*)0, (T*)0, cname, tname, #T, \
__LINE__, fmt, str, sizeof str - 1, locale_data, \
fl, is, ex, ee, es, ne, fw, (T)(iv), (T)ev)
void test_extractor(CharT *, Traits *, ArithmeticType *, const char *cname, const char *tname, const char *aname, int line, const char *valfmt, const char *cbuf, std::size_t cbuf_size, const LocaleData &locale_data, int flags, int init_state, int exceptions, int expect_exception, int expect_state, int expect_extract, int fail_when, ArithmeticType init_value, ArithmeticType expect_value)

Definition at line 683 of file 27.istream.fmat.arith.cpp.

◆ TEST_BOOL

#define TEST_BOOL (   ss,
  fl,
  is,
  ex,
  ee,
  es,
  ne,
  fw,
  iv,
  ev 
)     TEST (bool, "%b", ss, fl, is, ex, ee, es, ne, fw, iv, ev)

◆ TEST_DBL

#define TEST_DBL (   ss,
  fl,
  is,
  ex,
  ee,
  es,
  ne,
  fw,
  iv,
  ev 
)     TEST (double, fmt, ss, fl, is, ex, ee, es, ne, fw, iv, ev)

◆ TEST_FLOATING

#define TEST_FLOATING (   ss,
  fl,
  is,
  ex,
  ee,
  es,
  ne,
  fw,
  iv,
  ev 
)     TEST (T, fmt, ss, fl, is, ex, ee, es, ne, fw, T (iv), T (ev))

◆ TEST_FLT

#define TEST_FLT (   ss,
  fl,
  is,
  ex,
  ee,
  es,
  ne,
  fw,
  iv,
  ev 
)     TEST (float, fmt, ss, fl, is, ex, ee, es, ne, fw, iv, ev)

◆ TEST_INT

#define TEST_INT (   ss,
  fl,
  is,
  ex,
  ee,
  es,
  ne,
  fw,
  iv,
  ev 
)     TEST (int, "%i", ss, fl, is, ex, ee, es, ne, fw, iv, ev)

◆ TEST_LDBL

#define TEST_LDBL (   ss,
  fl,
  is,
  ex,
  ee,
  es,
  ne,
  fw,
  iv,
  ev 
)     TEST (long double, fmt, ss, fl, is, ex, ee, es, ne, fw, iv, ev)

◆ TEST_LLONG

#define TEST_LLONG (   ss,
  fl,
  is,
  ex,
  ee,
  es,
  ne,
  fw,
  iv,
  ev 
)     TEST (long long, "%lli", ss, fl, is, ex, ee, es, ne, fw, iv, ev)

◆ TEST_LONG

#define TEST_LONG (   ss,
  fl,
  is,
  ex,
  ee,
  es,
  ne,
  fw,
  iv,
  ev 
)     TEST (long, "%li", ss, fl, is, ex, ee, es, ne, fw, iv, ev)

◆ TEST_SHRT

#define TEST_SHRT (   ss,
  fl,
  is,
  ex,
  ee,
  es,
  ne,
  fw,
  iv,
  ev 
)     TEST (short, "%hi", ss, fl, is, ex, ee, es, ne, fw, iv, ev)

◆ TEST_UINT

#define TEST_UINT (   ss,
  fl,
  is,
  ex,
  ee,
  es,
  ne,
  fw,
  iv,
  ev 
)     TEST (int, "%u", ss, fl, is, ex, ee, es, ne, fw, iv, ev)

◆ TEST_ULLONG

#define TEST_ULLONG (   ss,
  fl,
  is,
  ex,
  ee,
  es,
  ne,
  fw,
  iv,
  ev 
)     TEST (unsigned long long, "%llu", ss, fl, is, ex, ee, es, ne, fw, iv, ev)

◆ TEST_ULONG

#define TEST_ULONG (   ss,
  fl,
  is,
  ex,
  ee,
  es,
  ne,
  fw,
  iv,
  ev 
)     TEST (unsigned long, "%lu", ss, fl, is, ex, ee, es, ne, fw, iv, ev)

◆ TEST_USHRT

#define TEST_USHRT (   ss,
  fl,
  is,
  ex,
  ee,
  es,
  ne,
  fw,
  iv,
  ev 
)     TEST (unsigned short, "%hu", ss, fl, is, ex, ee, es, ne, fw, iv, ev)

Function Documentation

◆ info()

void info ( const char *  cname,
const char *  tname,
const char *  type 
)

Definition at line 666 of file 27.istream.fmat.arith.cpp.

◆ main()

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

Definition at line 1346 of file 27.istream.fmat.arith.cpp.

◆ make_locale() [1/2]

template<class CharT >
const std::locale make_locale ( const CharT *  ,
const LocaleData &  data 
)

Definition at line 52 of file 27.istream.fmat.arith.cpp.

◆ make_locale() [2/2]

template<class CharT , class Traits >
const std::locale make_locale ( const CharT *  ,
const Traits *  ,
const LocaleData &  data 
)

Definition at line 185 of file 27.istream.fmat.arith.cpp.

◆ test_bool()

template<class CharT , class Traits >
void test_bool ( CharT *  ,
Traits *  ,
const char *  cname,
const char *  tname 
)

Definition at line 692 of file 27.istream.fmat.arith.cpp.

◆ test_dbl()

template<class CharT , class Traits >
void test_dbl ( CharT *  ,
Traits *  ,
const char *  cname,
const char *  tname 
)

Definition at line 1171 of file 27.istream.fmat.arith.cpp.

◆ test_extractor() [1/3]

template<class CharT , class Traits , class ArithmeticType >
void test_extractor ( CharT *  ,
Traits *  ,
ArithmeticType *  ,
const char *  cname,
const char *  tname,
const char *  aname,
const char *  fmt 
)

Definition at line 448 of file 27.istream.fmat.arith.cpp.

◆ test_extractor() [2/3]

template<class CharT , class Traits , class ArithmeticType >
void test_extractor ( CharT *  ,
Traits *  ,
ArithmeticType *  ,
const char *  cname,
const char *  tname,
const char *  aname,
int  line,
const char *  valfmt,
const char *  cbuf,
std::size_t  cbuf_size,
const LocaleData &  locale_data,
int  flags,
int  init_state,
int  exceptions,
int  expect_exception,
int  expect_state,
int  expect_extract,
int  fail_when,
ArithmeticType  init_value,
ArithmeticType  expect_value 
)

Definition at line 210 of file 27.istream.fmat.arith.cpp.

◆ test_extractor() [3/3]

template<class CharT , class Traits >
void test_extractor ( CharT *  ,
Traits *  ,
const char *  cname,
const char *  tname 
)

Definition at line 1241 of file 27.istream.fmat.arith.cpp.

◆ test_floating()

template<class CharT , class Traits , class FloatingType >
void test_floating ( CharT *  ,
Traits *  ,
FloatingType *  ,
const char *  cname,
const char *  tname,
const char *  fname,
const char *  fmt 
)

Definition at line 1119 of file 27.istream.fmat.arith.cpp.

◆ test_flt()

template<class CharT , class Traits >
void test_flt ( CharT *  ,
Traits *  ,
const char *  cname,
const char *  tname 
)

Definition at line 1143 of file 27.istream.fmat.arith.cpp.

◆ test_int()

template<class CharT , class Traits >
void test_int ( CharT *  ,
Traits *  ,
const char *  cname,
const char *  tname 
)

Definition at line 828 of file 27.istream.fmat.arith.cpp.

◆ test_ldbl()

template<class CharT , class Traits >
void test_ldbl ( CharT *  ,
Traits *  ,
const char *  cname,
const char *  tname 
)

Definition at line 1199 of file 27.istream.fmat.arith.cpp.

◆ test_llong()

template<class CharT , class Traits >
void test_llong ( CharT *  ,
Traits *  ,
const char *  cname,
const char *  tname 
)

Definition at line 1022 of file 27.istream.fmat.arith.cpp.

◆ test_long()

template<class CharT , class Traits >
void test_long ( CharT *  ,
Traits *  ,
const char *  cname,
const char *  tname 
)

Definition at line 925 of file 27.istream.fmat.arith.cpp.

◆ test_shrt()

template<class CharT , class Traits >
void test_shrt ( CharT *  ,
Traits *  ,
const char *  cname,
const char *  tname 
)

Definition at line 745 of file 27.istream.fmat.arith.cpp.

◆ test_uint()

template<class CharT , class Traits >
void test_uint ( CharT *  ,
Traits *  ,
const char *  cname,
const char *  tname 
)

Definition at line 884 of file 27.istream.fmat.arith.cpp.

◆ test_ullong()

template<class CharT , class Traits >
void test_ullong ( CharT *  ,
Traits *  ,
const char *  cname,
const char *  tname 
)

Definition at line 1078 of file 27.istream.fmat.arith.cpp.

◆ test_ulong()

template<class CharT , class Traits >
void test_ulong ( CharT *  ,
Traits *  ,
const char *  cname,
const char *  tname 
)

Definition at line 981 of file 27.istream.fmat.arith.cpp.

◆ test_ushrt()

template<class CharT , class Traits >
void test_ushrt ( CharT *  ,
Traits *  ,
const char *  cname,
const char *  tname 
)

Definition at line 793 of file 27.istream.fmat.arith.cpp.

Variable Documentation

◆ ___

const int ___ = 0

Definition at line 432 of file 27.istream.fmat.arith.cpp.

◆ __f

const int __f = 0 | 0 | std::ios::failbit

Definition at line 433 of file 27.istream.fmat.arith.cpp.

◆ _e_

const int _e_ = 0 | std::ios::eofbit | 0

Definition at line 434 of file 27.istream.fmat.arith.cpp.

◆ _ef

const int _ef = 0 | std::ios::eofbit | std::ios::failbit

Definition at line 435 of file 27.istream.fmat.arith.cpp.

◆ b__

const int b__ = std::ios::badbit | 0 | 0

Definition at line 436 of file 27.istream.fmat.arith.cpp.

◆ b_f

const int b_f = std::ios::badbit | 0 | std::ios::failbit

Definition at line 437 of file 27.istream.fmat.arith.cpp.

◆ be_

const int be_ = std::ios::badbit | std::ios::eofbit | 0

Definition at line 438 of file 27.istream.fmat.arith.cpp.

◆ bef

Definition at line 439 of file 27.istream.fmat.arith.cpp.

◆ DEC

const int DEC = std::ios::dec

Definition at line 441 of file 27.istream.fmat.arith.cpp.

◆ HEX

const int HEX = std::ios::hex

Definition at line 443 of file 27.istream.fmat.arith.cpp.

◆ OCT

const int OCT = std::ios::oct

Definition at line 442 of file 27.istream.fmat.arith.cpp.

◆ opt_bool

int opt_bool

Definition at line 1225 of file 27.istream.fmat.arith.cpp.

◆ opt_dbl

int opt_dbl

Definition at line 1235 of file 27.istream.fmat.arith.cpp.

◆ opt_flt

int opt_flt

Definition at line 1234 of file 27.istream.fmat.arith.cpp.

◆ opt_int

int opt_int

Definition at line 1228 of file 27.istream.fmat.arith.cpp.

◆ opt_ldbl

int opt_ldbl

Definition at line 1236 of file 27.istream.fmat.arith.cpp.

◆ opt_llong

int opt_llong

Definition at line 1232 of file 27.istream.fmat.arith.cpp.

◆ opt_long

int opt_long

Definition at line 1230 of file 27.istream.fmat.arith.cpp.

◆ opt_no_gcount

int opt_no_gcount

Definition at line 205 of file 27.istream.fmat.arith.cpp.

◆ opt_shrt

int opt_shrt

Definition at line 1226 of file 27.istream.fmat.arith.cpp.

◆ opt_uint

int opt_uint

Definition at line 1229 of file 27.istream.fmat.arith.cpp.

◆ opt_ullong

int opt_ullong

Definition at line 1233 of file 27.istream.fmat.arith.cpp.

◆ opt_ulong

int opt_ulong

Definition at line 1231 of file 27.istream.fmat.arith.cpp.

◆ opt_ushrt

int opt_ushrt

Definition at line 1227 of file 27.istream.fmat.arith.cpp.