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

RESOLVED FIXED in Firefox 40

Status

()

--
minor
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: Cykesiopka, Assigned: Cykesiopka)

Tracking

unspecified
mozilla40
Points:
---

Firefox Tracking Flags

(firefox40 fixed)

Details

Attachments

(1 attachment)

(Assignee)

Description

3 years ago
(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.
(Assignee)

Comment 1

3 years ago
Created attachment 8584956 [details] [diff] [review]
bug1147247_PRErrorCodeSuccess-vs-literal-0_v1.patch

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+
(Assignee)

Comment 3

3 years ago
Thanks for the review.

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