Menu

#3 Request to add return-statement in OP_ASSERT-macro

Unstable_(example)
open
nobody
None
1
2013-07-24
2013-07-24
Anonymous
No

The OP_ASSERT macro simply does a return which makes it not usable inside non void functions. Can the following (feel free to change naming) macro be added?

define OP_ASSERT_TRUE_WITH_RETURN(expected,returnValue) \

do { \ if(!((expected))) { \ snprintf(op_error_message, OP_MESSAGE_LENGTH, "ERROR : ASSERT failed in file %s at line %d", BASE_FILE, LINE); \ opmock_add_error_message((char *) op_error_message); \ opmock_test_error++; \ opmock_print_error_messages(); \ return returnValue; \ } \ } while ( 0 )

Discussion

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.