diff options
author | André Bargull <andre.bargull@gmail.com> | 2017-12-21 12:08:14 -0800 |
---|---|---|
committer | Rick Waldron <waldron.rick@gmail.com> | 2017-12-21 16:46:55 -0500 |
commit | 48173672f2c39bac6835ad4e07cc758d70f18b0b (patch) | |
tree | 5caab741867eea4fbbf0276404c539ae6e7e3943 | |
parent | 064ce66a5b82cbc53add521838d6609d2874eb66 (diff) | |
download | qtdeclarative-testsuites-48173672f2c39bac6835ad4e07cc758d70f18b0b.tar.gz |
Inline testValidDateTimeComponentValue into single test using this function
-rw-r--r-- | harness/testIntl.js | 16 | ||||
-rw-r--r-- | test/intl402/DateTimeFormat/12.2.3_c.js | 10 |
2 files changed, 3 insertions, 23 deletions
diff --git a/harness/testIntl.js b/harness/testIntl.js index d799ecd88..158feb53a 100644 --- a/harness/testIntl.js +++ b/harness/testIntl.js @@ -1098,22 +1098,6 @@ function getDateTimeComponentValues(component) { /** - * Tests that the given value is valid for the given date-time component. - * @param {string} component a date-time component. - * @param {string} value the value to be tested. - * @return {boolean} true if the test succeeds. - * @exception if the test fails. - */ - -function testValidDateTimeComponentValue(component, value) { - if (getDateTimeComponentValues(component).indexOf(value) === -1) { - $ERROR("Invalid value " + value + " for date-time component " + component + "."); - } - return true; -} - - -/** * @description Tests whether timeZone is a String value representing a * structurally valid and canonicalized time zone name, as defined in * sections 6.4.1 and 6.4.2 of the ECMAScript Internationalization API diff --git a/test/intl402/DateTimeFormat/12.2.3_c.js b/test/intl402/DateTimeFormat/12.2.3_c.js index 340b8767c..571f9a01b 100644 --- a/test/intl402/DateTimeFormat/12.2.3_c.js +++ b/test/intl402/DateTimeFormat/12.2.3_c.js @@ -32,13 +32,9 @@ locales.forEach(function (locale) { "Unrequested component " + component + " added to requested subset " + JSON.stringify(subset) + "; locale " + locale + "."); - try { - testValidDateTimeComponentValue(component, actual[component]); - } catch (e) { - e.message += " (Testing locale " + locale + "; subset " + - JSON.stringify(subset) + ")"; - throw e; - } + assert.notSameValue(getDateTimeComponentValues(component).indexOf(actual[component]), -1, + "Invalid value " + actual[component] + " for date-time component " + component + "." + + " (Testing locale " + locale + "; subset " + JSON.stringify(subset) + ")"); } else { assert.sameValue(subset.hasOwnProperty(component), false, "Missing component " + component + |