Closed
Bug 865931
Opened 12 years ago
Closed 12 years ago
PJS: Add test for wild comparisons
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
mozilla23
People
(Reporter: nmatsakis, Assigned: nmatsakis)
References
Details
Attachments
(1 file, 1 obsolete file)
5.35 KB,
patch
|
shu
:
review+
|
Details | Diff | Splinter Review |
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.
Assignee | ||
Comment 1•12 years ago
|
||
Attachment #742114 -
Flags: review?(bhackett1024)
Assignee | ||
Updated•12 years ago
|
Assignee: general → nmatsakis
Assignee | ||
Comment 2•12 years ago
|
||
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
Updated•12 years ago
|
Attachment #742114 -
Flags: review?(bhackett1024) → review+
Assignee | ||
Updated•12 years ago
|
Whiteboard: [keep open]
Assignee | ||
Updated•12 years ago
|
Whiteboard: [keep open] → [leave open]
Assignee | ||
Comment 3•12 years ago
|
||
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)
Assignee | ||
Updated•12 years ago
|
Whiteboard: [leave open]
Assignee | ||
Comment 4•12 years ago
|
||
Try run for this patch (along with bug 854400) looks green: https://tbpl.mozilla.org/?tree=Try&rev=ec8d7228222b
Comment 5•12 years ago
|
||
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+
Assignee | ||
Comment 6•12 years ago
|
||
Comment 7•12 years ago
|
||
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.
Description
•