Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#36 CU_PASS and CU_FAIL need string versions.

open
Anil Kumar
Core Issue (23)
5
2013-03-21
2009-04-03
Anonymous
No

The CU_PASS and CU_FAIL macros are nice, but it'd be nice to have a string which can be printed. The following macros do so (based off of CU_PASS and friends):
Same as CU_Pass(message), but doesn't stringify the message./

define CU_PASS_STRING(str) \

{ CU_assertImplementation(CU_TRUE, LINE, (str), FILE, "", CU_FALSE); }

define CU_FAIL_STRING(str) \

{ CU_assertImplementation(CU_FALSE, LINE, (str), FILE, "", CU_FALSE); }

define CU_FAIL_FATAL_STRING(str) \

{ CU_assertImplementation(CU_FALSE, LINE, (str), FILE, "", CU_TRUE); }

Discussion

  • I should perhaps be more precise. A string (pointer to an array of chars) which can be printed, not just a stringified piece of static text.

    Note that it'll be up to the end programmer to provide any stringified text necessary.

     

  • Anonymous
    2013-03-21

    Yes with printf formatting.

     


Anonymous


Cancel   Add attachments