163#ifndef _RWSTD_NO_NAMESPACE
175 operator int ()
const {
return i_; }
184 operator int ()
const {
return i_; }
193 operator int ()
const {
return i_; }
227 "types %s::wint_t, %1$s::wctrans_t, and %1$s::wctype_t",
231 "%s::wint_t not defined",
std_name);
236 "%s::wctrans_t not defined",
std_name);
241 "%s::wctype_t not defined",
std_name);
254 "types %s::wint_t, %1s::wctrans_t, and %1s::wctype_t",
std_name);
256 rw_note (0, 0, 0,
"_RWSTD_NO_NAMESPACE defined, cannot test");
292#define TEST_FUNCTION(name, ret) \
293 template <class T> ret name (T) { \
294 missing_set |= bit_ ## name; \
296 } typedef void rw_unused_typedef
316template <
class T,
class U>
319template <
class T,
class U>
327get_bitmask (
int mask,
char *
str)
329 char *str_save =
str;
332 if (mask & bit_ ## bit) { \
333 for (const char *s = #bit; *s; ++s, ++str) \
363#define LETTER(bits) bit_alpha | bit_alnum | bit_print | bit_graph | bits
756# error unknown character set (neither ASCII nor EBCDIC)
764 rw_info (0, 0, 0,
"behavior of <cwctype> functions in the \"C\" locale");
766 char missing_str [80];
768 for (
int i = 0;
i != 256; ++
i) {
778#define SET_MASK_BIT(bitno) \
779 if (bit_ ## bitno & missing_set) \
780 mask |= char_mask [i] & bit_ ## bitno; \
782 mask |= std::isw ## bitno (c) ? bit_ ## bitno : 0; \
798 const int missing_bits = ~mask & char_mask [
i];
801 "%#c mask missing bits %s (%#x)",
802 i, get_bitmask (missing_bits, missing_str), missing_bits);
808static int rw_opt_no_behavior;
813#ifdef _RWSTD_STRICT_ANSI
814# define RW_DIAG rw_assert
816# define RW_DIAG rw_warn
820 rw_info (0, 0, 0,
"checking for the absence of masking macros");
831 const int weof_defined = 0;
833 const int weof_defined = 1;
836 rw_assert (weof_defined, 0, 0,
"macro WEOF unexpectedly not #defined");
844#define TEST(function) \
846 rw_info (0, 0, 0, "%s::%s (%s::wint_t) definition", \
847 std_name, #function, std_name); \
848 const int result = std::function (test_wint_t ('a')); \
849 RW_DIAG (-1 != result && !(missing_set & bit_ ## function), \
850 0, __LINE__, "%s::%s (%s::wint_t) not defined", \
851 std_name, #function, std_name); \
870 "%s::wctype (const char*) definition",
std_name);
872 int result = std::wctype (
"");
875 "%s::wctype (const char*) not defined",
std_name);
880 "%s::iswctype (%1$s::wint_t, %1$s::wctype_t) definition",
886 result = std::iswctype (wc, desc);
889 "%s::iswctype (%1$s::wint_t, %1$s::wctype_t) not defined",
894 "%s::wctrans (const char*) definition",
std_name);
898 result = (int)(_RWSTD_PTRDIFF_T)std::wctrans (
"");
901 "%s::wctrans (const char*) not defined",
std_name);
905 "%s::towctrans(wint_t, wctrans_t) definition",
std_name);
908 result = std::towctrans (wc, category);
911 "%s::towctrans(wint_t, wctrans_t) not defined",
std_name);
914 if (rw_opt_no_behavior)
915 rw_note (0, 0, 0,
"behavior test disabled (use --test-behavior)");
924int main (
int argc,
char *argv[])
926 return rw_test (argc, argv, __FILE__,
930 "|-no-behavior#0-1 ",
931 &rw_opt_no_behavior);
std::Nested::test_wint_t test_wint_t
std::Nested::test_wctype_t test_wctype_t
const char *const cwctype_macros[]
#define SET_MASK_BIT(bitno)
std::Nested::test_wint_t test_wint_t
std::Nested::test_wctrans_t test_wctrans_t
#define TEST_FUNCTION(name, ret)
void test_types(Vector *, T *, Allocator)
void run_test(const ForwardIterator &dummy, T *, Predicate *pred)
#define _RWSTD_NAMESPACE(name)
_TEST_EXPORT int rw_test(int argc, char *argv[], const char *filename, const char *clause, const char *comment, int(*testfun)(int, char **), const char *optspec,...)
_TEST_EXPORT int rw_info(int, const char *, int, const char *,...)
_TEST_EXPORT int rw_note(int, const char *, int, const char *,...)
_TEST_EXPORT int rw_assert(int, const char *, int, const char *,...)