| 1 |
load(libdir + 'asserts.js'); |
| 2 |
|
| 3 |
function test() { |
| 4 |
assertTypeErrorMessage(() => { ctypes.Int64(1).toString(1, 2); }, |
| 5 |
"Int64.prototype.toString takes at most one argument"); |
| 6 |
if (ctypes.Int64.prototype.toSource) { |
| 7 |
assertTypeErrorMessage(() => { ctypes.Int64(1).toSource(1); }, |
| 8 |
"Int64.prototype.toSource takes no arguments"); |
| 9 |
} |
| 10 |
assertTypeErrorMessage(() => { ctypes.Int64(); }, |
| 11 |
"Int64 constructor takes one argument"); |
| 12 |
assertTypeErrorMessage(() => { ctypes.Int64.compare(); }, |
| 13 |
"Int64.compare takes two arguments"); |
| 14 |
assertTypeErrorMessage(() => { ctypes.Int64.lo(); }, |
| 15 |
"Int64.lo takes one argument"); |
| 16 |
assertTypeErrorMessage(() => { ctypes.Int64.hi(); }, |
| 17 |
"Int64.hi takes one argument"); |
| 18 |
assertTypeErrorMessage(() => { ctypes.Int64.join(); }, |
| 19 |
"Int64.join takes two arguments"); |
| 20 |
|
| 21 |
assertTypeErrorMessage(() => { ctypes.UInt64(1).toString(1, 2); }, |
| 22 |
"UInt64.prototype.toString takes at most one argument"); |
| 23 |
if (ctypes.UInt64.prototype.toSource) { |
| 24 |
assertTypeErrorMessage(() => { ctypes.UInt64(1).toSource(1); }, |
| 25 |
"UInt64.prototype.toSource takes no arguments"); |
| 26 |
} |
| 27 |
assertTypeErrorMessage(() => { ctypes.UInt64(); }, |
| 28 |
"UInt64 constructor takes one argument"); |
| 29 |
assertTypeErrorMessage(() => { ctypes.UInt64.compare(); }, |
| 30 |
"UInt64.compare takes two arguments"); |
| 31 |
assertTypeErrorMessage(() => { ctypes.UInt64.lo(); }, |
| 32 |
"UInt64.lo takes one argument"); |
| 33 |
assertTypeErrorMessage(() => { ctypes.UInt64.hi(); }, |
| 34 |
"UInt64.hi takes one argument"); |
| 35 |
assertTypeErrorMessage(() => { ctypes.UInt64.join(); }, |
| 36 |
"UInt64.join takes two arguments"); |
| 37 |
} |
| 38 |
|
| 39 |
if (typeof ctypes === "object") |
| 40 |
test(); |