Closed Bug 1147247 Opened 9 years ago Closed 9 years ago

Use PRErrorCodeSuccess constant instead of literal 0 to represent success in PSM xpcshell tests

Categories

(Core :: Security: PSM, defect)

defect
Not set
minor

Tracking

()

RESOLVED FIXED
mozilla40
Tracking Status
firefox40 --- fixed

People

(Reporter: Cykesiopka, Assigned: Cykesiopka)

References

Details

Attachments

(1 file)

(In reply to David Keeler [:keeler] (use needinfo?) from Bug 996872 comment #2)
> As far as I can tell, 0 isn't a registered PRErrorCode. I think it's
> probably ok to use it to mean success, but it would be good to be more clear
> about that [...]

> [...] (I
> would say just use Cr.NS_OK, but while I think its value is 0, I'm not sure
> that's guaranteed to always be the case, and we don't want to overlap our
> PRErrorCode space.)

And indeed there are some tests that incorrectly use Cr.NS_OK, and only happen to pass because Cr.NS_OK currently has a value of 0.
I'm sorry if your eyes bleed...

https://treeherder.mozilla.org/#/jobs?repo=try&revision=ecc2f2b1e9ca
Assignee: nobody → cykesiopka.bmo
Status: NEW → ASSIGNED
Attachment #8584956 - Flags: review?(dkeeler)
Comment on attachment 8584956 [details] [diff] [review]
bug1147247_PRErrorCodeSuccess-vs-literal-0_v1.patch

Review of attachment 8584956 [details] [diff] [review]:
-----------------------------------------------------------------

Great - thanks. I reviewed a few of the automatically-generated tests, but not all of them (the changes to generate.py look correct).
Attachment #8584956 - Flags: review?(dkeeler) → review+
Thanks for the review.

(Try push is in Comment 1)
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/41386efec948
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: