Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add optional message string to assertXxx() macros #13

Open
bxparks opened this issue Mar 29, 2018 · 1 comment
Open

add optional message string to assertXxx() macros #13

bxparks opened this issue Mar 29, 2018 · 1 comment

Comments

@bxparks
Copy link
Owner

bxparks commented Mar 29, 2018

When assertXxx() is used in a common helper function, or in a for-loop, it would be really nice to be able to add additional message strings into its output, so that we can figure out where the code breakage was more easily. (AUnit doesn't use exceptions, like Google Test and ArduinoUnit, so can't give the stack trace.)

@bxparks
Copy link
Owner Author

bxparks commented Mar 29, 2018

Related to this, it's now possible (after a recent class hierarchy refactoring) for assertXxx() macros to print out the name of the test in the assertion message. However, in the past, I found that adding an extra parameter to the Assertion::assertion() method consumes several bytes (~10 bytes if I recall). In a large test suite with, say, 300 assertXxx() statements, that increases the flash memory size by 3000 bytes, which is significant for a 32kB microcontroller.

I'll have to do some research to see if it's possible to allow the user to choose to pay for this cost or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant