All assertion macros are in lowercase and starts with cester_assert_
Does nothing just an empty placeholder. Can be used in the CESTER_SKIP_TEST and CESTER_TODO_TEST when compiling with -ansi and -pedantic-errors flag
#include <exotic/cester.h>
CESTER_TODO_TEST(example_case, _,
cester_assert_nothing();
)
Compare two values using the specified operator. The custom msg value is printed in output after the evaluation. The operator determines if the asserion fails or passes.
#include <exotic/cester.h>
CESTER_TEST(example_case, _,
cester_assert_cmp_msg(10, >, 2, "is 10 greater than 2");
)
Parameters
w - a value to compare to y
x - the operator to use for the comparison. One of ==, !=, <, >, <=, >=
y - a value to compare to w
z - the expression to print in output
Compare two argument using the provided operator. Prints the expression as in the source code
#include <exotic/cester.h>
CESTER_TEST(example_case, _,
cester_assert_cmp(NULL, ==, ((void*)0));
)
Parameters
x - a value to compare to z
y - the operator to use for the comparison. One of ==, !=, <, >, <=, >=
z - a value to compare to x
Check if the argument, expression evaluates to true. It accepts one parameter which is the expression to evaluate. It prints out the expression as it in the source code no formating is applied.
#include <exotic/cester.h>
CESTER_TEST(example_case, _,
cester_assert_true(2 > 1);
)
Parameters
x - the expression to check if true
Check if the argument, expression evaluates to true. It accepts one parameter which is the expression to evaluate. It prints out the the second arguments as expression in the output.
#include <exotic/cester.h>
CESTER_TEST(example_case, _,
cester_assert_true(2 > 1, "is 2 greater than 1?");
)
Parameters
x - the expression to check if true
y - the text to print in the output
Check if the argument, expression evaluates to false. It accepts one parameter which is the expression to evaluate. It prints out the expression as it in the source code no formating is applied.
#include <exotic/cester.h>
CESTER_TEST(example_case, _,
cester_assert_false(2 < 1);
)
Parameters
x - the expression to check if false
Check if the argument, expression evaluates to false. It accepts one parameter which is the expression to evaluate. It prints out the the second arguments as expression in the output.
#include <exotic/cester.h>
CESTER_TEST(example_case, _,
cester_assert_false(2 < 1);
)
Parameters
x - the expression to check if false
y - the text to print in the output
Check if the expression or argument is NULL. Pass if argument is NULL otherwise it fails. It prints out the expression as it in the source code no formating is applied.
#include <exotic/cester.h>
CESTER_TEST(example_case, _,
cester_assert_null(NULL);
)
Parameters
x - the expression to check if it NULL.
Check if the expression or argument is not NULL. Pass if argument is NULL otherwise it passes. It prints out the expression as it in the source code no formating is applied.
#include <exotic/cester.h>
CESTER_TEST(example_case, _,
cester_assert_not_null("NotNull");
)
Parameters
x - the expression to check if it not NULL.
Passed if the two parameters value is the same, a simple == equal operation is performed between the two parameters therefore this function will fail for values of different types. e.g. the follwoing expression cester_assert_equal(1, “Test”); C compiler will warning on comparison between integer and char* while in C++ compiler it will fail to compile at all. Only data of possibly same type that can be compared with == operator should be used with this macro else use the designated assertion macro for the types.
#include <exotic/cester.h>
CESTER_TEST(example_case, _,
cester_assert_equal(NULL, ((void*)0));
)
Parameters
x - the first expression to compare
y - the second expression to compare to the first expression
Passed if the two parameters are different. The two parameters are compared with the operator !=, therefore there can be compile time warning or error on comparison between two very different type.
#include <exotic/cester.h>
CESTER_TEST(example_case, _,
cester_assert_not_equal(NULL, "NotEqual");
)
Parameters
x - the first expression to compare
y - the second expression to compare to the first expression
Compare two strings. If the comparison passes the test case is marked as failed. The advantage of this macro is that it display the actual values of the two strings.
#include <exotic/cester.h>
CESTER_BEFORE_ALL(test_instance,
test_instance->arg = (void*) "exoticlibs";
)
CESTER_TEST(example_case, test_instance,
cester_assert_str_equal((char*)test_instance->arg, "exoticlibs");
)
Parameters
x - a string to compare
y - another string to compare with the first string
Compare two strings. If the comparison passes the test case is marked as failed. The advantage of this macro is that it display the actual values of the two strings.
#include <exotic/cester.h>
CESTER_BEFORE_ALL(test_instance,
test_instance->arg = (void*) "exoticlibs";
)
CESTER_TEST(example_case, test_instance,
cester_assert_str_not_equal((char*)test_instance->arg, NULL);
)
Parameters
x - a string to compare
y - another string to compare with the first string
Compare two pointers. If the comparison fails the test case is marked as failed. The advantage of this macro is that it display the actual values of the two pointers.
#include <exotic/cester.h>
CESTER_TEST(example_case, test_instance,
cester_assert_ptr_equal(test_instance, test_instance);
)
Parameters
x - a pointer to compare
y - another pointer to compare with the first pointer
Compare two pointers. If the comparison passes the test case is marked as failed. The advantage of this macro is that it display the actual values of the two pointers.
#include <exotic/cester.h>
CESTER_TEST(example_case, test_instance,
cester_assert_ptr_not_equal(test_instance->arg, test_instance);
)
Parameters
x - a pointer to compare
y - another pointer to compare with the first pointer
Compare two characters using the provided operator. This macro prints out the actual values of the two characters.
#include <exotic/cester.h>
CESTER_TEST(example_case, _,
cester_assert_cmp_char('a', ==, 'a', "verify that a is same as a");
)
Parameters
w - a char
x - the operator to use for the comparison. One of ==, !=, <, >, <=, >=
y - another char
z - the string formated for output
Check if the two characters are the same. This macro prints out the actual values of the two characters.
#include <exotic/cester.h>
CESTER_TEST(example_case, _,
cester_assert_char_eq('i', 'i');
)
Parameters
x - a char
y - another char
Check if the two characters are not the same. This macro prints out the actual values of the two characters.
#include <exotic/cester.h>
CESTER_TEST(example_case, _,
cester_assert_char_ne('i', 'j');
)
Parameters
x - a char
y - another char
Check if the a char is greater than the other. This macro prints out the actual values of the two characters.
#include <exotic/cester.h>
CESTER_TEST(example_case, _,
cester_assert_char_gt('z', 's');
)
Parameters
x - a char
y - another char
Check if the a char is greater than or equal to the other. This macro prints out the actual values of the two characters.
#include <exotic/cester.h>
CESTER_TEST(example_case, _,
cester_assert_char_ge('k', 'k');
)
Parameters
x - a char
y - another char
Check if the a char is lesser than the other. This macro prints out the actual values of the two characters.
#include <exotic/cester.h>
CESTER_TEST(example_case, _,
cester_assert_char_lt('r', 's');
)
Parameters
x - a char
y - another char
Check if the a char is lesser than or equal to the other. This macro prints out the actual values of the two characters.
#include <exotic/cester.h>
CESTER_TEST(example_case, _,
cester_assert_char_le('a', 'b');
)
Parameters
x - a char
y - another char
Compare two unsigned chars using the provided operator. This macro prints out the actual values of the two unsigned characters.
Parameters
w - a unsigned char
x - the operator to use for the comparison. One of ==, !=, <, >, <=, >=
y - another unsigned char
z - the string formated for output
Check if the two unsigned characters are the same. This macro prints out the actual values of the two unsigned characters.
Parameters
x - a unsigned char
y - another unsigned char
Check if the two unsigned characters are not the same. This macro prints out the actual values of the two unsigned characters.
Parameters
x - a unsigned char
y - another unsigned char
Check if the a unsigned char is greater than the other. This macro prints out the actual values of the two unsigned characters.
Parameters
x - a unsigned char
y - another unsigned char
Check if the a unsigned char is greater than or equal to the other. This macro prints out the actual values of the two unsigned characters.
Parameters
x - a unsigned char
y - another unsigned char
Check if the a unsigned char is lesser than the other. This macro prints out the actual values of the two unsigned characters.
Parameters
x - a unsigned char
y - another unsigned char
Check if the a unsigned char is lesser than or equal to the other. This macro prints out the actual values of the two unsigned characters.
Parameters
x - a unsigned char
y - another unsigned char
Compare two short using the provided operator. This macro prints out the actual values of the two shorts.
Parameters
w - a short
x - the operator to use for the comparison. One of ==, !=, <, >, <=, >=
y - another short
z - the string formated for output
Check if the two short are the same. This macro prints out the actual values of the two shorts.
Parameters
x - a short
y - another short
Check if the two shorts are not the same. This macro prints out the actual values of the two shorts.
Parameters
x - a short
y - another short
Check if the a short is greater than the other. This macro prints out the actual values of the two shorts.
Parameters
x - a short
y - another short
Check if the a short is greater than or equal to the other. This macro prints out the actual values of the two shorts.
Parameters
x - a short
y - another short
Check if the a short is lesser than the other. This macro prints out the actual values of the two shorts.
Parameters
x - a short
y - another short
Check if the a short is lesser than or equal to the other. This macro prints out the actual values of the two shorts.
Parameters
x - a short
y - another short
Compare two unsigned shorts using the provided operator. This macro prints out the actual values of the two unsigned shorts.
Parameters
w - a unsigned short
x - the operator to use for the comparison. One of ==, !=, <, >, <=, >=
y - another unsigned short
z - the string formated for output
Check if the two unsigned shorts are the same. This macro prints out the actual values of the two unsigned short.
Parameters
x - a unsigned short
y - another unsigned short
Check if the two unsigned shorts are not the same. This macro prints out the actual values of the two unsigned shorts.
Parameters
x - a unsigned short
y - another unsigned short
Check if the a unsigned short is greater than the other. This macro prints out the actual values of the two unsigned shorts.
Parameters
x - a unsigned short
y - another unsigned short
Check if the a unsigned short is greater than or equal to the other. This macro prints out the actual values of the two unsigned shorts.
Parameters
x - a unsigned short
y - another unsigned short
Check if the a unsigned short is lesser than the other. This macro prints out the actual values of the two unsigned shorts.
Parameters
x - a unsigned short
y - another unsigned short
Check if the a unsigned short is lesser than or equal to the other. This macro prints out the actual values of the two unsigned shorts.
Parameters
x - a unsigned short
y - another unsigned short
Compare two int using the provided operator. This macro prints out the actual values of the two ints.
Parameters
w - a int
x - the operator to use for the comparison. One of ==, !=, <, >, <=, >=
y - another int
z - the string formated for output
Check if the two int are the same. This macro prints out the actual values of the two ints.
Parameters
x - a int
y - another int
Check if the two ints are not the same. This macro prints out the actual values of the two ints.
Parameters
x - a int
y - another int
Check if the a int is greater than the other. This macro prints out the actual values of the two ints.
Parameters
x - a int
y - another int
Check if the a int is greater than or equal to the other. This macro prints out the actual values of the two ints.
Parameters
x - a int
y - another int
Check if the a int is lesser than the other. This macro prints out the actual values of the two ints.
Parameters
x - a int
y - another int
Check if the a int is lesser than or equal to the other. This macro prints out the actual values of the two ints.
Parameters
x - a int
y - another int
Compare two unsigned ints using the provided operator. This macro prints out the actual values of the two unsigned ints.
Parameters
w - a unsigned int
x - the operator to use for the comparison. One of ==, !=, <, >, <=, >=
y - another unsigned int
z - the string formated for output
Check if the two unsigned ints are the same. This macro prints out the actual values of the two unsigned int.
Parameters
x - a unsigned int
y - another unsigned int
Check if the two unsigned ints are not the same. This macro prints out the actual values of the two unsigned ints.
Parameters
x - a unsigned int
y - another unsigned int
Check if the a unsigned int is greater than the other. This macro prints out the actual values of the two unsigned ints.
Parameters
x - a unsigned int
y - another unsigned int
Check if the a unsigned int is greater than or equal to the other. This macro prints out the actual values of the two unsigned ints.
Parameters
x - a unsigned int
y - another unsigned int
Check if the a unsigned int is lesser than the other. This macro prints out the actual values of the two unsigned ints.
Parameters
x - a unsigned int
y - another unsigned int
Check if the a unsigned int is lesser than or equal to the other. This macro prints out the actual values of the two unsigned ints.
Parameters
x - a unsigned int
y - another unsigned int
Compare two long using the provided operator. This macro prints out the actual values of the two longs.
Parameters
w - a long
x - the operator to use for the comparison. One of ==, !=, <, >, <=, >=
y - another long
z - the string formated for output
Check if the two long are the same. This macro prints out the actual values of the two longs.
Parameters
x - a long
y - another long
Check if the two longs are not the same. This macro prints out the actual values of the two longs.
Parameters
x - a long
y - another long
Check if the a long is greater than the other. This macro prints out the actual values of the two longs.
Parameters
x - a long
y - another long
Check if the a long is greater than or equal to the other. This macro prints out the actual values of the two longs.
Parameters
x - a long
y - another long
Check if the a long is lesser than the other. This macro prints out the actual values of the two longs.
Parameters
x - a long
y - another long
Check if the a long is lesser than or equal to the other. This macro prints out the actual values of the two longs.
Parameters
x - a long
y - another long
Compare two unsigned longs using the provided operator. This macro prints out the actual values of the two unsigned longs.
Parameters
w - a unsigned long
x - the operator to use for the comparison. One of ==, !=, <, >, <=, >=
y - another unsigned long
z - the string formated for output
Check if the two unsigned longs are the same. This macro prints out the actual values of the two unsigned long.
Parameters
x - a unsigned long
y - another unsigned long
Check if the two unsigned longs are not the same. This macro prints out the actual values of the two unsigned longs.
Parameters
x - a unsigned long
y - another unsigned long
Check if the a unsigned long is greater than the other. This macro prints out the actual values of the two unsigned longs.
Parameters
x - a unsigned long
y - another unsigned long
Check if the a unsigned long is greater than or equal to the other. This macro prints out the actual values of the two unsigned longs.
Parameters
x - a unsigned long
y - another unsigned long
Check if the a unsigned long is lesser than the other. This macro prints out the actual values of the two unsigned longs.
Parameters
x - a unsigned long
y - another unsigned long
Check if the a unsigned long is lesser than or equal to the other. This macro prints out the actual values of the two unsigned longs.
Parameters
x - a unsigned long
y - another unsigned long
Compare two long long using the provided operator. This macro prints out the actual values of the two long long.
Parameters
w - a long long
x - the operator to use for the comparison. One of ==, !=, <, >, <=, >=
y - another long long
z - the string formated for output
Check if the two long long are the same. This macro prints out the actual values of the two long long.
Parameters
x - a long long
y - another long long
Check if the two long long are not the same. This macro prints out the actual values of the two long long.
Parameters
x - a long long
y - another long long
Check if the a long long is greater than the other. This macro prints out the actual values of the two long long.
Parameters
x - a long long
y - another long long
Check if the a long long is greater than or equal to the other. This macro prints out the actual values of the two long long.
Parameters
x - a long long
y - another long long
Check if the a long long is lesser than the other. This macro prints out the actual values of the two long long.
Parameters
x - a long long
y - another long long
Check if the a long long is lesser than or equal to the other. This macro prints out the actual values of the two long long.
Parameters
x - a long long
y - another long long
Compare two unsigned long long using the provided operator. This macro prints out the actual values of the two unsigned long long.
Parameters
w - a unsigned long long
x - the operator to use for the comparison. One of ==, !=, <, >, <=, >=
y - another unsigned long long
z - the string formated for output
Check if the two unsigned long long are the same. This macro prints out the actual values of the two unsigned long long.
Parameters
x - a unsigned long long
y - another unsigned long long
Check if the two unsigned long long are not the same. This macro prints out the actual values of the two unsigned long long.
Parameters
x - a unsigned long long
y - another unsigned long long
Check if the a unsigned long long is greater than the other. This macro prints out the actual values of the two unsigned long long.
Parameters
x - a unsigned long long
y - another unsigned long long
Check if the a unsigned long long is greater than or equal to the other. This macro prints out the actual values of the two unsigned long long.
Parameters
x - a unsigned long long
y - another unsigned long long
Check if the a unsigned long long is lesser than the other. This macro prints out the actual values of the two unsigned long long.
Parameters
x - a unsigned long long
y - another unsigned long long
Check if the a unsigned long long is lesser than or equal to the other. This macro prints out the actual values of the two unsigned long long.
Parameters
x - a unsigned long long
y - another unsigned long long
Compare two float using the provided operator. This macro prints out the actual values of the two double.
Parameters
w - a float
x - the operator to use for the comparison. One of ==, !=, <, >, <=, >=
y - another float
z - the string formated for output
Check if the two float are the same. This macro prints out the actual values of the two double.
Parameters
x - a float
y - another float
Check if the two double are not the same. This macro prints out the actual values of the two double.
Parameters
x - a float
y - another float
Check if the a float is greater than the other. This macro prints out the actual values of the two double.
Parameters
x - a float
y - another float
Check if the a float is greater than or equal to the other. This macro prints out the actual values of the two double.
Parameters
x - a float
y - another float
Check if the a float is lesser than the other. This macro prints out the actual values of the two double.
Parameters
x - a float
y - another float
Check if the a float is lesser than or equal to the other. This macro prints out the actual values of the two double.
Parameters
x - a float
y - another float
Compare two double using the provided operator. This macro prints out the actual values of the two double.
Parameters
w - a double
x - the operator to use for the comparison. One of ==, !=, <, >, <=, >=
y - another double
z - the string formated for output
Check if the two double are the same. This macro prints out the actual values of the two double.
Parameters
x - a double
y - another double
Check if the two double are not the same. This macro prints out the actual values of the two double.
Parameters
x - a double
y - another double
Check if the a double is greater than the other. This macro prints out the actual values of the two double.
Parameters
x - a double
y - another double
Check if the a double is greater than or equal to the other. This macro prints out the actual values of the two double.
Parameters
x - a double
y - another double
Check if the a double is lesser than the other. This macro prints out the actual values of the two double.
Parameters
x - a double
y - another double
Check if the a double is lesser than or equal to the other. This macro prints out the actual values of the two double.
Parameters
x - a double
y - another double
Compare two long double using the provided operator. This macro prints out the actual values of the two double.
Parameters
w - a long double
x - the operator to use for the comparison. One of ==, !=, <, >, <=, >=
y - another long double
z - the string formated for output
Check if the two long double are the same. This macro prints out the actual values of the two double.
Parameters
x - a long double
y - another long double
Check if the two long double are not the same. This macro prints out the actual values of the two long double.
Parameters
x - a long double
y - another long double
Check if the a long double is greater than the other. This macro prints out the actual values of the two long double.
Parameters
x - a long double
y - another long double
Check if the a long double is greater than or equal to the other. This macro prints out the actual values of the two double.
Parameters
x - a long double
y - another long double
Check if the a long double is lesser than the other. This macro prints out the actual values of the two double.
Parameters
x - a long double
y - another long double
Check if the a long double is lesser than or equal to the other. This macro prints out the actual values of the two double.
Parameters
x - a long double
y - another long double
Check whether the content of a stream equals a value
Parameters
x - the captured stream
y - the string to check if it same as the stream content
Note
This macro is not available if the macro CESTER_NO_STREAM_CAPTURE is defined
Check whether the content of a stream contains a value
Parameters
x - the captured stream
y - the string to check if it same as the stream content
Note
This macro is not available if the macro CESTER_NO_STREAM_CAPTURE is defined
Check whether the content of a stream does not equal a value
Parameters
x - the captured stream
y - the string to check if it same as the stream content
Note
This macro is not available if the macro CESTER_NO_STREAM_CAPTURE is defined
Check whether the content of a stream does not contains a value
Parameters
x - the captured stream
y - the string to check if it same as the stream content
Note
This macro is not available if the macro CESTER_NO_STREAM_CAPTURE is defined
Check whether the content of stdout stream equals a value
Parameters
x - the captured stdout stream
y - the string to check if it same as the stdout stream content
Note
This macro is not available if the macro CESTER_NO_STREAM_CAPTURE is defined
Check whether the content of stdout stream contains a value
Parameters
x - the captured stdout stream
y - the string to check if it same as the stdout stream content
Note
This macro is not available if the macro CESTER_NO_STREAM_CAPTURE is defined
Check whether the content of stdout stream does not equals a value
Parameters
x - the captured stdout stream
y - the string to check if it same as the stdout stream content
Note
This macro is not available if the macro CESTER_NO_STREAM_CAPTURE is defined
Check whether the content of stdout stream does not contains a value
Parameters
x - the captured stdout stream
y - the string to check if it same as the stdout stream content
Note
This macro is not available if the macro CESTER_NO_STREAM_CAPTURE is defined
Check whether the content of stderr stream equals a value
Parameters
x - the captured stderr stream
y - the string to check if it same as the stderr stream content
Note
This macro is not available if the macro CESTER_NO_STREAM_CAPTURE is defined
Check whether the content of stderr stream contains a value
Parameters
x - the captured stderr stream
y - the string to check if it same as the stderr stream content
Note
This macro is not available if the macro CESTER_NO_STREAM_CAPTURE is defined
Check whether the content of stderr stream does not equals a value
Parameters
x - the captured stderr stream
y - the string to check if it same as the stderr stream content
Note
This macro is not available if the macro CESTER_NO_STREAM_CAPTURE is defined
Check whether the content of stderr stream does not contains a value
Parameters
x - the captured stderr stream
y - the string to check if it same as the stderr stream content
Note
This macro is not available if the macro CESTER_NO_STREAM_CAPTURE is defined
Check whether the content of stdin stream equals a value
Parameters
x - the captured stdin stream
y - the string to check if it same as the stream content
Note
This macro is not available if the macro CESTER_NO_STREAM_CAPTURE is defined
Check whether the content of stdin stream contains a value
Parameters
x - the captured stdin stream
y - the string to check if it same as the stream content
Note
This macro is not available if the macro CESTER_NO_STREAM_CAPTURE is defined
Check whether the content of stdin stream does not equals a value
Parameters
x - the captured stdin stream
y - the string to check if it same as the stream content
Note
This macro is not available if the macro CESTER_NO_STREAM_CAPTURE is defined
Check whether the content of stdin stream does not contains a value
Parameters
x - the captured stdin stream
y - the string to check if it same as the stream content
Note
This macro is not available if the macro CESTER_NO_STREAM_CAPTURE is defined