Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
Macros | Functions
0.char.cpp File Reference
#include <rw_char.h>
#include <rw_printf.h>
#include <rw_driver.h>
#include <stdlib.h>
#include <string.h>
Include dependency graph for 0.char.cpp:

Go to the source code of this file.

Macros

#define TEST(str, expstr)
 
#define TEST(str, expstr)
 
#define TEST(s1, s2, len, expect)
 
#define TEST(s1, s2, len, expect)
 
#define TEST(s1, s2, len, expect)
 
#define TEST(fmt, arg0, arg1, arg2, expect_str)
 
#define US(s)   make_user_string (s, sizeof (s))
 
#define TEST(fun)
 

Functions

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

Macro Definition Documentation

◆ TEST [1/7]

#define TEST (   fmt,
  arg0,
  arg1,
  arg2,
  expect_str 
)
Value:
str = rw_sprintfa (fmt, arg0, arg1, arg2); \
rw_assert (str && 0 == strcmp (str, expect_str), \
0, __LINE__, \
"rw_printf(%#s, ...) == %#s; got %#s", \
fmt, expect_str, str); \
free (str)
const char * str
Definition exec.cpp:170
_TEST_EXPORT char * rw_sprintfa(const char *fmt,...)
Definition printf.cpp:3258

◆ TEST [2/7]

#define TEST (   fun)
Value:
if (opt_ ## fun < 0) \
rw_note (0, 0, 0, "%s() tests disabled", #fun); \
else \
test_ ## fun ()
#define fun
Definition 17.names.cpp:471

◆ TEST [3/7]

#define TEST (   s1,
  s2,
  len,
  expect 
)
Value:
result = rw_match ((const char*)s1, (const char*)s2, size_t (len)); \
rw_assert (expect == result, \
0, __LINE__, \
"rw_match(%{#*s}, %{#*s}, %zu) == %zu, got %zu", \
int (sizeof s1 - 1), s1, int (sizeof s2 - 1), s2, len, \
expect, result)
#define s1
Definition 17.names.cpp:242
#define s2
Definition 17.names.cpp:268
#define len
Definition 17.names.cpp:488
volatile int result
_TEST_EXPORT _RWSTD_SIZE_T rw_match(const char *, const char *, _RWSTD_SIZE_T=_RWSTD_SIZE_MAX)

◆ TEST [4/7]

#define TEST (   s1,
  s2,
  len,
  expect 
)
Value:
result = rw_match ((const char*)s1, (const wchar_t*)s2, size_t (len)); \
rw_assert (expect == result, \
0, __LINE__, \
"rw_match(%{#*s}, L%{#*ls}, %zu) == %zu, got %zu", \
int (sizeof s1 - 1), s1, \
int (sizeof (s2) / sizeof *(s2) - 1), s2, len, \
expect, result)

◆ TEST [5/7]

#define TEST (   s1,
  s2,
  len,
  expect 
)
Value:
result = rw_match ((const char*)s1, \
make_user_string (s2, sizeof (s2)), size_t (len)); \
rw_assert (expect == result, \
0, __LINE__, \
"rw_match(%{#*s}, %{#*s}, %zu) == %zu, got %zu", \
int (sizeof s1 - 1), s1, int (sizeof s2 - 1), s2, len, \
expect, result)

◆ TEST [6/7]

#define TEST (   str,
  expstr 
)
Value:
do { \
const size_t str_size = sizeof str - 1; \
const size_t exp_size = sizeof expstr - 1; \
size_t len; \
char* const res = rw_expand ((char*)0, str, str_size, &len); \
rw_assert ( 0 == memcmp (res, expstr, exp_size) \
&& exp_size == len, \
0, __LINE__, \
"rw_expand((char*)0, %{#*s}, %zu, ...) == " \
"%{#*s} (length %zu), got %{#*s} (length %zu)", \
int (str_size), str, str_size, \
int (exp_size), expstr, exp_size, \
int (len), res, len); \
delete[] res; \
} while (0)
#define res
Definition 17.names.cpp:531
_TEST_EXPORT char * rw_expand(char *, const char *, _RWSTD_SIZE_T=_RWSTD_SIZE_MAX, _RWSTD_SIZE_T *=0)

◆ TEST [7/7]

#define TEST (   str,
  expstr 
)
Value:
do { \
const size_t str_size = sizeof str - 1; \
const size_t exp_size = sizeof expstr / sizeof *expstr - 1; \
size_t len; \
wchar_t* const res = rw_expand ((wchar_t*)0, str, str_size, &len); \
rw_assert ( 0 == memcmp (res, expstr, exp_size * sizeof *res) \
&& exp_size == len, \
0, __LINE__, \
"rw_expand((wchar_t*)0, %{#*s}, %zu, ...) == " \
"%{#*ls} (length %zu), got %{#*ls} (length %zu)", \
int (str_size), str, str_size, \
int (exp_size), expstr, exp_size, \
int (len), res, len); \
delete[] res; \
} while (0)

◆ US

#define US (   s)    make_user_string (s, sizeof (s))

Function Documentation

◆ main()

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

Definition at line 1224 of file 0.char.cpp.