From 70a2171f15ead58e566c1e6193f956e1b430581e Mon Sep 17 00:00:00 2001 From: Tooru Fujisawa Date: Wed, 28 Sep 2016 14:12:54 +0900 Subject: [PATCH] Bug 1300133 - Fix js-ctypes test harness to print assertion failure message and stack properly. r=bholley --- .../tests/chrome/xpcshellTestHarnessAdaptor.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/toolkit/components/ctypes/tests/chrome/xpcshellTestHarnessAdaptor.js b/toolkit/components/ctypes/tests/chrome/xpcshellTestHarnessAdaptor.js index ba11e0d5147a..eec85025b5c5 100644 --- a/toolkit/components/ctypes/tests/chrome/xpcshellTestHarnessAdaptor.js +++ b/toolkit/components/ctypes/tests/chrome/xpcshellTestHarnessAdaptor.js @@ -18,17 +18,31 @@ var Components = { }; function do_throw(message, stack) { + do_print("error: " + message); + do_print("stack: " + (stack ? stack : new Error().stack)); throw message; } function do_check_neq(left, right, stack) { - if (left == right) + if (left == right) { + var text = "do_check_neq failed"; + try { + text += ": " + left + " == " + right; + } catch (e) { + } do_throw(text, stack); + } } function do_check_eq(left, right, stack) { - if (left != right) + if (left != right) { + var text = "do_check_eq failed"; + try { + text += ": " + left + " != " + right; + } catch (e) { + } do_throw(text, stack); + } } function do_check_true(condition, stack) {