Closed Bug 622070 Opened 14 years ago Closed 7 years ago

SimpleTest._logResult may be unable to output binary data correctly

Categories

(Testing :: Mochitest, defect)

defect
Not set
major

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: sgautherie, Unassigned)

References

()

Details

Example noticed while working on bug 621414 part of bug 621390. Builds from "wmccloskey@mozilla.com – Wed Dec 29 18:02:06 2010 PST". Log line length for bug 621414 (test_fileapi_slice.html) case: Linux opt : 4 "correct image data" of 200,149 :-) But 8 "result in test ..." or "Correct value" truncated at "... †Â¯Ã28nnn INFO TEST-PASS ..." :-( Linux debug : 4 "correct image data" of 203,725 :-) But 8 "result in test ..." or "Correct value" truncated at "... ƒ4`À28nnn INFO TEST-PASS ..." :-( I didn't check the other builds. I assume the value(s) contains an 0x00 character, or the like. I think about 2 options to solve this: a) State that tests should not pass (raw) binary values to _logResult() [= to the check methods, in fact]. Less safe but executes faster. b) Enhance _logResult() to detect and encode (raw) binary values. Safer but executes slower. Option b seems overkill to me, as I assume tests should not need to output (raw) binary values: they should not output them at all (most likely) or could encode them before calling (if actual need be). What solution do you prefer?
yeah, I think I prefer option a. We shouldn't be dumping binary data in log results.
Mass closing mochitest bugs that haven't had activity in the past 5 years. Please re-open or file a new bug with modern context if this is still relevant.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.