Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@ Special thanks to the following contributors to CUnit:
K. Cheung and Aurema Pty Ltd.
Shortcut code for efficient registration of
CUnit tests and suites.

Bart Houkes (BHO)
Email : bart@kassaku.nl
Added code since 2018 for private and business.
7 changes: 7 additions & 0 deletions CUnit/Headers/Automated.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ CU_EXPORT CU_ErrorCode CU_list_tests_to_file(void);
* @return An error code indicating the error status.
*/

CU_EXPORT CU_ErrorCode CU_list_tests_to_junit_file(void);
/**<
* Creates a Junit file which is compatible with Jenkins.
*
* @param szFilenameRoot String containing root to use for file names.
*/

CU_EXPORT void CU_set_output_filename(const char* szFilenameRoot);
/**<
* Sets the root file name for automated test output files.
Expand Down
25 changes: 17 additions & 8 deletions CUnit/Headers/CUnit.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,15 @@
#define CU_ASSERT(value) \
{ CU_assertImplementation((value), __LINE__, #value, __FILE__, "", CU_FALSE); }

/** Assert with your own message.
*/
#define CU_LOG CU_log

/** Assert with your own message.
*/
#define CU_LOG_ASSERT(message, ...) \
{ CU_error_message(__FILE__, __LINE__, message, ##__VA_ARGS__); }

/** Simple assertion.
* Reports failure and causes test to abort.
*/
Expand Down Expand Up @@ -200,49 +209,49 @@
* Reports failure with no other action.
*/
#define CU_ASSERT_PTR_EQUAL(actual, expected) \
{ CU_assertImplementation(((const void*)(actual) == (const void*)(expected)), __LINE__, ("CU_ASSERT_PTR_EQUAL(" #actual "," #expected ")"), __FILE__, "", CU_FALSE); }
{ CU_assertImplementation(((void*)(actual) == (void*)(expected)), __LINE__, ("CU_ASSERT_PTR_EQUAL(" #actual "," #expected ")"), __FILE__, "", CU_FALSE); }

/** Asserts that pointers actual == expected.
* Reports failure and causes test to abort.
*/
#define CU_ASSERT_PTR_EQUAL_FATAL(actual, expected) \
{ CU_assertImplementation(((const void*)(actual) == (const void*)(expected)), __LINE__, ("CU_ASSERT_PTR_EQUAL_FATAL(" #actual "," #expected ")"), __FILE__, "", CU_TRUE); }
{ CU_assertImplementation(((void*)(actual) == (void*)(expected)), __LINE__, ("CU_ASSERT_PTR_EQUAL_FATAL(" #actual "," #expected ")"), __FILE__, "", CU_TRUE); }

/** Asserts that pointers actual != expected.
* Reports failure with no other action.
*/
#define CU_ASSERT_PTR_NOT_EQUAL(actual, expected) \
{ CU_assertImplementation(((const void*)(actual) != (const void*)(expected)), __LINE__, ("CU_ASSERT_PTR_NOT_EQUAL(" #actual "," #expected ")"), __FILE__, "", CU_FALSE); }
{ CU_assertImplementation(((void*)(actual) != (void*)(expected)), __LINE__, ("CU_ASSERT_PTR_NOT_EQUAL(" #actual "," #expected ")"), __FILE__, "", CU_FALSE); }

/** Asserts that pointers actual != expected.
* Reports failure and causes test to abort.
*/
#define CU_ASSERT_PTR_NOT_EQUAL_FATAL(actual, expected) \
{ CU_assertImplementation(((const void*)(actual) != (const void*)(expected)), __LINE__, ("CU_ASSERT_PTR_NOT_EQUAL_FATAL(" #actual "," #expected ")"), __FILE__, "", CU_TRUE); }
{ CU_assertImplementation(((void*)(actual) != (void*)(expected)), __LINE__, ("CU_ASSERT_PTR_NOT_EQUAL_FATAL(" #actual "," #expected ")"), __FILE__, "", CU_TRUE); }

/** Asserts that pointer value is NULL.
* Reports failure with no other action.
*/
#define CU_ASSERT_PTR_NULL(value) \
{ CU_assertImplementation((NULL == (const void*)(value)), __LINE__, ("CU_ASSERT_PTR_NULL(" #value")"), __FILE__, "", CU_FALSE); }
{ CU_assertImplementation((NULL == (void*)(value)), __LINE__, ("CU_ASSERT_PTR_NULL(" #value")"), __FILE__, "", CU_FALSE); }

/** Asserts that pointer value is NULL.
* Reports failure and causes test to abort.
*/
#define CU_ASSERT_PTR_NULL_FATAL(value) \
{ CU_assertImplementation((NULL == (const void*)(value)), __LINE__, ("CU_ASSERT_PTR_NULL_FATAL(" #value")"), __FILE__, "", CU_TRUE); }
{ CU_assertImplementation((NULL == (void*)(value)), __LINE__, ("CU_ASSERT_PTR_NULL_FATAL(" #value")"), __FILE__, "", CU_TRUE); }

/** Asserts that pointer value is not NULL.
* Reports failure with no other action.
*/
#define CU_ASSERT_PTR_NOT_NULL(value) \
{ CU_assertImplementation((NULL != (const void*)(value)), __LINE__, ("CU_ASSERT_PTR_NOT_NULL(" #value")"), __FILE__, "", CU_FALSE); }
{ CU_assertImplementation((NULL != (void*)(value)), __LINE__, ("CU_ASSERT_PTR_NOT_NULL(" #value")"), __FILE__, "", CU_FALSE); }

/** Asserts that pointer value is not NULL.
* Reports failure and causes test to abort.
*/
#define CU_ASSERT_PTR_NOT_NULL_FATAL(value) \
{ CU_assertImplementation((NULL != (const void*)(value)), __LINE__, ("CU_ASSERT_PTR_NOT_NULL_FATAL(" #value")"), __FILE__, "", CU_TRUE); }
{ CU_assertImplementation((NULL != (void*)(value)), __LINE__, ("CU_ASSERT_PTR_NOT_NULL_FATAL(" #value")"), __FILE__, "", CU_TRUE); }

/** Asserts that string actual == expected.
* Reports failure with no other action.
Expand Down
Loading