Closed Bug 865931 Opened 12 years ago Closed 12 years ago

PJS: Add test for wild comparisons

Categories

(Core :: JavaScript Engine, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla23

People

(Reporter: nmatsakis, Assigned: nmatsakis)

References

Details

Attachments

(1 file, 1 obsolete file)

I was trying to get this test to pass: ``` load(libdir + "parallelarray-helpers.js"); // Test that we are able to compare numbers even if the typesets are // not "clean" because we have previously added strings and numbers. // Also test that we distinguish between bools/numbers etc for strict // equality but not loose equality. function theTest() { var ints = range(0, 1024); var doubles = ints.map(v => v + 0.1); var bools = ints.map(v => (v % 2) == 0); var strings = ints.map(v => String(v)); function looselyCompareToDoubles(e, i) { return doubles[i] == e; } print("doubles"); compareAgainstArray(doubles, "map", looselyCompareToDoubles) print("bools"); compareAgainstArray(bools, "map", looselyCompareToDoubles) print("strings"); compareAgainstArray(strings, "map", looselyCompareToDoubles) print("ints"); compareAgainstArray(ints, "map", looselyCompareToDoubles) function strictlyCompareToDoubles(e, i) { return doubles[i] === e; } print("doubles"); compareAgainstArray(doubles, "map", strictlyCompareToDoubles) print("bools"); compareAgainstArray(bools, "map", strictlyCompareToDoubles) print("strings"); compareAgainstArray(strings, "map", strictlyCompareToDoubles) print("ints"); compareAgainstArray(ints, "map", strictlyCompareToDoubles) } if (getBuildConfiguration().parallelJS) theTest(); ``` and I ran into problems. The first of which was that ConvertArrayToDouble is considered unsafe for par exec. I have a fix for that I will attach in a second. The other was limitations of our testing infrastructure. I have also addressed those in the work on OMTC.
Attachment #742114 - Flags: review?(bhackett1024)
Assignee: general → nmatsakis
Added a dependency on bug 862892 because the testing infrastructure I built there would allow this test to pass, I believe, given attachment 742114 [details] [diff] [review]
Depends on: 862892
Attachment #742114 - Flags: review?(bhackett1024) → review+
Whiteboard: [keep open]
Whiteboard: [keep open] → [leave open]
Depends on: 854400
I am obsoleting attachment 742114 [details] [diff] [review] since the problem with ConvertElementsToDoubles is solved better in bug 854400
Attachment #742114 - Attachment is obsolete: true
Attachment #747232 - Flags: review?(shu)
Whiteboard: [leave open]
Try run for this patch (along with bug 854400) looks green: https://tbpl.mozilla.org/?tree=Try&rev=ec8d7228222b
Comment on attachment 747232 [details] [diff] [review] Fix misc bugs in the parallel comparison routines and add a test case. Review of attachment 747232 [details] [diff] [review]: ----------------------------------------------------------------- Nice, another SAFE_OP.
Attachment #747232 - Flags: review?(shu) → review+
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla23
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: