After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 477275 - Implementation of doxer_warn_if_fail/if_reached
Implementation of doxer_warn_if_fail/if_reached
Status: RESOLVED FIXED
Product: beast
Classification: Other
Component: docs
v0.7.x
Other Linux
: Normal normal
: ---
Assigned To: Beast Maintainers
Beast Maintainers
Depends on:
Blocks:
 
 
Reported: 2007-09-15 18:36 UTC by Stefan Westerfeld
Modified: 2010-06-10 12:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed implementation for doxer_warn_if_reached (4.55 KB, patch)
2007-09-15 18:40 UTC, Stefan Westerfeld
none Details | Review

Description Stefan Westerfeld 2007-09-15 18:36:32 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.
Comment 1 Stefan Westerfeld 2007-09-15 18:40:04 UTC
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
Comment 2 Tim Janik 2010-04-06 10:49:14 UTC
(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?
Comment 3 Stefan Westerfeld 2010-05-06 13:12:41 UTC
> 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.
Comment 4 Stefan Westerfeld 2010-06-10 12:27:12 UTC
Branch bug-477275 merged, closing the bug.