Proposal for a new assert macro which stores the failed values ("informative assert")
I'd like some opinions about this assert implementation which I'd like to propose as an update of the old BOOST_ASSERT. Basically it stores the failed values next to the expression string, instead of just the expression string: "INFORMATIVE_ASSERT(5*5 < 2*2);" "5*5 < 2*2 | 25 | 4" "INFORMATIVE_ASSERT(std::vector<int>(10).size() == std::vector<int>(12).size());" "std::vector<int>(10).size() > std::vector<int>(12).size() | 10 | 12" Notes - If the class can't be serialized, the byte-data is logged instead. - It writes the values to the expression string in order to be compliant with any assert implementations Easy to read implementation available here: https://docs.google.com/file/d/0B69BCPzak52DcnF5dmhRRno3V2M/edit?usp=sharing Modified version of BOOST_ASSERT available here: https://docs.google.com/file/d/0B69BCPzak52DZW1oX1AtREM4eVU/edit?usp=sharing /Viktor Sehr
participants (1)
-
Viktor Sehr