typedef const char* _ccunit_str_t; /**< string type */
typedef const void* _ccunit_ptr_t; /**< pointer type */
+typedef const void* _ccunit_obj_t; /**< object type */
/**
* @name Declare assert test types
DCL_CCUNIT_ASSERT_TEST_TYPE(u_quad_t);
#endif
+typedef char* (*ccunit_toString_t)(_ccunit_obj_t);
+
+extern void ccunit_assert_test__ccunit_obj_t (const char* file, unsigned int line,
+ bool cond, const char* condstr,
+ _ccunit_obj_t expect,
+ _ccunit_obj_t acutal,
+ ccunit_toString_t);
+
/** @} */
/**
ex, ac); \
} while (0)
+#define CCUNIT_ASSERT_TEST_OBJ(EXPECT, OP, ACTUAL, TOSTR) \
+ do { \
+ const _ccunit_obj_t ex = (EXPECT); \
+ const _ccunit_obj_t ac = (ACTUAL); \
+ const char* condstr = #OP " (" #EXPECT ", " #ACTUAL ")"; \
+ ccunit_assert_test__ccunit_obj_t (__FILE__, __LINE__, \
+ OP(ex, ac), condstr, ex, ac, \
+ (ccunit_toString_t)TOSTR); \
+ } while (0)
+
/** @} */
/**