diff options
author | Matt A. Tobin <email@mattatobin.com> | 2020-02-25 15:07:00 -0500 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2020-04-14 12:55:19 +0200 |
commit | eb70e6e3d0bff11c25f14b1196025791bf2308fb (patch) | |
tree | 5ef4ce17db83c74d7b05ec12c8f59e095a6dd5bd /toolkit/components/ctypes/tests/unit/test_errno.js | |
parent | 32ead795290b3399d56b4708fc75b77d296f6a1a (diff) | |
download | UXP-eb70e6e3d0bff11c25f14b1196025791bf2308fb.tar UXP-eb70e6e3d0bff11c25f14b1196025791bf2308fb.tar.gz UXP-eb70e6e3d0bff11c25f14b1196025791bf2308fb.tar.lz UXP-eb70e6e3d0bff11c25f14b1196025791bf2308fb.tar.xz UXP-eb70e6e3d0bff11c25f14b1196025791bf2308fb.zip |
Issue #439 - Remove tests from toolkit/
Diffstat (limited to 'toolkit/components/ctypes/tests/unit/test_errno.js')
-rw-r--r-- | toolkit/components/ctypes/tests/unit/test_errno.js | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/toolkit/components/ctypes/tests/unit/test_errno.js b/toolkit/components/ctypes/tests/unit/test_errno.js deleted file mode 100644 index 6bf6b4b05..000000000 --- a/toolkit/components/ctypes/tests/unit/test_errno.js +++ /dev/null @@ -1,69 +0,0 @@ -Components.utils.import("resource://gre/modules/ctypes.jsm"); - -// Scope used to relaunch the tests with |ctypes| opened in a limited scope. -var scope = {}; -var ctypes = ctypes; - -function run_test() -{ - // Launch the test with regular loading of ctypes.jsm - main_test(); - - // Relaunch the test with exotic loading of ctypes.jsm - Components.utils.unload("resource://gre/modules/ctypes.jsm"); - Components.utils.import("resource://gre/modules/ctypes.jsm", scope); - ctypes = scope.ctypes; - main_test(); -} - -function main_test() -{ - "use strict"; - let library = open_ctypes_test_lib(); - let set_errno = library.declare("set_errno", ctypes.default_abi, - ctypes.void_t, - ctypes.int); - let get_errno = library.declare("get_errno", ctypes.default_abi, - ctypes.int); - - for (let i = 50; i >= 0; --i) { - set_errno(i); - let status = ctypes.errno; - do_check_eq(status, i); - - status = get_errno(); - do_check_eq(status, 0); - - status = ctypes.errno; - do_check_eq(status, 0); - } - - let set_last_error, get_last_error; - try { // The following test is Windows-specific - set_last_error = library.declare("set_last_error", ctypes.default_abi, - ctypes.void_t, - ctypes.int); - get_last_error = library.declare("get_last_error", ctypes.default_abi, - ctypes.int); - - } catch (x) { - do_check_eq(ctypes.winLastError, undefined); - } - - if (set_last_error) { - do_check_neq(ctypes.winLastError, undefined); - for (let i = 0; i < 50; ++i) { - set_last_error(i); - let status = ctypes.winLastError; - do_check_eq(status, i); - - status = get_last_error(); - do_check_eq(status, 0); - - status = ctypes.winLastError; - do_check_eq(status, 0); - } - } - - library.close(); -} |