Debian Codegraph @

js/src/jit-test/tests/ctypes/argument-type-int64.js

raw
1 load(libdir + 'asserts.js');
2
3 function test() {
4 assertRangeErrorMessage(() => { ctypes.Int64(0).toString("a"); },
5 "argument of Int64.prototype.toString must be an integer at least 2 and no greater than 36");
6 assertTypeErrorMessage(() => { ctypes.Int64.compare(1, 2); },
7 "first argument of Int64.compare must be a Int64");
8 assertTypeErrorMessage(() => { ctypes.Int64.compare(ctypes.Int64(0), 2); },
9 "second argument of Int64.compare must be a Int64");
10 assertTypeErrorMessage(() => { ctypes.Int64.lo(1); },
11 "argument of Int64.lo must be a Int64");
12 assertTypeErrorMessage(() => { ctypes.Int64.hi(1); },
13 "argument of Int64.hi must be a Int64");
14
15 assertRangeErrorMessage(() => { ctypes.UInt64(0).toString("a"); },
16 "argument of UInt64.prototype.toString must be an integer at least 2 and no greater than 36");
17 assertTypeErrorMessage(() => { ctypes.UInt64.compare(1, 2); },
18 "first argument of UInt64.compare must be a UInt64");
19 assertTypeErrorMessage(() => { ctypes.UInt64.compare(ctypes.UInt64(0), 2); },
20 "second argument of UInt64.compare must be a UInt64");
21 assertTypeErrorMessage(() => { ctypes.UInt64.lo(1); },
22 "argument of UInt64.lo must be a UInt64");
23 assertTypeErrorMessage(() => { ctypes.UInt64.hi(1); },
24 "argument of UInt64.hi must be a UInt64");
25 }
26
27 if (typeof ctypes === "object")
28 test();