Avoid non-web-integer literals in corelib_2/num_sign_test

Change-Id: I756ef8129b0e1c7024833fb98ed96eea987dbb59
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108280
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
This commit is contained in:
Stephen Adams 2019-07-05 19:43:47 +00:00 committed by commit-bot@chromium.org
parent f0da490328
commit 8673b5e491
2 changed files with 26 additions and 25 deletions

View file

@ -41,7 +41,6 @@ iterable_return_type_test/02: RuntimeError # Dart2js does not support Uint64*.
list_unmodifiable_test: Pass, RuntimeError # Issue 28712
num_parse_test/01: CompileTimeError, OK # Error if web int literal cannot be represented exactly, see http://dartbug.com/33351
num_parse_test/none: CompileTimeError, OK # Error if web int literal cannot be represented exactly, see http://dartbug.com/33351
num_sign_test: CompileTimeError, OK # Error if web int literal cannot be represented exactly, see http://dartbug.com/33351
[ $compiler != dartdevc ]
error_stack_trace_test/static: MissingCompileTimeError
@ -319,7 +318,6 @@ main_test: RuntimeError # Issue 29921
nan_infinity_test/01: RuntimeError # Issue 29921
num_parse_test/01: CompileTimeError, OK # Error if web int literal cannot be represented exactly, see http://dartbug.com/33351
num_parse_test/none: CompileTimeError, OK # Error if web int literal cannot be represented exactly, see http://dartbug.com/33351
num_sign_test: CompileTimeError, OK # Error if web int literal cannot be represented exactly, see http://dartbug.com/33351
regexp/alternative-length-miscalculation_test: RuntimeError # Issue 29921
regexp/ascii-regexp-subject_test: RuntimeError # Issue 29921
regexp/bol-with-multiline_test: RuntimeError # Issue 29921

View file

@ -25,51 +25,54 @@ var numbers = [
0,
1,
2,
0x7f, // ~7 bits
0x7f, // ~7 bits
0x80,
0xff, // ~8 bits
0xff, // ~8 bits
0x100,
0xffff, // ~16 bits
0xffff, // ~16 bits
0x10000,
0x3fffffff, // ~30 bits (max positive 32-bit tagged smi)
0x3fffffff, // ~30 bits (max positive 32-bit tagged smi)
0x40000000,
0x40000001,
0x7fffffff, // ~31 bits
0x7fffffff, // ~31 bits
0x80000000,
0x80000001,
0xfffffffff, // ~32 bits
0xfffffffff, // ~32 bits
0x100000000,
0x100000001,
0x10000000000000, // ~53 bits
0x10000000000000, // ~53 bits
0x10000000000001,
0x1fffffffffffff,
0x20000000000000,
0x20000000000001, // first integer not representable as double.
0x20000000000002,
0x7fffffffffffffff, // ~63 bits
// Use arithmetic to construct values below since they are not valid 'web
// integers'. On platforms that use doubles to represent integers, there will
// be some rounding in the arithmetic, testing a nearby value instead.
0x20000000000000 + 1, // first integer not representable as double.
0x20000000000000 + 2,
0x7ffffffffffff000 + 0xfff, // ~63 bits
0x8000000000000000,
0x8000000000000001,
0xffffffffffffffff, // ~64 bits
0x8000000000000000 + 1,
0xfffffffffffff000 + 0xfff, // ~64 bits
// Doubles.
0.0,
5e-324, // min positive
2.225073858507201e-308, // max denormal
2.2250738585072014e-308, // min normal
0.49999999999999994, // ~0.5
5e-324, // min positive
2.225073858507201e-308, // max denormal
2.2250738585072014e-308, // min normal
0.49999999999999994, // ~0.5
0.5,
0.5000000000000001,
0.9999999999999999, // ~1.0
0.9999999999999999, // ~1.0
1.0,
1.0000000000000002,
4294967295.0, // ~32 bits
4294967295.0, // ~32 bits
4294967296.0,
4503599627370495.5, // max fractional
4503599627370495.5, // max fractional
4503599627370497.0,
9007199254740991.0,
9007199254740992.0, // max exact (+1 is not a double)
1.7976931348623157e+308, // max finite double
1.0 / 0.0, // Infinity
0.0 / 0.0, // NaN
9007199254740992.0, // max exact (+1 is not a double)
1.7976931348623157e+308, // max finite double
1.0 / 0.0, // Infinity
0.0 / 0.0, // NaN
];
main() {