Apache2
abts.h File Reference
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
Include dependency graph for abts.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  sub_suite
 
struct  abts_suite
 
struct  abts_case
 

Macros

#define ABTS_H
 
#define FALSE   0
 
#define TRUE   1
 
#define ADD_SUITE(suite)   abts_add_suite(suite, __FILE__);
 
#define ABTS_INT_EQUAL(a, b, c)   abts_int_equal(a, b, c, __LINE__)
 
#define ABTS_INT_NEQUAL(a, b, c)   abts_int_nequal(a, b, c, __LINE__)
 
#define ABTS_UINT_EQUAL(a, b, c)   abts_uint_equal(a, b, c, __LINE__)
 
#define ABTS_UINT_NEQUAL(a, b, c)   abts_uint_nequal(a, b, c, __LINE__)
 
#define ABTS_LONG_EQUAL(a, b, c)   abts_long_equal(a, b, c, __LINE__)
 
#define ABTS_LONG_NEQUAL(a, b, c)   abts_long_nequal(a, b, c, __LINE__)
 
#define ABTS_ULONG_EQUAL(a, b, c)   abts_ulong_equal(a, b, c, __LINE__)
 
#define ABTS_ULONG_NEQUAL(a, b, c)   abts_ulong_nequal(a, b, c, __LINE__)
 
#define ABTS_LLONG_EQUAL(a, b, c)   abts_llong_equal(a, b, c, __LINE__)
 
#define ABTS_LLONG_NEQUAL(a, b, c)   abts_llong_nequal(a, b, c, __LINE__)
 
#define ABTS_ULLONG_EQUAL(a, b, c)   abts_ullong_equal(a, b, c, __LINE__)
 
#define ABTS_ULLONG_NEQUAL(a, b, c)   abts_ullong_nequal(a, b, c, __LINE__)
 
#define ABTS_SIZE_EQUAL(a, b, c)   abts_size_equal(a, b, c, __LINE__)
 
#define ABTS_SIZE_NEQUAL(a, b, c)   abts_size_nequal(a, b, c, __LINE__)
 
#define ABTS_STR_EQUAL(a, b, c)   abts_str_equal(a, b, c, __LINE__)
 
#define ABTS_STR_NEQUAL(a, b, c, d)   abts_str_nequal(a, b, c, d, __LINE__)
 
#define ABTS_PTR_NOTNULL(a, b)   abts_ptr_notnull(a, b, __LINE__)
 
#define ABTS_PTR_EQUAL(a, b, c)   abts_ptr_equal(a, b, c, __LINE__)
 
#define ABTS_TRUE(a, b)   abts_true(a, b, __LINE__);
 
#define ABTS_FAIL(a, b)   abts_fail(a, b, __LINE__);
 
#define ABTS_NOT_IMPL(a, b)   abts_not_impl(a, b, __LINE__);
 
#define ABTS_ASSERT(a, b, c)   abts_assert(a, b, c, __LINE__);
 
#define ABTS_SKIP(tc, data, msg)
 

Typedefs

typedef struct sub_suite sub_suite
 
typedef struct abts_suite abts_suite
 
typedef struct abts_case abts_case
 
typedef void(* test_func) (abts_case *tc, void *data)
 

Functions

abts_suiteabts_add_suite (abts_suite *suite, const char *suite_name)
 
void abts_run_test (abts_suite *ts, test_func f, void *value)
 
void abts_log_message (const char *fmt,...)
 
void abts_int_equal (abts_case *tc, const int expected, const int actual, int lineno)
 
void abts_int_nequal (abts_case *tc, const int expected, const int actual, int lineno)
 
void abts_uint_equal (abts_case *tc, const unsigned int expected, const unsigned int actual, int lineno)
 
void abts_uint_nequal (abts_case *tc, const unsigned int expected, const unsigned int actual, int lineno)
 
void abts_long_equal (abts_case *tc, const long expected, const long actual, int lineno)
 
void abts_long_nequal (abts_case *tc, const long expected, const long actual, int lineno)
 
void abts_ulong_equal (abts_case *tc, const unsigned long expected, const unsigned long actual, int lineno)
 
void abts_ulong_nequal (abts_case *tc, const unsigned long expected, const unsigned long actual, int lineno)
 
void abts_llong_equal (abts_case *tc, const long long expected, const long long actual, int lineno)
 
void abts_llong_nequal (abts_case *tc, const long long expected, const long long actual, int lineno)
 
void abts_ullong_equal (abts_case *tc, const unsigned long long expected, const unsigned long long actual, int lineno)
 
void abts_ullong_nequal (abts_case *tc, const unsigned long long expected, const unsigned long long actual, int lineno)
 
void abts_size_equal (abts_case *tc, size_t expected, size_t actual, int lineno)
 
void abts_size_nequal (abts_case *tc, size_t expected, size_t actual, int lineno)
 
void abts_str_equal (abts_case *tc, const char *expected, const char *actual, int lineno)
 
void abts_str_nequal (abts_case *tc, const char *expected, const char *actual, size_t n, int lineno)
 
void abts_ptr_notnull (abts_case *tc, const void *ptr, int lineno)
 
void abts_ptr_equal (abts_case *tc, const void *expected, const void *actual, int lineno)
 
void abts_true (abts_case *tc, int condition, int lineno)
 
void abts_fail (abts_case *tc, const char *message, int lineno)
 
void abts_skip (abts_case *tc, const char *message, int lineno)
 
void abts_not_impl (abts_case *tc, const char *message, int lineno)
 
void abts_assert (abts_case *tc, const char *message, int condition, int lineno)
 
abts_suiterun_tests (abts_suite *suite)
 
abts_suiterun_tests1 (abts_suite *suite)
 

Macro Definition Documentation

◆ ABTS_ASSERT

#define ABTS_ASSERT (   a,
  b,
 
)    abts_assert(a, b, c, __LINE__);

◆ ABTS_FAIL

#define ABTS_FAIL (   a,
 
)    abts_fail(a, b, __LINE__);

◆ ABTS_H

#define ABTS_H

◆ ABTS_INT_EQUAL

#define ABTS_INT_EQUAL (   a,
  b,
 
)    abts_int_equal(a, b, c, __LINE__)

◆ ABTS_INT_NEQUAL

#define ABTS_INT_NEQUAL (   a,
  b,
 
)    abts_int_nequal(a, b, c, __LINE__)

◆ ABTS_LLONG_EQUAL

#define ABTS_LLONG_EQUAL (   a,
  b,
 
)    abts_llong_equal(a, b, c, __LINE__)

◆ ABTS_LLONG_NEQUAL

#define ABTS_LLONG_NEQUAL (   a,
  b,
 
)    abts_llong_nequal(a, b, c, __LINE__)

◆ ABTS_LONG_EQUAL

#define ABTS_LONG_EQUAL (   a,
  b,
 
)    abts_long_equal(a, b, c, __LINE__)

◆ ABTS_LONG_NEQUAL

#define ABTS_LONG_NEQUAL (   a,
  b,
 
)    abts_long_nequal(a, b, c, __LINE__)

◆ ABTS_NOT_IMPL

#define ABTS_NOT_IMPL (   a,
 
)    abts_not_impl(a, b, __LINE__);

◆ ABTS_PTR_EQUAL

#define ABTS_PTR_EQUAL (   a,
  b,
 
)    abts_ptr_equal(a, b, c, __LINE__)

◆ ABTS_PTR_NOTNULL

#define ABTS_PTR_NOTNULL (   a,
 
)    abts_ptr_notnull(a, b, __LINE__)

◆ ABTS_SIZE_EQUAL

#define ABTS_SIZE_EQUAL (   a,
  b,
 
)    abts_size_equal(a, b, c, __LINE__)

◆ ABTS_SIZE_NEQUAL

#define ABTS_SIZE_NEQUAL (   a,
  b,
 
)    abts_size_nequal(a, b, c, __LINE__)

◆ ABTS_SKIP

#define ABTS_SKIP (   tc,
  data,
  msg 
)
Value:
do { \
((void)(data)); \
abts_skip((tc), (msg), __LINE__); \
} while (0)

◆ ABTS_STR_EQUAL

#define ABTS_STR_EQUAL (   a,
  b,
 
)    abts_str_equal(a, b, c, __LINE__)

◆ ABTS_STR_NEQUAL

#define ABTS_STR_NEQUAL (   a,
  b,
  c,
 
)    abts_str_nequal(a, b, c, d, __LINE__)

◆ ABTS_TRUE

#define ABTS_TRUE (   a,
 
)    abts_true(a, b, __LINE__);

◆ ABTS_UINT_EQUAL

#define ABTS_UINT_EQUAL (   a,
  b,
 
)    abts_uint_equal(a, b, c, __LINE__)

◆ ABTS_UINT_NEQUAL

#define ABTS_UINT_NEQUAL (   a,
  b,
 
)    abts_uint_nequal(a, b, c, __LINE__)

◆ ABTS_ULLONG_EQUAL

#define ABTS_ULLONG_EQUAL (   a,
  b,
 
)    abts_ullong_equal(a, b, c, __LINE__)

◆ ABTS_ULLONG_NEQUAL

#define ABTS_ULLONG_NEQUAL (   a,
  b,
 
)    abts_ullong_nequal(a, b, c, __LINE__)

◆ ABTS_ULONG_EQUAL

#define ABTS_ULONG_EQUAL (   a,
  b,
 
)    abts_ulong_equal(a, b, c, __LINE__)

◆ ABTS_ULONG_NEQUAL

#define ABTS_ULONG_NEQUAL (   a,
  b,
 
)    abts_ulong_nequal(a, b, c, __LINE__)

◆ ADD_SUITE

#define ADD_SUITE (   suite)    abts_add_suite(suite, __FILE__);

◆ FALSE

#define FALSE   0

◆ TRUE

#define TRUE   1

Typedef Documentation

◆ abts_case

typedef struct abts_case abts_case

◆ abts_suite

typedef struct abts_suite abts_suite

◆ sub_suite

typedef struct sub_suite sub_suite

◆ test_func

typedef void(* test_func) (abts_case *tc, void *data)

Function Documentation

◆ abts_add_suite()

abts_suite* abts_add_suite ( abts_suite suite,
const char *  suite_name 
)

◆ abts_assert()

void abts_assert ( abts_case tc,
const char *  message,
int  condition,
int  lineno 
)

◆ abts_fail()

void abts_fail ( abts_case tc,
const char *  message,
int  lineno 
)

◆ abts_int_equal()

void abts_int_equal ( abts_case tc,
const int  expected,
const int  actual,
int  lineno 
)

◆ abts_int_nequal()

void abts_int_nequal ( abts_case tc,
const int  expected,
const int  actual,
int  lineno 
)

◆ abts_llong_equal()

void abts_llong_equal ( abts_case tc,
const long long  expected,
const long long  actual,
int  lineno 
)

◆ abts_llong_nequal()

void abts_llong_nequal ( abts_case tc,
const long long  expected,
const long long  actual,
int  lineno 
)

◆ abts_log_message()

void abts_log_message ( const char *  fmt,
  ... 
)

◆ abts_long_equal()

void abts_long_equal ( abts_case tc,
const long  expected,
const long  actual,
int  lineno 
)

◆ abts_long_nequal()

void abts_long_nequal ( abts_case tc,
const long  expected,
const long  actual,
int  lineno 
)

◆ abts_not_impl()

void abts_not_impl ( abts_case tc,
const char *  message,
int  lineno 
)

◆ abts_ptr_equal()

void abts_ptr_equal ( abts_case tc,
const void *  expected,
const void *  actual,
int  lineno 
)

◆ abts_ptr_notnull()

void abts_ptr_notnull ( abts_case tc,
const void *  ptr,
int  lineno 
)

◆ abts_run_test()

void abts_run_test ( abts_suite ts,
test_func  f,
void *  value 
)

◆ abts_size_equal()

void abts_size_equal ( abts_case tc,
size_t  expected,
size_t  actual,
int  lineno 
)

◆ abts_size_nequal()

void abts_size_nequal ( abts_case tc,
size_t  expected,
size_t  actual,
int  lineno 
)

◆ abts_skip()

void abts_skip ( abts_case tc,
const char *  message,
int  lineno 
)

◆ abts_str_equal()

void abts_str_equal ( abts_case tc,
const char *  expected,
const char *  actual,
int  lineno 
)

◆ abts_str_nequal()

void abts_str_nequal ( abts_case tc,
const char *  expected,
const char *  actual,
size_t  n,
int  lineno 
)

◆ abts_true()

void abts_true ( abts_case tc,
int  condition,
int  lineno 
)

◆ abts_uint_equal()

void abts_uint_equal ( abts_case tc,
const unsigned int  expected,
const unsigned int  actual,
int  lineno 
)

◆ abts_uint_nequal()

void abts_uint_nequal ( abts_case tc,
const unsigned int  expected,
const unsigned int  actual,
int  lineno 
)

◆ abts_ullong_equal()

void abts_ullong_equal ( abts_case tc,
const unsigned long long  expected,
const unsigned long long  actual,
int  lineno 
)

◆ abts_ullong_nequal()

void abts_ullong_nequal ( abts_case tc,
const unsigned long long  expected,
const unsigned long long  actual,
int  lineno 
)

◆ abts_ulong_equal()

void abts_ulong_equal ( abts_case tc,
const unsigned long  expected,
const unsigned long  actual,
int  lineno 
)

◆ abts_ulong_nequal()

void abts_ulong_nequal ( abts_case tc,
const unsigned long  expected,
const unsigned long  actual,
int  lineno 
)

◆ run_tests()

abts_suite* run_tests ( abts_suite suite)

◆ run_tests1()

abts_suite* run_tests1 ( abts_suite suite)