The FreeRADIUS server $Id: a4e7f8c94e8038b7627bcf52356b7ed15955c1d7 $
Loading...
Searching...
No Matches
Macros | Functions
acutest_helpers.h File Reference
#include <unistd.h>
+ Include dependency graph for acutest_helpers.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define TEST_CHECK_LEN(_got, _exp)
 
#define TEST_CHECK_RET(_got, _exp)
 
#define TEST_CHECK_SLEN(_got, _exp)
 
#define TEST_CHECK_SLEN_RETURN(_got, _exp)
 
#define TEST_CHECK_STRCMP(_got, _exp)
 

Functions

static size_t test_page_size (void)
 Return the system page size, aborting the test if sysconf() fails.
 

Macro Definition Documentation

◆ TEST_CHECK_LEN

#define TEST_CHECK_LEN (   _got,
  _exp 
)
Value:
do { \
size_t _our_got = (_got); \
TEST_CHECK_(_exp == _our_got, "%s", #_got); \
TEST_MSG("Expected length : %zu", (size_t) (_exp)); \
TEST_MSG("Got length : %zu", (size_t) (_our_got)); \
} while(0)

Definition at line 32 of file acutest_helpers.h.

◆ TEST_CHECK_RET

#define TEST_CHECK_RET (   _got,
  _exp 
)
Value:
do { \
int _our_got = (_got); \
TEST_CHECK_(_exp == _our_got, "%s", #_got); \
TEST_MSG("Expected ret : %"PRId64, (int64_t) (_exp)); \
TEST_MSG("Got ret : %"PRId64, (int64_t) (_our_got)); \
} while(0)

Definition at line 57 of file acutest_helpers.h.

◆ TEST_CHECK_SLEN

#define TEST_CHECK_SLEN (   _got,
  _exp 
)
Value:
do { \
ssize_t _our_got = (_got); \
TEST_CHECK_(_exp == _our_got, "%s", #_got); \
TEST_MSG("Expected length : %zd", (ssize_t) (_exp)); \
TEST_MSG("Got length : %zd", (ssize_t) (_our_got)); \
} while(0)
long int ssize_t

Definition at line 40 of file acutest_helpers.h.

◆ TEST_CHECK_SLEN_RETURN

#define TEST_CHECK_SLEN_RETURN (   _got,
  _exp 
)
Value:
do { \
ssize_t _our_got = (_got); \
TEST_CHECK_(_exp == _our_got, "%s", #_got); \
TEST_MSG("Expected length : %zd", (ssize_t) (_exp)); \
TEST_MSG("Got length : %zd", (ssize_t) (_our_got)); \
if (_exp != _our_got) return; \
} while(0)

Definition at line 48 of file acutest_helpers.h.

◆ TEST_CHECK_STRCMP

#define TEST_CHECK_STRCMP (   _got,
  _exp 
)
Value:
do { \
char const *_our_got = (_got); \
TEST_CHECK_(((_exp) != NULL) && ((_got) != NULL) && (strcmp(_exp, _our_got) == 0), "%s", #_got); \
TEST_MSG("Expected : \"%s\"", _exp); \
TEST_MSG("Got : \"%s\"", _our_got); \
} while(0)

Definition at line 65 of file acutest_helpers.h.

Function Documentation

◆ test_page_size()

static size_t test_page_size ( void  )
inlinestatic

Return the system page size, aborting the test if sysconf() fails.

The upper bound means callers can map a small multiple of the page size without the length overflowing.

Returns
the page size in bytes.

Definition at line 80 of file acutest_helpers.h.

+ Here is the caller graph for this function: