Assertions 3 CUTTER Library
Assertions Checks that your program works as you expect.

## Synopsis

    void                cut_assert                          (cut_boolean expression,
                                                             ...);
    void                cut_assert_true                     (cut_boolean expression,
                                                             ...);
    void                cut_assert_false                    (cut_boolean expression,
                                                             ...);
    void                cut_assert_equal_boolean            (cut_boolean expected,
                                                             cut_boolean actual,
                                                             ...);
    void                cut_assert_not_equal_boolean        (cut_boolean expected,
                                                             cut_boolean actual,
                                                             ...);
    void                cut_assert_null                     (const void *expression,
                                                             ...);
    void                cut_assert_null_string              (const char *string,
                                                             ...);
    void                cut_assert_not_null                 (const void *expression,
                                                             ...);
    void                cut_assert_equal_int                (int expected,
                                                             int actual,
                                                             ...);
    void                cut_assert_not_equal_int            (int expected,
                                                             int actual,
                                                             ...);
    #define             cut_assert_equal_int_least8         (expected,
                                                             actual,
                                                             ...)
    #define             cut_assert_not_equal_int_least8     (expected,
                                                             actual,
                                                             ...)
    #define             cut_assert_equal_int_least16        (expected,
                                                             actual,
                                                             ...)
    #define             cut_assert_not_equal_int_least16    (expected,
                                                             actual,
                                                             ...)
    #define             cut_assert_equal_int_least32        (expected,
                                                             actual,
                                                             ...)
    #define             cut_assert_not_equal_int_least32    (expected,
                                                             actual,
                                                             ...)
    #define             cut_assert_equal_int_least64        (expected,
                                                             actual,
                                                             ...)
    #define             cut_assert_not_equal_int_least64    (expected,
                                                             actual,
                                                             ...)
    #define             cut_assert_equal_int_fast8          (expected,
                                                             actual,
                                                             ...)
    #define             cut_assert_not_equal_int_fast8      (expected,
                                                             actual,
                                                             ...)
    #define             cut_assert_equal_int_fast16         (expected,
                                                             actual,
                                                             ...)
    #define             cut_assert_not_equal_int_fast16     (expected,
                                                             actual,
                                                             ...)
    #define             cut_assert_equal_int_fast32         (expected,
                                                             actual,
                                                             ...)
    #define             cut_assert_not_equal_int_fast32     (expected,
                                                             actual,
                                                             ...)
    #define             cut_assert_equal_int_fast64         (expected,
                                                             actual,
                                                             ...)
    #define             cut_assert_not_equal_int_fast64     (expected,
                                                             actual,
                                                             ...)
    #define             cut_assert_equal_intptr             (expected,
                                                             actual,
                                                             ...)
    #define             cut_assert_not_equal_intptr         (expected,
                                                             actual,
                                                             ...)
    #define             cut_assert_equal_intmax             (expected,
                                                             actual,
                                                             ...)
    #define             cut_assert_not_equal_intmax         (expected,
                                                             actual,
                                                             ...)
    void                cut_assert_equal_uint               (unsigned int expected,
                                                             unsigned int actual,
                                                             ...);
    void                cut_assert_not_equal_uint           (unsigned int expected,
                                                             unsigned int actual,
                                                             ...);
    #define             cut_assert_equal_uint_least8        (expected,
                                                             actual,
                                                             ...)
    #define             cut_assert_not_equal_uint_least8    (expected,
                                                             actual,
                                                             ...)
    #define             cut_assert_equal_uint_least16       (expected,
                                                             actual,
                                                             ...)
    #define             cut_assert_not_equal_uint_least16   (expected,
                                                             actual,
                                                             ...)
    #define             cut_assert_equal_uint_least32       (expected,
                                                             actual,
                                                             ...)
    #define             cut_assert_not_equal_uint_least32   (expected,
                                                             actual,
                                                             ...)
    #define             cut_assert_equal_uint_least64       (expected,
                                                             actual,
                                                             ...)
    #define             cut_assert_not_equal_uint_least64   (expected,
                                                             actual,
                                                             ...)
    #define             cut_assert_equal_uint_fast8         (expected,
                                                             actual,
                                                             ...)
    #define             cut_assert_not_equal_uint_fast8     (expected,
                                                             actual,
                                                             ...)
    #define             cut_assert_equal_uint_fast16        (expected,
                                                             actual,
                                                             ...)
    #define             cut_assert_not_equal_uint_fast16    (expected,
                                                             actual,
                                                             ...)
    #define             cut_assert_equal_uint_fast32        (expected,
                                                             actual,
                                                             ...)
    #define             cut_assert_not_equal_uint_fast32    (expected,
                                                             actual,
                                                             ...)
    #define             cut_assert_equal_uint_fast64        (expected,
                                                             actual,
                                                             ...)
    #define             cut_assert_not_equal_uint_fast64    (expected,
                                                             actual,
                                                             ...)
    #define             cut_assert_equal_uintptr            (expected,
                                                             actual,
                                                             ...)
    #define             cut_assert_not_equal_uintptr        (expected,
                                                             actual,
                                                             ...)
    #define             cut_assert_equal_uintmax            (expected,
                                                             actual,
                                                             ...)
    #define             cut_assert_not_equal_uintmax        (expected,
                                                             actual,
                                                             ...)
    void                cut_assert_equal_size               (size_t expected,
                                                             size_t actual,
                                                             ...);
    void                cut_assert_not_equal_size           (size_t expected,
                                                             size_t actual,
                                                             ...);
    void                cut_assert_equal_double             (double expected,
                                                             double error,
                                                             double actual,
                                                             ...);
    void                cut_assert_not_equal_double         (double expected,
                                                             double error,
                                                             double actual,
                                                             ...);
    #define             cut_assert_equal_char               (expected,
                                                             actual,
                                                             ...)
    #define             cut_assert_not_equal_char           (expected,
                                                             actual,
                                                             ...)
    void                cut_assert_equal_string             (const char *expected,
                                                             const char *actual,
                                                             ...);
    void                cut_assert_not_equal_string         (const char *expected,
                                                             const char *actual,
                                                             ...);
    void                cut_assert_equal_string_with_free   (const char *expected,
                                                             const char *actual,
                                                             ...);
    void                cut_assert_equal_string_or_null     (const char *expected,
                                                             const char *actual,
                                                             ...);
    void                cut_assert_equal_substring          (const char *expected,
                                                             const char *actual,
                                                             size_t length,
                                                             ...);
    void                cut_assert_not_equal_substring      (const char *expected,
                                                             const char *actual,
                                                             size_t length,
                                                             ...);
    void                cut_assert_equal_memory             (const void *expected,
                                                             size_t expected_size,
                                                             const void *actual,
                                                             size_t actual_size,
                                                             ...);
    void                cut_assert_not_equal_memory         (const void *expected,
                                                             size_t expected_size,
                                                             const void *actual,
                                                             size_t actual_size,
                                                             ...);
    void                cut_assert_equal_string_array       (char **expected,
                                                             char **actual,
                                                             ...);
    void                cut_assert_equal_string_array_with_free
                                                            (char **expected,
                                                             char **actual,
                                                             ...);
    #define             cut_assert_operator                 (lhs,
                                                             operator,
                                                             rhs,
                                                             ...)
    #define             cut_assert_operator_int             (lhs,
                                                             operator,
                                                             rhs,
                                                             ...)
    #define             cut_assert_operator_uint            (lhs,
                                                             operator,
                                                             rhs,
                                                             ...)
    #define             cut_assert_operator_size            (lhs,
                                                             operator,
                                                             rhs,
                                                             ...)
    #define             cut_assert_operator_double          (lhs,
                                                             operator,
                                                             rhs,
                                                             ...)
    #define             cut_assert_equal                    (function,
                                                             expected,
                                                             actual,
                                                             ...)
    void                cut_assert_errno                    (...);
    void                cut_assert_file_exist               (const char *path,
                                                             ...);
    void                cut_assert_path_exist               (const char *path,
                                                             ...);
    void                cut_assert_exist_path               (const char *path,
                                                             ...);
    void                cut_assert_path_not_exist           (const char *path,
                                                             ...);
    void                cut_assert_not_exist_path           (const char *path,
                                                             ...);
    void                cut_assert_match                    (const char *pattern,
                                                             const char *actual,
                                                             ...);
    void                cut_assert_match_with_free          (const char *pattern,
                                                             const char *actual,
                                                             ...);
    void                cut_assert_equal_pointer            (const void *expected,
                                                             const void *actual,
                                                             ...);
    void                cut_assert_equal_fixture_data_string
                                                            (const char *expected,
                                                             const void *path,
                                                             ...);
    #define             cut_assert_equal_sockaddr           (expected,
                                                             actual,
                                                             ...)
    #define             cut_assert_equal_file_raw           (expected,
                                                             actual,
                                                             ...)
    #define             cut_assert_not_equal_file_raw       (expected,
                                                             actual,
                                                             ...)
    void                cut_error                           (const char *format,
                                                             ...);
    void                cut_error_errno                     (...);
    void                cut_fail                            (const char *format,
                                                             ...);
    void                cut_pend                            (const char *format,
                                                             ...);
    void                cut_pending                         (const char *format,
                                                             ...);
    void                cut_notify                          (const char *format,
                                                             ...);
    void                cut_omit                            (const char *format,
                                                             ...);
    void                cut_return                          (void);

## Description

To check that your program works as you expect, you use `cut_assert_XXX()` where you want to check expected value is got.

e.g.:

    cut_assert_equal_int(3, 1 + 2);

## Details

### cut_assert ()

    void                cut_assert                          (cut_boolean expression,
                                                             ...);

Passes if expression is not 0 or `NULL`.

e.g.:

    char *string;
    string = malloc(16);
    cut_assert(string);

    MyObject *object;
    object = my_object_new();
    cut_assert(object, cut_message("my_object_new() should not be failed"));

expression :

  the expression to be checked.

... :

  optional message. See `cut_message()` for details.

cut_assert

### cut_assert_true ()

    void                cut_assert_true                     (cut_boolean expression,
                                                             ...);

Passes if expression is `CUT_TRUE` value (not 0 or `NULL`).

expression :

  the expression to be checked.

... :

  optional message. See `cut_message()` for details.

Since 0.9

cut_assert_true

### cut_assert_false ()

    void                cut_assert_false                    (cut_boolean expression,
                                                             ...);

Passes if expression is 0 or `NULL`.

expression :

  the expression to be checked.

... :

  optional message. See `cut_message()` for details.

Since 0.9

cut_assert_false

### cut_assert_equal_boolean ()

    void                cut_assert_equal_boolean            (cut_boolean expected,
                                                             cut_boolean actual,
                                                             ...);

Passes if both of expected and actual are `CUT_TRUE` value or both of expected and actual are `CUT_FALSE` value.

e.g.:

    cut_assert_equal_boolean(CUT_TRUE, CUT_TRUE);   -> Pass
    cut_assert_equal_boolean(CUT_FALSE, CUT_FALSE); -> Pass
    cut_assert_equal_boolean(CUT_TRUE, CUT_FALSE);  -> Fail

expected :

  the expected boolean.

actual :

  the actual boolean.

... :

  optional message. See `cut_message()` for details.

Since 1.0.7

cut_assert_equal_boolean

### cut_assert_not_equal_boolean ()

    void                cut_assert_not_equal_boolean        (cut_boolean expected,
                                                             cut_boolean actual,
                                                             ...);

Passes if expected is `CUT_TRUE` value but actual is `CUT_FALSE` value or expected is `CUT_FALSE` value but actual is `CUT_TRUE` value.

e.g.:

    cut_assert_not_equal_boolean(CUT_TRUE, CUT_TRUE);   -> Fail
    cut_assert_not_equal_boolean(CUT_FALSE, CUT_FALSE); -> Fail
    cut_assert_not_equal_boolean(CUT_TRUE, CUT_FALSE);  -> Pass

expected :

  the expected boolean.

actual :

  the actual boolean.

... :

  optional message. See `cut_message()` for details.

Since 1.0.7

cut_assert_not_equal_boolean

### cut_assert_null ()

    void                cut_assert_null                     (const void *expression,
                                                             ...);

Passes if expression is `NULL`.

expression :

  the expression to be checked.

... :

  optional message. See `cut_message()` for details.

cut_assert_null

### cut_assert_null_string ()

    void                cut_assert_null_string              (const char *string,
                                                             ...);

Passes if string is `NULL`.

string :

  the string to be checked.

... :

  optional message. See `cut_message()` for details.

Since 0.3

cut_assert_null_string

### cut_assert_not_null ()

    void                cut_assert_not_null                 (const void *expression,
                                                             ...);

Passes if expression is not `NULL`.

expression :

  the expression to be checked.

... :

  optional message. See `cut_message()` for details.

cut_assert_not_null

### cut_assert_equal_int ()

    void                cut_assert_equal_int                (int expected,
                                                             int actual,
                                                             ...);

Passes if expected == actual.

expected :

  an expected integer value.

actual :

  an actual integer value.

... :

  optional message. See `cut_message()` for details.

cut_assert_equal_int

### cut_assert_not_equal_int ()

    void                cut_assert_not_equal_int            (int expected,
                                                             int actual,
                                                             ...);

Passes if expected != actual.

expected :

  an expected integer value.

actual :

  an actual integer value.

... :

  optional message. See `cut_message()` for details.

Since 1.0.7

cut_assert_not_equal_int

### cut_assert_equal_int_least8()

    #define             cut_assert_equal_int_least8(expected, actual, ...)

Passes if expected == actual.

This function is available only when CUT_SUPPORT_C99_STDINT_TYPES is defined.

expected :

  an expected integer value.

actual :

  an actual integer value.

... :

  optional message. See `cut_message()` for details.

Since 1.1.0

cut_assert_equal_int_least8

### cut_assert_not_equal_int_least8()

    #define             cut_assert_not_equal_int_least8(expected, actual, ...)

Passes if expected != actual.

This function is available only when CUT_SUPPORT_C99_STDINT_TYPES is defined.

expected :

  an expected integer value.

actual :

  an actual integer value.

... :

  optional message. See `cut_message()` for details.

Since 1.1.0

cut_assert_not_equal_int_least8

### cut_assert_equal_int_least16()

    #define             cut_assert_equal_int_least16(expected, actual, ...)

Passes if expected == actual.

This function is available only when CUT_SUPPORT_C99_STDINT_TYPES is defined.

expected :

  an expected integer value.

actual :

  an actual integer value.

... :

  optional message. See `cut_message()` for details.

Since 1.1.0

cut_assert_equal_int_least16

### cut_assert_not_equal_int_least16()

    #define             cut_assert_not_equal_int_least16(expected, actual, ...)

Passes if expected != actual.

This function is available only when CUT_SUPPORT_C99_STDINT_TYPES is defined.

expected :

  an expected integer value.

actual :

  an actual integer value.

... :

  optional message. See `cut_message()` for details.

Since 1.1.0

cut_assert_not_equal_int_least16

### cut_assert_equal_int_least32()

    #define             cut_assert_equal_int_least32(expected, actual, ...)

Passes if expected == actual.

This function is available only when CUT_SUPPORT_C99_STDINT_TYPES is defined.

expected :

  an expected integer value.

actual :

  an actual integer value.

... :

  optional message. See `cut_message()` for details.

Since 1.1.0

cut_assert_equal_int_least32

### cut_assert_not_equal_int_least32()

    #define             cut_assert_not_equal_int_least32(expected, actual, ...)

Passes if expected != actual.

This function is available only when CUT_SUPPORT_C99_STDINT_TYPES is defined.

expected :

  an expected integer value.

actual :

  an actual integer value.

... :

  optional message. See `cut_message()` for details.

Since 1.1.0

cut_assert_not_equal_int_least32

### cut_assert_equal_int_least64()

    #define             cut_assert_equal_int_least64(expected, actual, ...)

Passes if expected == actual.

This function is available only when CUT_SUPPORT_C99_STDINT_TYPES is defined.

expected :

  an expected integer value.

actual :

  an actual integer value.

... :

  optional message. See `cut_message()` for details.

Since 1.1.0

cut_assert_equal_int_least64

### cut_assert_not_equal_int_least64()

    #define             cut_assert_not_equal_int_least64(expected, actual, ...)

Passes if expected != actual.

This function is available only when CUT_SUPPORT_C99_STDINT_TYPES is defined.

expected :

  an expected integer value.

actual :

  an actual integer value.

... :

  optional message. See `cut_message()` for details.

Since 1.1.0

cut_assert_not_equal_int_least64

### cut_assert_equal_int_fast8()

    #define             cut_assert_equal_int_fast8(expected, actual, ...)

Passes if expected == actual.

This function is available only when CUT_SUPPORT_C99_STDINT_TYPES is defined.

expected :

  an expected integer value.

actual :

  an actual integer value.

... :

  optional message. See `cut_message()` for details.

Since 1.1.0

cut_assert_equal_int_fast8

### cut_assert_not_equal_int_fast8()

    #define             cut_assert_not_equal_int_fast8(expected, actual, ...)

Passes if expected != actual.

This function is available only when CUT_SUPPORT_C99_STDINT_TYPES is defined.

expected :

  an expected integer value.

actual :

  an actual integer value.

... :

  optional message. See `cut_message()` for details.

Since 1.1.0

cut_assert_not_equal_int_fast8

### cut_assert_equal_int_fast16()

    #define             cut_assert_equal_int_fast16(expected, actual, ...)

Passes if expected == actual.

This function is available only when CUT_SUPPORT_C99_STDINT_TYPES is defined.

expected :

  an expected integer value.

actual :

  an actual integer value.

... :

  optional message. See `cut_message()` for details.

Since 1.1.0

cut_assert_equal_int_fast16

### cut_assert_not_equal_int_fast16()

    #define             cut_assert_not_equal_int_fast16(expected, actual, ...)

Passes if expected != actual.

This function is available only when CUT_SUPPORT_C99_STDINT_TYPES is defined.

expected :

  an expected integer value.

actual :

  an actual integer value.

... :

  optional message. See `cut_message()` for details.

Since 1.1.0

cut_assert_not_equal_int_fast16

### cut_assert_equal_int_fast32()

    #define             cut_assert_equal_int_fast32(expected, actual, ...)

Passes if expected == actual.

This function is available only when CUT_SUPPORT_C99_STDINT_TYPES is defined.

expected :

  an expected integer value.

actual :

  an actual integer value.

... :

  optional message. See `cut_message()` for details.

Since 1.1.0

cut_assert_equal_int_fast32

### cut_assert_not_equal_int_fast32()

    #define             cut_assert_not_equal_int_fast32(expected, actual, ...)

Passes if expected != actual.

This function is available only when CUT_SUPPORT_C99_STDINT_TYPES is defined.

expected :

  an expected integer value.

actual :

  an actual integer value.

... :

  optional message. See `cut_message()` for details.

Since 1.1.0

cut_assert_not_equal_int_fast32

### cut_assert_equal_int_fast64()

    #define             cut_assert_equal_int_fast64(expected, actual, ...)

Passes if expected == actual.

This function is available only when CUT_SUPPORT_C99_STDINT_TYPES is defined.

expected :

  an expected integer value.

actual :

  an actual integer value.

... :

  optional message. See `cut_message()` for details.

Since 1.1.0

cut_assert_equal_int_fast64

### cut_assert_not_equal_int_fast64()

    #define             cut_assert_not_equal_int_fast64(expected, actual, ...)

Passes if expected != actual.

This function is available only when CUT_SUPPORT_C99_STDINT_TYPES is defined.

expected :

  an expected integer value.

actual :

  an actual integer value.

... :

  optional message. See `cut_message()` for details.

Since 1.1.0

cut_assert_not_equal_int_fast64

### cut_assert_equal_intptr()

    #define             cut_assert_equal_intptr(expected, actual, ...)

Passes if expected == actual.

This function is available only when CUT_SUPPORT_C99_STDINT_TYPES is defined.

expected :

  an expected integer value.

actual :

  an actual integer value.

... :

  optional message. See `cut_message()` for details.

Since 1.1.0

cut_assert_equal_intptr

### cut_assert_not_equal_intptr()

    #define             cut_assert_not_equal_intptr(expected, actual, ...)

Passes if expected != actual.

This function is available only when CUT_SUPPORT_C99_STDINT_TYPES is defined.

expected :

  an expected integer value.

actual :

  an actual integer value.

... :

  optional message. See `cut_message()` for details.

Since 1.1.0

cut_assert_not_equal_intptr

### cut_assert_equal_intmax()

    #define             cut_assert_equal_intmax(expected, actual, ...)

Passes if expected == actual.

This function is available only when CUT_SUPPORT_C99_STDINT_TYPES is defined.

expected :

  an expected integer value.

actual :

  an actual integer value.

... :

  optional message. See `cut_message()` for details.

Since 1.1.0

cut_assert_equal_intmax

### cut_assert_not_equal_intmax()

    #define             cut_assert_not_equal_intmax(expected, actual, ...)

Passes if expected != actual.

This function is available only when CUT_SUPPORT_C99_STDINT_TYPES is defined.

expected :

  an expected integer value.

actual :

  an actual integer value.

... :

  optional message. See `cut_message()` for details.

Since 1.1.0

cut_assert_not_equal_intmax

### cut_assert_equal_uint ()

    void                cut_assert_equal_uint               (unsigned int expected,
                                                             unsigned int actual,
                                                             ...);

Passes if expected == actual.

expected :

  an expected unsigned integer value.

actual :

  an actual unsigned integer value.

... :

  optional message. See `cut_message()` for details.

cut_assert_equal_uint

### cut_assert_not_equal_uint ()

    void                cut_assert_not_equal_uint           (unsigned int expected,
                                                             unsigned int actual,
                                                             ...);

Passes if expected != actual.

expected :

  an expected unsigned integer value.

actual :

  an actual unsigned integer value.

... :

  optional message. See `cut_message()` for details.

Since 1.0.7

cut_assert_not_equal_uint

### cut_assert_equal_uint_least8()

    #define             cut_assert_equal_uint_least8(expected, actual, ...)

Passes if expected == actual.

This function is available only when CUT_SUPPORT_C99_STDINT_TYPES is defined.

expected :

  an expected unsigned integer value.

actual :

  an actual unsigned integer value.

... :

  optional message. See `cut_message()` for details.

Since 1.1.0

cut_assert_equal_uint_least8

### cut_assert_not_equal_uint_least8()

    #define             cut_assert_not_equal_uint_least8(expected, actual, ...)

Passes if expected != actual.

This function is available only when CUT_SUPPORT_C99_STDINT_TYPES is defined.

expected :

  an expected unsigned integer value.

actual :

  an actual unsigned integer value.

... :

  optional message. See `cut_message()` for details.

Since 1.1.0

cut_assert_not_equal_uint_least8

### cut_assert_equal_uint_least16()

    #define             cut_assert_equal_uint_least16(expected, actual, ...)

Passes if expected == actual.

This function is available only when CUT_SUPPORT_C99_STDINT_TYPES is defined.

expected :

  an expected unsigned integer value.

actual :

  an actual unsigned integer value.

... :

  optional message. See `cut_message()` for details.

Since 1.1.0

cut_assert_equal_uint_least16

### cut_assert_not_equal_uint_least16()

    #define             cut_assert_not_equal_uint_least16(expected, actual, ...)

Passes if expected != actual.

This function is available only when CUT_SUPPORT_C99_STDINT_TYPES is defined.

expected :

  an expected unsigned integer value.

actual :

  an actual unsigned integer value.

... :

  optional message. See `cut_message()` for details.

Since 1.1.0

cut_assert_not_equal_uint_least16

### cut_assert_equal_uint_least32()

    #define             cut_assert_equal_uint_least32(expected, actual, ...)

Passes if expected == actual.

This function is available only when CUT_SUPPORT_C99_STDINT_TYPES is defined.

expected :

  an expected unsigned integer value.

actual :

  an actual unsigned integer value.

... :

  optional message. See `cut_message()` for details.

Since 1.1.0

cut_assert_equal_uint_least32

### cut_assert_not_equal_uint_least32()

    #define             cut_assert_not_equal_uint_least32(expected, actual, ...)

Passes if expected != actual.

This function is available only when CUT_SUPPORT_C99_STDINT_TYPES is defined.

expected :

  an expected unsigned integer value.

actual :

  an actual unsigned integer value.

... :

  optional message. See `cut_message()` for details.

Since 1.1.0

cut_assert_not_equal_uint_least32

### cut_assert_equal_uint_least64()

    #define             cut_assert_equal_uint_least64(expected, actual, ...)

Passes if expected == actual.

This function is available only when CUT_SUPPORT_C99_STDINT_TYPES is defined.

expected :

  an expected unsigned integer value.

actual :

  an actual unsigned integer value.

... :

  optional message. See `cut_message()` for details.

Since 1.1.0

cut_assert_equal_uint_least64

### cut_assert_not_equal_uint_least64()

    #define             cut_assert_not_equal_uint_least64(expected, actual, ...)

Passes if expected != actual.

This function is available only when CUT_SUPPORT_C99_STDINT_TYPES is defined.

expected :

  an expected unsigned integer value.

actual :

  an actual unsigned integer value.

... :

  optional message. See `cut_message()` for details.

Since 1.1.0

cut_assert_not_equal_uint_least64

### cut_assert_equal_uint_fast8()

    #define             cut_assert_equal_uint_fast8(expected, actual, ...)

Passes if expected == actual.

This function is available only when CUT_SUPPORT_C99_STDINT_TYPES is defined.

expected :

  an expected unsigned integer value.

actual :

  an actual unsigned integer value.

... :

  optional message. See `cut_message()` for details.

Since 1.1.0

cut_assert_equal_uint_fast8

### cut_assert_not_equal_uint_fast8()

    #define             cut_assert_not_equal_uint_fast8(expected, actual, ...)

Passes if expected != actual.

This function is available only when CUT_SUPPORT_C99_STDINT_TYPES is defined.

expected :

  an expected unsigned integer value.

actual :

  an actual unsigned integer value.

... :

  optional message. See `cut_message()` for details.

Since 1.1.0

cut_assert_not_equal_uint_fast8

### cut_assert_equal_uint_fast16()

    #define             cut_assert_equal_uint_fast16(expected, actual, ...)

Passes if expected == actual.

This function is available only when CUT_SUPPORT_C99_STDINT_TYPES is defined.

expected :

  an expected unsigned integer value.

actual :

  an actual unsigned integer value.

... :

  optional message. See `cut_message()` for details.

Since 1.1.0

cut_assert_equal_uint_fast16

### cut_assert_not_equal_uint_fast16()

    #define             cut_assert_not_equal_uint_fast16(expected, actual, ...)

Passes if expected != actual.

This function is available only when CUT_SUPPORT_C99_STDINT_TYPES is defined.

expected :

  an expected unsigned integer value.

actual :

  an actual unsigned integer value.

... :

  optional message. See `cut_message()` for details.

Since 1.1.0

cut_assert_not_equal_uint_fast16

### cut_assert_equal_uint_fast32()

    #define             cut_assert_equal_uint_fast32(expected, actual, ...)

Passes if expected == actual.

This function is available only when CUT_SUPPORT_C99_STDINT_TYPES is defined.

expected :

  an expected unsigned integer value.

actual :

  an actual unsigned integer value.

... :

  optional message. See `cut_message()` for details.

Since 1.1.0

cut_assert_equal_uint_fast32

### cut_assert_not_equal_uint_fast32()

    #define             cut_assert_not_equal_uint_fast32(expected, actual, ...)

Passes if expected != actual.

This function is available only when CUT_SUPPORT_C99_STDINT_TYPES is defined.

expected :

  an expected unsigned integer value.

actual :

  an actual unsigned integer value.

... :

  optional message. See `cut_message()` for details.

Since 1.1.0

cut_assert_not_equal_uint_fast32

### cut_assert_equal_uint_fast64()

    #define             cut_assert_equal_uint_fast64(expected, actual, ...)

Passes if expected == actual.

This function is available only when CUT_SUPPORT_C99_STDINT_TYPES is defined.

expected :

  an expected unsigned integer value.

actual :

  an actual unsigned integer value.

... :

  optional message. See `cut_message()` for details.

Since 1.1.0

cut_assert_equal_uint_fast64

### cut_assert_not_equal_uint_fast64()

    #define             cut_assert_not_equal_uint_fast64(expected, actual, ...)

Passes if expected != actual.

This function is available only when CUT_SUPPORT_C99_STDINT_TYPES is defined.

expected :

  an expected unsigned integer value.

actual :

  an actual unsigned integer value.

... :

  optional message. See `cut_message()` for details.

Since 1.1.0

cut_assert_not_equal_uint_fast64

### cut_assert_equal_uintptr()

    #define             cut_assert_equal_uintptr(expected, actual, ...)

Passes if expected == actual.

This function is available only when CUT_SUPPORT_C99_STDINT_TYPES is defined.

expected :

  an expected unsigned integer value.

actual :

  an actual unsigned integer value.

... :

  optional message. See `cut_message()` for details.

Since 1.1.0

cut_assert_equal_uintptr

### cut_assert_not_equal_uintptr()

    #define             cut_assert_not_equal_uintptr(expected, actual, ...)

Passes if expected != actual.

This function is available only when CUT_SUPPORT_C99_STDINT_TYPES is defined.

expected :

  an expected unsigned integer value.

actual :

  an actual unsigned integer value.

... :

  optional message. See `cut_message()` for details.

Since 1.1.0

cut_assert_not_equal_uintptr

### cut_assert_equal_uintmax()

    #define             cut_assert_equal_uintmax(expected, actual, ...)

Passes if expected == actual.

This function is available only when CUT_SUPPORT_C99_STDINT_TYPES is defined.

expected :

  an expected unsigned integer value.

actual :

  an actual unsigned integer value.

... :

  optional message. See `cut_message()` for details.

Since 1.1.0

cut_assert_equal_uintmax

### cut_assert_not_equal_uintmax()

    #define             cut_assert_not_equal_uintmax(expected, actual, ...)

Passes if expected != actual.

This function is available only when CUT_SUPPORT_C99_STDINT_TYPES is defined.

expected :

  an expected unsigned integer value.

actual :

  an actual unsigned integer value.

... :

  optional message. See `cut_message()` for details.

Since 1.1.0

cut_assert_not_equal_uintmax

### cut_assert_equal_size ()

    void                cut_assert_equal_size               (size_t expected,
                                                             size_t actual,
                                                             ...);

Passes if expected == actual.

expected :

  an expected size_t value.

actual :

  an actual size_t value.

... :

  optional message. See `cut_message()` for details.

Since 1.0.6

cut_assert_equal_size

### cut_assert_not_equal_size ()

    void                cut_assert_not_equal_size           (size_t expected,
                                                             size_t actual,
                                                             ...);

Passes if expected != actual.

expected :

  an expected size_t value.

actual :

  an actual size_t value.

... :

  optional message. See `cut_message()` for details.

Since 1.0.7

cut_assert_not_equal_size

### cut_assert_equal_double ()

    void                cut_assert_equal_double             (double expected,
                                                             double error,
                                                             double actual,
                                                             ...);

Passes if (expected - error) <= actual <= (expected + error).

expected :

  an expected float value.

error :

  a float value that specifies error range.

actual :

  an actual float value.

... :

  optional message. See `cut_message()` for details.

cut_assert_equal_double

### cut_assert_not_equal_double ()

    void                cut_assert_not_equal_double         (double expected,
                                                             double error,
                                                             double actual,
                                                             ...);

Passes if actual < (expected - error) && (expected + error) < actual.

expected :

  an expected float value.

error :

  a float value that specifies error range.

actual :

  an actual float value.

... :

  optional message. See `cut_message()` for details.

Since 1.0.7

cut_assert_not_equal_double

### cut_assert_equal_char()

    #define             cut_assert_equal_char(expected, actual, ...)

Passes if expected == actual.

e.g.:

    cut_assert_equal_char('a', 'a'); -> Pass
    cut_assert_equal_char('a', 'b'); -> Fail

expected :

  an expected char value.

actual :

  an actual char value.

... :

  optional message. See `cut_message()` for details.

Since 1.1.3

cut_assert_equal_char

### cut_assert_not_equal_char()

    #define             cut_assert_not_equal_char(expected, actual, ...)

Passes if expected != actual.

e.g.:

    cut_assert_not_equal_char('a', 'b'); -> Pass
    cut_assert_not_equal_char('a', 'a'); -> Fail

expected :

  an expected char value.

actual :

  an actual char value.

... :

  optional message. See `cut_message()` for details.

Since 1.1.3

cut_assert_not_equal_char

### cut_assert_equal_string ()

    void                cut_assert_equal_string             (const char *expected,
                                                             const char *actual,
                                                             ...);

Passes if both expected and actual are `NULL` or strcmp(expected, actual) == 0.

e.g.:

    cut_assert_equal_string("abc", "abc"); -> Pass
    cut_assert_equal_string(NULL, NULL);   -> Pass
    cut_assert_equal_string("abc", "ABC"); -> Fail
    cut_assert_equal_string("abc", NULL);  -> Fail
    cut_assert_equal_string(NULL, "abc");  -> Fail

expected :

  an expected string value.

actual :

  an actual string value.

... :

  optional message. See `cut_message()` for details.

cut_assert_equal_string

### cut_assert_not_equal_string ()

    void                cut_assert_not_equal_string         (const char *expected,
                                                             const char *actual,
                                                             ...);

Passes if one of expected and actual is `NULL` or strcmp(expected, actual) != 0.

e.g.:

    cut_assert_not_equal_string("abc", NULL);  -> Pass
    cut_assert_not_equal_string(NULL, "abc");  -> Pass
    cut_assert_not_equal_string("abc", "ABC"); -> Pass
    cut_assert_not_equal_string("abc", "abc"); -> Fail
    cut_assert_not_equal_string(NULL, NULL);   -> Fail

expected :

  an expected string value.

actual :

  an actual string value.

... :

  optional message. See `cut_message()` for details.

Since 1.0.7

cut_assert_not_equal_string

### cut_assert_equal_string_with_free ()

    void                cut_assert_equal_string_with_free   (const char *expected,
                                                             const char *actual,
                                                             ...);

Passes if both expected and actual are `NULL` or strcmp(expected, actual) == 0.

See also `cut_assert_equal_string()` for examples.

expected :

  an expected string value.

actual :

  an actual string value that is freed.

... :

  optional message. See `cut_message()` for details.

Since 0.3

cut_assert_equal_string_with_free

### cut_assert_equal_string_or_null ()

    void                cut_assert_equal_string_or_null     (const char *expected,
                                                             const char *actual,
                                                             ...);

`cut_assert_equal_string_or_null` has been deprecated since version 0.3 and should not be used in newly-written code. Use `cut_assert_equal_string()` instead.

expected :

  an expected string value.

actual :

  an actual string value.

... :

  optional message. See `cut_message()` for details.

cut_assert_equal_string_or_null

### cut_assert_equal_substring ()

    void                cut_assert_equal_substring          (const char *expected,
                                                             const char *actual,
                                                             size_t length,
                                                             ...);

Passes if (1) both expected and actual are `NULL` and length == 1 or (2) strncmp(expected, actual, length) == 0.

e.g.:

    cut_assert_equal_substring("abcdef", "abcDEF", 3); -> Pass
    cut_assert_equal_substring(NULL, NULL, 0);         -> Pass
    cut_assert_equal_substring(NULL, NULL, 3);         -> Fail
    cut_assert_equal_substring("abc", "ABC", 3);       -> Fail
    cut_assert_equal_substring("abc", NULL, 3);        -> Fail
    cut_assert_equal_substring(NULL, "abc", 3);        -> Fail

expected :

  an expected string value.

actual :

  an actual string value.

length :

  compared string length.

... :

  optional message. See `cut_message()` for details.

Since 1.0.7

cut_assert_equal_substring

### cut_assert_not_equal_substring ()

    void                cut_assert_not_equal_substring      (const char *expected,
                                                             const char *actual,
                                                             size_t length,
                                                             ...);

Passes if (1) one of expected and actual is `NULL` or (2) strncmp(expected, actual, length) != 0.

e.g.:

    cut_assert_not_equal_substring("abc", "ABC", 3);       -> Pass
    cut_assert_not_equal_substring("abc", NULL, 3);        -> Pass
    cut_assert_not_equal_substring(NULL, "abc", 3);        -> Pass
    cut_assert_not_equal_substring("abcdef", "abcDEF", 3); -> Fail
    cut_assert_not_equal_substring(NULL, NULL, 0);         -> Fail
    cut_assert_not_equal_substring(NULL, NULL, 3);         -> Fail

expected :

  an expected string value.

actual :

  an actual string value.

length :

  compared string length.

... :

  optional message. See `cut_message()` for details.

Since 1.0.7

cut_assert_not_equal_substring

### cut_assert_equal_memory ()

    void                cut_assert_equal_memory             (const void *expected,
                                                             size_t expected_size,
                                                             const void *actual,
                                                             size_t actual_size,
                                                             ...);

Passes if expected_size == actual_size and memcmp(expected, actual, expected_size) == 0.

expected :

  an expected data.

expected_size :

  a size of expected.

actual :

  an actual data.

actual_size :

  a size of actual.

... :

  optional message. See `cut_message()` for details.

cut_assert_equal_memory

### cut_assert_not_equal_memory ()

    void                cut_assert_not_equal_memory         (const void *expected,
                                                             size_t expected_size,
                                                             const void *actual,
                                                             size_t actual_size,
                                                             ...);

Passes if expected_size != actual_size or memcmp(expected, actual, expected_size) != 0.

expected :

  an expected data.

expected_size :

  a size of expected.

actual :

  an actual data.

actual_size :

  a size of actual.

... :

  optional message. See `cut_message()` for details.

Since 1.0.7

cut_assert_not_equal_memory

### cut_assert_equal_string_array ()

    void                cut_assert_equal_string_array       (char **expected,
                                                             char **actual,
                                                             ...);

Passes if both expected and actual are not `NULL` and have same content (`strcmp()` == 0) strings.

expected :

  an expected `NULL`-terminated array of strings.

actual :

  an actual `NULL`-terminated array of strings.

... :

  optional message. See `cut_message()` for details.

cut_assert_equal_string_array

### cut_assert_equal_string_array_with_free ()

    void                cut_assert_equal_string_array_with_free
                                                            (char **expected,
                                                             char **actual,
                                                             ...);

Passes if both expected and actual are not `NULL` and have same content (`strcmp()` == 0) strings.

expected :

  an expected `NULL`-terminated array of strings.

actual :

  an actual `NULL`-terminated array of strings that are freed.

... :

  optional message. See `cut_message()` for details.

Since 0.9

cut_assert_equal_string_array_with_free

### cut_assert_operator()

    #define             cut_assert_operator(lhs, operator, rhs, ...)

Passes if (lhs operator rhs) is TRUE.

e.g.:

    cut_assert_operator(1, <, 2) -> (1 < 2);

lhs :

  a left hand side value.

operator :

  a binary operator.

rhs :

  a right hand side value.

... :

  optional message. See `cut_message()` for details.

cut_assert_operator

### cut_assert_operator_int()

    #define             cut_assert_operator_int(lhs, operator, rhs, ...)

Passes if (lhs operator rhs) is TRUE.

e.g.:

    cut_assert_operator_int(1, <, 2) -> (1 < 2);

lhs :

  a left hand side integer value.

operator :

  a binary operator.

rhs :

  a right hand side integer value.

... :

  optional message. See `cut_message()` for details.

cut_assert_operator_int

### cut_assert_operator_uint()

    #define             cut_assert_operator_uint(lhs, operator, rhs, ...)

Passes if (lhs operator rhs) is TRUE.

e.g.:

    cut_assert_operator_uint(1, <, 2) -> (1 < 2);

lhs :

  a left hand side unsigned integer value.

operator :

  a binary operator.

rhs :

  a right hand side unsigned integer value.

... :

  optional message. See `cut_message()` for details.

Since 1.0.5

cut_assert_operator_uint

### cut_assert_operator_size()

    #define             cut_assert_operator_size(lhs, operator, rhs, ...)

Passes if (lhs operator rhs) is TRUE.

e.g.:

    cut_assert_operator_size(1, <, 2) -> (1 < 2);

lhs :

  a left hand side size_t value.

operator :

  a binary operator.

rhs :

  a right hand side size_t value.

... :

  optional message. See `cut_message()` for details.

Since 1.0.5

cut_assert_operator_size

### cut_assert_operator_double()

    #define             cut_assert_operator_double(lhs, operator, rhs, ...)

Passes if (lhs operator rhs) is TRUE.

e.g.:

    cut_assert_operator_double(1.1, <, 2.2) -> (1.1 < 2.2);

lhs :

  a left hand side double value.

operator :

  a binary operator.

rhs :

  a right hand side double value.

... :

  optional message. See `cut_message()` for details.

Since 1.0.5

cut_assert_operator_double

### cut_assert_equal()

    #define             cut_assert_equal(function, expected, actual, ...)

Passes if function(expected, actual) returns `CUT_TRUE`.

e.g.:

    cut_assert_equal(!strcmp, "abc", "abc"); -> Pass

function :

  a function that compares actual with expected.

expected :

  an expected value.

actual :

  an actual value.

... :

  optional message. See `cut_message()` for details.

cut_assert_equal

### cut_assert_errno ()

    void                cut_assert_errno                    (...);

Passes if errno is 0.

e.g.:

    count = write(stdout, buffer, strlen(buffer));
    cut_assert_errno("Failed to write");            -> Pass when count != -1

... :

  optional message. See `cut_message()` for details.

Since 0.8

cut_assert_errno

### cut_assert_file_exist ()

    void                cut_assert_file_exist               (const char *path,
                                                             ...);

`cut_assert_file_exist` has been deprecated since version 1.0.2 and should not be used in newly-written code. Use `cut_assert_path_exist()` instead.

Passes if path exists. It may or may not be a regular file.

e.g.:

    cut_assert_file_exist("/tmp");             -> Pass on many environment
    cut_assert_file_exist("/non-existent");    -> Fail

path :

  the path to test.

... :

  optional message. See `cut_message()` for details.

Since 0.9

cut_assert_file_exist
cut_assert_file_exist

### cut_assert_path_exist ()

    void                cut_assert_path_exist               (const char *path,
                                                             ...);

`cut_assert_path_exist` has been deprecated since version 1.1.5 and should not be used in newly-written code. Use `cut_assert_exist_path()` instead.

Passes if path exists. It may or may not be a regular file.

e.g.:

    cut_assert_path_exist("/tmp");             -> Pass on many environment
    cut_assert_path_exist("/non-existent");    -> Fail

path :

  the path to test.

... :

  optional message. See `cut_message()` for details.

Since 1.0.2

cut_assert_path_exist
cut_assert_path_exist

### cut_assert_exist_path ()

    void                cut_assert_exist_path               (const char *path,
                                                             ...);

Passes if path exists. It may or may not be a regular file.

e.g.:

    cut_assert_exist_path("/tmp");             -> Pass on many environment
    cut_assert_exist_path("/non-existent");    -> Fail

path :

  the path to test.

... :

  optional message. See `cut_message()` for details.

Since 1.1.5

cut_assert_exist_path

### cut_assert_path_not_exist ()

    void                cut_assert_path_not_exist           (const char *path,
                                                             ...);

`cut_assert_path_not_exist` has been deprecated since version 1.1.5 and should not be used in newly-written code. Use `cut_assert_not_exist_path()` instead.

Passes if path doesn't exist.

e.g.:

    cut_assert_path_not_exist("/non-existent");    -> Pass on many environment
    cut_assert_path_not_exist("/tmp");             -> Fail

path :

  the path to test.

... :

  optional message. See `cut_message()` for details.

Since 1.0.2

cut_assert_path_not_exist
cut_assert_path_not_exist

### cut_assert_not_exist_path ()

    void                cut_assert_not_exist_path           (const char *path,
                                                             ...);

Passes if path doesn't exist.

e.g.:

    cut_assert_not_exist_path("/non-existent");    -> Pass on many environment
    cut_assert_not_exist_path("/tmp");             -> Fail

path :

  the path to test.

... :

  optional message. See `cut_message()` for details.

Since 1.1.5

cut_assert_not_exist_path

### cut_assert_match ()

    void                cut_assert_match                    (const char *pattern,
                                                             const char *actual,
                                                             ...);

Passes if pattern matches string.

e.g.:

    cut_assert_match("^abc", "abc");            -> Pass
    cut_assert_match("^abc", " abc");           -> Fail

pattern :

  the regular expression pattern.

actual :

  the string to be matched.

... :

  optional message. See `cut_message()` for details.

Since 1.0

cut_assert_match

### cut_assert_match_with_free ()

    void                cut_assert_match_with_free          (const char *pattern,
                                                             const char *actual,
                                                             ...);

Passes if pattern matches string. See `cut_assert_match()` for detail.

pattern :

  the regular expression as string.

actual :

  the string to be matched that is freed.

... :

  optional message. See `cut_message()` for details.

Since 1.0

cut_assert_match_with_free

### cut_assert_equal_pointer ()

    void                cut_assert_equal_pointer            (const void *expected,
                                                             const void *actual,
                                                             ...);

Passes if expected == actual.

expected :

  an expected pointer.

actual :

  an actual pointer.

... :

  optional message. See `cut_message()` for details.

Since 1.0

cut_assert_equal_pointer

### cut_assert_equal_fixture_data_string ()

    void                cut_assert_equal_fixture_data_string
                                                            (const char *expected,
                                                             const void *path,
                                                             ...);

Passes if expected == cut_get_fixture_data_string(path, ...).

expected :

  an expected string.

path :

  a first element of the path to the fixture data.

... :

  remaining elements in path. `NULL` terminated.

Since 1.0.2

cut_assert_equal_fixture_data_string

### cut_assert_equal_sockaddr()

    #define             cut_assert_equal_sockaddr(expected, actual, ...)

Passes if expected == actual.

This assertion can be disabled by defining CUT_DISABLE_SOCKET_SUPPORT.

expected :

  an expected socket address.

actual :

  an actual socket address.

... :

  optional message. See `cut_message()` for details.

Since 1.1.1

cut_assert_equal_sockaddr

### cut_assert_equal_file_raw()

    #define             cut_assert_equal_file_raw(expected, actual, ...)

Passes if the content of expected == the content of actual.

expected :

  a path.

actual :

  a path.

... :

  optional message. See `cut_message()` for details.

Since 1.1.4

cut_assert_equal_file_raw

### cut_assert_not_equal_file_raw()

    #define             cut_assert_not_equal_file_raw(expected, actual, ...)

Passes if the content of expected != the content of actual.

expected :

  a path.

actual :

  a path.

... :

  optional message. See `cut_message()` for details.

Since 1.1.4

cut_assert_not_equal_file_raw

### cut_error ()

    void                cut_error                           (const char *format,
                                                             ...);

Raises an error with message.

format :

  the message format. See the `printf()` documentation.

... :

  the parameters to insert into the format string.

cut_error

### cut_error_errno ()

    void                cut_error_errno                     (...);

e.g.:

    void
    setup (void)
    {
        mkdir("tmp", 0700);
        cut_error_errno("Failed to make tmp directory");
          -> Error when tmp directory isn't made successfully.
    }

... :

  optional message. See `cut_message()` for details.

Since 1.0.2

cut_error_errno

### cut_fail ()

    void                cut_fail                            (const char *format,
                                                             ...);

Raises a failure with message.

format :

  the message format. See the `printf()` documentation.

... :

  the parameters to insert into the format string.

cut_fail

### cut_pend ()

    void                cut_pend                            (const char *format,
                                                             ...);

Marks the test is pending with message. The test is stopped.

format :

  the message format. See the `printf()` documentation.

... :

  the parameters to insert into the format string.

cut_pend

### cut_pending ()

    void                cut_pending                         (const char *format,
                                                             ...);

`cut_pending` has been deprecated since version 0.4 and should not be used in newly-written code. Use `cut_pend()` instead.

Marks the test is pending with message. The test is stopped.

format :

  the message format. See the `printf()` documentation.

... :

  the parameters to insert into the format string.

cut_pending

### cut_notify ()

    void                cut_notify                          (const char *format,
                                                             ...);

Leaves a notification message. The test is continued.

format :

  the message format. See the `printf()` documentation.

... :

  the parameters to insert into the format string.

cut_notify

### cut_omit ()

    void                cut_omit                            (const char *format,
                                                             ...);

Omit the test.

e.g.:

    if (version < 2.0)
      cut_omit("Require >= 2.0");

format :

  the message format. See the `printf()` documentation.

... :

  the parameters to insert into the format string.

Since 0.8

cut_omit

### cut_return ()

    void                cut_return                          (void);

Finish the test.

e.g.:

    static void
    sub_xxx (void)
    {
      some_assertions();
      if (no_need_more_test)
        cut_return();
      some_assertions();
    }

    void
    test_xxx (void)
    {
       some_assertions();
       cut_trace(sub_xxx());
       some_assertions();
    }

Since 1.0.6

cut_return