GNOME Bugzilla – Bug 329413
Make sure people understand warnings are okay in testboxes
Last modified: 2006-02-11 04:31:16 UTC
Just thought I'd file this while I was thinking about it to hopefully prevent others from wasting debugging time on something that doesn't need debugging... Running src/testboxes results in three warnings (one of which is identical to another). This is okay, because the tests explicitly check corner cases that should not occur (thus the warnings) in order to see if the behavior is still relatively sane for such cases. The output of testboxes should probably include "The next test intentionally causes a warning, but it can be ignored" or something like that.
Created attachment 59047 [details] [review] Patch to add two messages to testboxes saying that warnings should be ignored Here's a patch that makes it print those messages. 2006-02-09 Thomas Thurman <thomas thurman org uk> * src/testboxes.c (test_regions_okay, test_clamping_to_region): add messages to explain that warnings are harmless
Cool, thanks. :) For future reference, note that patches are easier to review when the -p option to diff is also used. (Also, as a side note, you can use cvs to create the diffs instead of making a backup copy before doing changes; just use 'cvs diff -up' after modifying files). Anyway, the patch looks good but just to make it easier for other people trying to understand the testcases later, I'd prefer if the printfs were moved immediately above the tests that intentionally test the weird corner cases. To do so you'll have to split the second message into two separate ones. (If it helps, the corner case tests are the last one of each function, plus the fourth to last test of test_clamping_to_region()). Fix that up and post the new patch here and I'll commit it. :)
Created attachment 59089 [details] [review] Second try, with printfs directly before where they apply Funnily enough, I originally wrote it that way, but then moved them to the top of the functions for some reason I can't now recall. Thanks for the tips about diff! I was considering making a separate function to print these messages, since they're now the same line three times. In the end I didn't though: it's only one line.
Committed, thanks! Do you want the privilege of marking this bug as fixed?
I'd love to :) Do I need a special priv to do that? I'm used to bugzilla from work, but I don't see where I can set the resolution on bugzilla.gnome.
You didn't have editbugs privileges. I updated that for you, so go ahead. :)
Oh! lovely. Okay, marking FIXED then.