GNOME Bugzilla – Bug 477275
Implementation of doxer_warn_if_fail/if_reached
Last modified: 2010-06-10 12:27:46 UTC
Similar to bug #477211, there are situations in Doxer where assertions would be helpful, but in doubt, you would rather want that Doxer at least generates some broken output than no output at all if the assertion is triggered. So I propose adding doxer_warn_if_fail() and doxer_warn_if_reached() for such situations.
Created attachment 95641 [details] [review] Proposed implementation for doxer_warn_if_reached Running the program warntest.py produces output like this: stefan@lotrien:/usr/local/src/beast/doxer$ python warntest.py warntest.py:25: DoxerWarning: doxer_warn_if_reached() encountered in function foo: doxer_warn_if_reached() # programmers mistake warntest.py:29: DoxerWarning: doxer_warn_if_fail() failed in function bar: doxer_warn_if_fail (42 == 20 + 20) # programmers mistake
(In reply to comment #1) > Created an attachment (id=95641) [details] [review] > Proposed implementation for doxer_warn_if_reached > > Running the program warntest.py produces output like this: > > stefan@lotrien:/usr/local/src/beast/doxer$ python warntest.py > warntest.py:25: DoxerWarning: doxer_warn_if_reached() encountered in function > foo: > doxer_warn_if_reached() # programmers mistake > warntest.py:29: DoxerWarning: doxer_warn_if_fail() failed in function bar: > doxer_warn_if_fail (42 == 20 + 20) # programmers mistake Thanks, looks good, allthough it seems that the Makefile.am still needs a rule for warntest.py? Could you add this to your staging repo please?
> allthough it seems that the Makefile.am still needs a rule for warntest.py? Its not a unit test, more a usage example. Other than that, branch bug-477275 in the stwbeast repo contains the changes now. However, since it improves on branch bug-437469, you'd probably merge bug-437469 first and then this.
Branch bug-477275 merged, closing the bug.