Closed Bug 1300133 Opened 3 years ago Closed 3 years ago

do_check_neq and do_check_eq fail reporting assertion failure in toolkit/components/ctypes/tests/chrome/xpcshellTestHarnessAdaptor.js

Categories

(Core :: js-ctypes, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla52
Tracking Status
firefox51 --- wontfix
firefox52 --- fixed

People

(Reporter: arai, Assigned: arai)

Details

Attachments

(1 file)

https://dxr.mozilla.org/mozilla-central/rev/d5f20820c80514476f596090292a5d77c4b41e3b/toolkit/components/ctypes/tests/chrome/xpcshellTestHarnessAdaptor.js
> function do_check_neq(left, right, stack) {
>   if (left == right)
>     do_throw(text, stack);
> }
> 
> function do_check_eq(left, right, stack) {
>   if (left != right)
>     do_throw(text, stack);
> }

It throws undefined reference to `text` and doesn't print stack.
actually, do_throw doesn't print anyway :/

> function do_throw(message, stack) {
>   throw message;
> }
There are 2 issues:
  1. undefined reference to `text` variable
  2. do_throw ignores `stack` parameter, and the stack trace information is
     lost while printing the exception from worker

for 1, added `text` variable, with "do_check_neq failed" or "do_check_eq failed" default value, and adding string representation of `left` and `right` variables if succeeds.

for 2. added `do_print` in `do_throw`, to print passed information instantly.
Attachment #8787673 - Flags: review?(jorendorff)
Attachment #8787673 - Flags: review?(jorendorff) → review?(bobbyholley)
Attachment #8787673 - Flags: review?(bobbyholley) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/b440b912a5adca04f5a7a7b4b152f930a427ab7c
Bug 1300133 - Fix js-ctypes test harness to print assertion failure message and stack properly. r=bholley
https://hg.mozilla.org/mozilla-central/rev/b440b912a5ad
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
Mark 51 as won't fix. If it's worth uplifting to 51, feel free to nominate it.
You need to log in before you can comment on or make changes to this bug.