Closed Bug 1458230 Opened Last year Closed Last year

Fix various issues in toolkit/ where Assert.ok has been used instead of Assert.equals

Categories

(Toolkit :: General, enhancement)

enhancement
Not set

Tracking

()

RESOLVED FIXED
mozilla61
Tracking Status
firefox61 --- fixed

People

(Reporter: standard8, Assigned: standard8)

References

Details

Attachments

(3 files)

I found a case where we were doing "Assert.ok(foo, 1)" to attempt to check the length of foo.

In playing around with Assert.ok to error if the message is not a string, I also found various other locations in toolkit/ where we're not doing the right thing.

In particular, I discovered that test_BinarySearch.js is attempting to override ok() but it doesn't actually succeed, so all that gets tested in that file is that various sized arrays equate to 'true'.

Patches coming...
Blocks: 1458235
Comment on attachment 8972294 [details]
Bug 1458230 - Fix test_BinarySearch.js so that it actually runs the intented checks.

https://reviewboard.mozilla.org/r/240954/#review246750
Attachment #8972294 - Flags: review?(paolo.mozmail) → review+
Comment on attachment 8972295 [details]
Bug 1458230 - Fix various Assert.ok tests that should be using Assert.equals in places related code.

https://reviewboard.mozilla.org/r/240956/#review246752
Attachment #8972295 - Flags: review?(paolo.mozmail) → review+
Comment on attachment 8972296 [details]
Bug 1458230 - Stop passing the caller or a stack for Assert.ok messages in places tests.

https://reviewboard.mozilla.org/r/240958/#review246754

Thanks!
Attachment #8972296 - Flags: review?(paolo.mozmail) → review+
Pushed by mbanner@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f53ccf5c545c
Fix test_BinarySearch.js so that it actually runs the intented checks. r=Paolo
https://hg.mozilla.org/integration/autoland/rev/424ed2c8b1b4
Fix various Assert.ok tests that should be using Assert.equals in places related code. r=Paolo
https://hg.mozilla.org/integration/autoland/rev/969b429c982e
Stop passing the caller or a stack for Assert.ok messages in places tests. r=Paolo
You need to log in before you can comment on or make changes to this bug.