summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/ctypes/argument-type-int64.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /js/src/jit-test/tests/ctypes/argument-type-int64.js
parentInitial commit. (diff)
downloadfirefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz
firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--js/src/jit-test/tests/ctypes/argument-type-int64.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/ctypes/argument-type-int64.js b/js/src/jit-test/tests/ctypes/argument-type-int64.js
new file mode 100644
index 0000000000..e147b98a48
--- /dev/null
+++ b/js/src/jit-test/tests/ctypes/argument-type-int64.js
@@ -0,0 +1,28 @@
+load(libdir + 'asserts.js');
+
+function test() {
+ assertRangeErrorMessage(() => { ctypes.Int64(0).toString("a"); },
+ "argument of Int64.prototype.toString must be an integer at least 2 and no greater than 36");
+ assertTypeErrorMessage(() => { ctypes.Int64.compare(1, 2); },
+ "first argument of Int64.compare must be a Int64");
+ assertTypeErrorMessage(() => { ctypes.Int64.compare(ctypes.Int64(0), 2); },
+ "second argument of Int64.compare must be a Int64");
+ assertTypeErrorMessage(() => { ctypes.Int64.lo(1); },
+ "argument of Int64.lo must be a Int64");
+ assertTypeErrorMessage(() => { ctypes.Int64.hi(1); },
+ "argument of Int64.hi must be a Int64");
+
+ assertRangeErrorMessage(() => { ctypes.UInt64(0).toString("a"); },
+ "argument of UInt64.prototype.toString must be an integer at least 2 and no greater than 36");
+ assertTypeErrorMessage(() => { ctypes.UInt64.compare(1, 2); },
+ "first argument of UInt64.compare must be a UInt64");
+ assertTypeErrorMessage(() => { ctypes.UInt64.compare(ctypes.UInt64(0), 2); },
+ "second argument of UInt64.compare must be a UInt64");
+ assertTypeErrorMessage(() => { ctypes.UInt64.lo(1); },
+ "argument of UInt64.lo must be a UInt64");
+ assertTypeErrorMessage(() => { ctypes.UInt64.hi(1); },
+ "argument of UInt64.hi must be a UInt64");
+}
+
+if (typeof ctypes === "object")
+ test();