[webkit-changes] cvs commit: WebCore/layout-tests/fast/js
integer-extremes-expected.txt integer-extremes.html
Geoffrey
ggaren at opensource.apple.com
Mon Sep 26 11:07:08 PDT 2005
ggaren 05/09/26 11:07:07
Modified: . ChangeLog
Added: layout-tests/fast/js integer-extremes-expected.txt
integer-extremes.html
Log:
- Added layout test for http://bugzilla.opendarwin.org/show_bug.cgi?id=5053
Need to restore int/long changes to simple_number.h
Test cases added:
* layout-tests/fast/js/integer-extremes-expected.txt: Added.
* layout-tests/fast/js/integer-extremes.html: Added.
Revision Changes Path
1.164 +10 -0 WebCore/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/WebCore/ChangeLog,v
retrieving revision 1.163
retrieving revision 1.164
diff -u -r1.163 -r1.164
--- ChangeLog 24 Sep 2005 22:39:27 -0000 1.163
+++ ChangeLog 26 Sep 2005 18:07:06 -0000 1.164
@@ -1,3 +1,13 @@
+2005-09-26 Geoffrey Garen <ggaren at apple.com>
+
+ - Added layout test for http://bugzilla.opendarwin.org/show_bug.cgi?id=5053
+ Need to restore int/long changes to simple_number.h
+
+ Test cases added:
+
+ * layout-tests/fast/js/integer-extremes-expected.txt: Added.
+ * layout-tests/fast/js/integer-extremes.html: Added.
+
2005-09-24 Maciej Stachowiak <mjs at apple.com>
- some JavaScript syntax test cases
1.1 WebCore/layout-tests/fast/js/integer-extremes-expected.txt
Index: integer-extremes-expected.txt
===================================================================
This test verifies that the bit twiddling done in JavaScriptCore's integer machinery works correctly on the current platform.
Below, you will see a listing of the extremes related to representing integers using a certain number of bits. If the test succeeds, you should see:
0, -0, and -1
max: 2 ^ ([number of bits] - 1) - 1
min: -(max + 1)
a corresponding max + 1 and min - 1
-1: -1
0: 0
-0: 0
-----
bits used to store value: 8
min: -128
min - 1: -129
max: 127
max + 1: 128
-----
bits used to store value: 9
min: -256
min - 1: -257
max: 255
max + 1: 256
-----
bits used to store value: 10
min: -512
min - 1: -513
max: 511
max + 1: 512
-----
bits used to store value: 11
min: -1024
min - 1: -1025
max: 1023
max + 1: 1024
-----
bits used to store value: 12
min: -2048
min - 1: -2049
max: 2047
max + 1: 2048
-----
bits used to store value: 13
min: -4096
min - 1: -4097
max: 4095
max + 1: 4096
-----
bits used to store value: 14
min: -8192
min - 1: -8193
max: 8191
max + 1: 8192
-----
bits used to store value: 15
min: -16384
min - 1: -16385
max: 16383
max + 1: 16384
-----
bits used to store value: 16
min: -32768
min - 1: -32769
max: 32767
max + 1: 32768
-----
bits used to store value: 17
min: -65536
min - 1: -65537
max: 65535
max + 1: 65536
-----
bits used to store value: 18
min: -131072
min - 1: -131073
max: 131071
max + 1: 131072
-----
bits used to store value: 19
min: -262144
min - 1: -262145
max: 262143
max + 1: 262144
-----
bits used to store value: 20
min: -524288
min - 1: -524289
max: 524287
max + 1: 524288
-----
bits used to store value: 21
min: -1048576
min - 1: -1048577
max: 1048575
max + 1: 1048576
-----
bits used to store value: 22
min: -2097152
min - 1: -2097153
max: 2097151
max + 1: 2097152
-----
bits used to store value: 23
min: -4194304
min - 1: -4194305
max: 4194303
max + 1: 4194304
-----
bits used to store value: 24
min: -8388608
min - 1: -8388609
max: 8388607
max + 1: 8388608
-----
bits used to store value: 25
min: -16777216
min - 1: -16777217
max: 16777215
max + 1: 16777216
-----
bits used to store value: 26
min: -33554432
min - 1: -33554433
max: 33554431
max + 1: 33554432
-----
bits used to store value: 27
min: -67108864
min - 1: -67108865
max: 67108863
max + 1: 67108864
-----
bits used to store value: 28
min: -134217728
min - 1: -134217729
max: 134217727
max + 1: 134217728
-----
bits used to store value: 29
min: -268435456
min - 1: -268435457
max: 268435455
max + 1: 268435456
-----
bits used to store value: 30
min: -536870912
min - 1: -536870913
max: 536870911
max + 1: 536870912
-----
bits used to store value: 31
min: -1073741824
min - 1: -1073741825
max: 1073741823
max + 1: 1073741824
-----
bits used to store value: 32
min: -2147483648
min - 1: -2147483649
max: 2147483647
max + 1: 2147483648
-----
bits used to store value: 33
min: -4294967296
min - 1: -4294967297
max: 4294967295
max + 1: 4294967296
-----
bits used to store value: 34
min: -8589934592
min - 1: -8589934593
max: 8589934591
max + 1: 8589934592
-----
bits used to store value: 35
min: -17179869184
min - 1: -17179869185
max: 17179869183
max + 1: 17179869184
-----
bits used to store value: 36
min: -34359738368
min - 1: -34359738369
max: 34359738367
max + 1: 34359738368
-----
bits used to store value: 37
min: -68719476736
min - 1: -68719476737
max: 68719476735
max + 1: 68719476736
-----
bits used to store value: 38
min: -137438953472
min - 1: -137438953473
max: 137438953471
max + 1: 137438953472
-----
bits used to store value: 39
min: -274877906944
min - 1: -274877906945
max: 274877906943
max + 1: 274877906944
-----
bits used to store value: 40
min: -549755813888
min - 1: -549755813889
max: 549755813887
max + 1: 549755813888
-----
bits used to store value: 41
min: -1099511627776
min - 1: -1099511627777
max: 1099511627775
max + 1: 1099511627776
-----
bits used to store value: 42
min: -2199023255552
min - 1: -2199023255553
max: 2199023255551
max + 1: 2199023255552
-----
bits used to store value: 43
min: -4398046511104
min - 1: -4398046511105
max: 4398046511103
max + 1: 4398046511104
-----
bits used to store value: 44
min: -8796093022208
min - 1: -8796093022209
max: 8796093022207
max + 1: 8796093022208
-----
bits used to store value: 45
min: -17592186044416
min - 1: -17592186044417
max: 17592186044415
max + 1: 17592186044416
-----
bits used to store value: 46
min: -35184372088832
min - 1: -35184372088833
max: 35184372088831
max + 1: 35184372088832
-----
bits used to store value: 47
min: -70368744177664
min - 1: -70368744177665
max: 70368744177663
max + 1: 70368744177664
-----
bits used to store value: 48
min: -140737488355328
min - 1: -140737488355329
max: 140737488355327
max + 1: 140737488355328
-----
bits used to store value: 49
min: -281474976710656
min - 1: -281474976710657
max: 281474976710655
max + 1: 281474976710656
-----
bits used to store value: 50
min: -562949953421312
min - 1: -562949953421313
max: 562949953421311
max + 1: 562949953421312
-----
bits used to store value: 51
min: -1125899906842624
min - 1: -1125899906842625
max: 1125899906842623
max + 1: 1125899906842624
-----
bits used to store value: 52
min: -2251799813685248
min - 1: -2251799813685249
max: 2251799813685247
max + 1: 2251799813685248
-----
bits used to store value: 53
min: -4503599627370496
min - 1: -4503599627370497
max: 4503599627370495
max + 1: 4503599627370496
-----
bits used to store value: 54
min: -9007199254740992
min - 1: -9007199254740992
max: 9007199254740991
max + 1: 9007199254740992
-----
bits used to store value: 55
min: -18014398509481984
min - 1: -18014398509481984
max: 18014398509481984
max + 1: 18014398509481984
-----
bits used to store value: 56
min: -36028797018963970
min - 1: -36028797018963970
max: 36028797018963970
max + 1: 36028797018963970
-----
bits used to store value: 57
min: -72057594037927940
min - 1: -72057594037927940
max: 72057594037927940
max + 1: 72057594037927940
-----
bits used to store value: 58
min: -144115188075855870
min - 1: -144115188075855870
max: 144115188075855870
max + 1: 144115188075855870
-----
bits used to store value: 59
min: -288230376151711740
min - 1: -288230376151711740
max: 288230376151711740
max + 1: 288230376151711740
-----
bits used to store value: 60
min: -576460752303423500
min - 1: -576460752303423500
max: 576460752303423500
max + 1: 576460752303423500
-----
bits used to store value: 61
min: -1152921504606847000
min - 1: -1152921504606847000
max: 1152921504606847000
max + 1: 1152921504606847000
-----
bits used to store value: 62
min: -2305843009213694000
min - 1: -2305843009213694000
max: 2305843009213694000
max + 1: 2305843009213694000
-----
bits used to store value: 63
min: -4611686018427388000
min - 1: -4611686018427388000
max: 4611686018427388000
max + 1: 4611686018427388000
-----
bits used to store value: 64
min: -9223372036854776000
min - 1: -9223372036854776000
max: 9223372036854776000
max + 1: 9223372036854776000
-----
bits used to store value: 65
min: -18446744073709552000
min - 1: -18446744073709552000
max: 18446744073709552000
max + 1: 18446744073709552000
-----
bits used to store value: 66
min: -36893488147419103000
min - 1: -36893488147419103000
max: 36893488147419103000
max + 1: 36893488147419103000
-----
bits used to store value: 67
min: -73786976294838210000
min - 1: -73786976294838210000
max: 73786976294838210000
max + 1: 73786976294838210000
-----
bits used to store value: 68
min: -147573952589676410000
min - 1: -147573952589676410000
max: 147573952589676410000
max + 1: 147573952589676410000
-----
bits used to store value: 69
min: -295147905179352830000
min - 1: -295147905179352830000
max: 295147905179352830000
max + 1: 295147905179352830000
-----
bits used to store value: 70
min: -590295810358705700000
min - 1: -590295810358705700000
max: 590295810358705700000
max + 1: 590295810358705700000
-----
bits used to store value: 71
min: -1.1805916207174113e+21
min - 1: -1.1805916207174113e+21
max: 1.1805916207174113e+21
max + 1: 1.1805916207174113e+21
-----
bits used to store value: 72
min: -2.3611832414348226e+21
min - 1: -2.3611832414348226e+21
max: 2.3611832414348226e+21
max + 1: 2.3611832414348226e+21
-----
bits used to store value: 73
min: -4.722366482869645e+21
min - 1: -4.722366482869645e+21
max: 4.722366482869645e+21
max + 1: 4.722366482869645e+21
-----
bits used to store value: 74
min: -9.44473296573929e+21
min - 1: -9.44473296573929e+21
max: 9.44473296573929e+21
max + 1: 9.44473296573929e+21
-----
bits used to store value: 75
min: -1.888946593147858e+22
min - 1: -1.888946593147858e+22
max: 1.888946593147858e+22
max + 1: 1.888946593147858e+22
-----
bits used to store value: 76
min: -3.777893186295716e+22
min - 1: -3.777893186295716e+22
max: 3.777893186295716e+22
max + 1: 3.777893186295716e+22
-----
bits used to store value: 77
min: -7.555786372591432e+22
min - 1: -7.555786372591432e+22
max: 7.555786372591432e+22
max + 1: 7.555786372591432e+22
-----
bits used to store value: 78
min: -1.5111572745182865e+23
min - 1: -1.5111572745182865e+23
max: 1.5111572745182865e+23
max + 1: 1.5111572745182865e+23
-----
bits used to store value: 79
min: -3.022314549036573e+23
min - 1: -3.022314549036573e+23
max: 3.022314549036573e+23
max + 1: 3.022314549036573e+23
-----
bits used to store value: 80
min: -6.044629098073146e+23
min - 1: -6.044629098073146e+23
max: 6.044629098073146e+23
max + 1: 6.044629098073146e+23
-----
bits used to store value: 81
min: -1.2089258196146292e+24
min - 1: -1.2089258196146292e+24
max: 1.2089258196146292e+24
max + 1: 1.2089258196146292e+24
-----
bits used to store value: 82
min: -2.4178516392292583e+24
min - 1: -2.4178516392292583e+24
max: 2.4178516392292583e+24
max + 1: 2.4178516392292583e+24
-----
bits used to store value: 83
min: -4.835703278458517e+24
min - 1: -4.835703278458517e+24
max: 4.835703278458517e+24
max + 1: 4.835703278458517e+24
-----
bits used to store value: 84
min: -9.671406556917033e+24
min - 1: -9.671406556917033e+24
max: 9.671406556917033e+24
max + 1: 9.671406556917033e+24
-----
bits used to store value: 85
min: -1.9342813113834067e+25
min - 1: -1.9342813113834067e+25
max: 1.9342813113834067e+25
max + 1: 1.9342813113834067e+25
-----
bits used to store value: 86
min: -3.8685626227668134e+25
min - 1: -3.8685626227668134e+25
max: 3.8685626227668134e+25
max + 1: 3.8685626227668134e+25
-----
bits used to store value: 87
min: -7.737125245533627e+25
min - 1: -7.737125245533627e+25
max: 7.737125245533627e+25
max + 1: 7.737125245533627e+25
-----
bits used to store value: 88
min: -1.5474250491067253e+26
min - 1: -1.5474250491067253e+26
max: 1.5474250491067253e+26
max + 1: 1.5474250491067253e+26
-----
bits used to store value: 89
min: -3.094850098213451e+26
min - 1: -3.094850098213451e+26
max: 3.094850098213451e+26
max + 1: 3.094850098213451e+26
-----
bits used to store value: 90
min: -6.189700196426902e+26
min - 1: -6.189700196426902e+26
max: 6.189700196426902e+26
max + 1: 6.189700196426902e+26
-----
bits used to store value: 91
min: -1.2379400392853803e+27
min - 1: -1.2379400392853803e+27
max: 1.2379400392853803e+27
max + 1: 1.2379400392853803e+27
-----
bits used to store value: 92
min: -2.4758800785707605e+27
min - 1: -2.4758800785707605e+27
max: 2.4758800785707605e+27
max + 1: 2.4758800785707605e+27
-----
bits used to store value: 93
min: -4.951760157141521e+27
min - 1: -4.951760157141521e+27
max: 4.951760157141521e+27
max + 1: 4.951760157141521e+27
-----
bits used to store value: 94
min: -9.903520314283042e+27
min - 1: -9.903520314283042e+27
max: 9.903520314283042e+27
max + 1: 9.903520314283042e+27
-----
bits used to store value: 95
min: -1.9807040628566084e+28
min - 1: -1.9807040628566084e+28
max: 1.9807040628566084e+28
max + 1: 1.9807040628566084e+28
-----
bits used to store value: 96
min: -3.961408125713217e+28
min - 1: -3.961408125713217e+28
max: 3.961408125713217e+28
max + 1: 3.961408125713217e+28
-----
bits used to store value: 97
min: -7.922816251426434e+28
min - 1: -7.922816251426434e+28
max: 7.922816251426434e+28
max + 1: 7.922816251426434e+28
-----
bits used to store value: 98
min: -1.5845632502852868e+29
min - 1: -1.5845632502852868e+29
max: 1.5845632502852868e+29
max + 1: 1.5845632502852868e+29
-----
bits used to store value: 99
min: -3.1691265005705735e+29
min - 1: -3.1691265005705735e+29
max: 3.1691265005705735e+29
max + 1: 3.1691265005705735e+29
-----
bits used to store value: 100
min: -6.338253001141147e+29
min - 1: -6.338253001141147e+29
max: 6.338253001141147e+29
max + 1: 6.338253001141147e+29
-----
bits used to store value: 101
min: -1.2676506002282294e+30
min - 1: -1.2676506002282294e+30
max: 1.2676506002282294e+30
max + 1: 1.2676506002282294e+30
-----
bits used to store value: 102
min: -2.535301200456459e+30
min - 1: -2.535301200456459e+30
max: 2.535301200456459e+30
max + 1: 2.535301200456459e+30
-----
bits used to store value: 103
min: -5.070602400912918e+30
min - 1: -5.070602400912918e+30
max: 5.070602400912918e+30
max + 1: 5.070602400912918e+30
-----
bits used to store value: 104
min: -1.0141204801825835e+31
min - 1: -1.0141204801825835e+31
max: 1.0141204801825835e+31
max + 1: 1.0141204801825835e+31
-----
bits used to store value: 105
min: -2.028240960365167e+31
min - 1: -2.028240960365167e+31
max: 2.028240960365167e+31
max + 1: 2.028240960365167e+31
-----
bits used to store value: 106
min: -4.056481920730334e+31
min - 1: -4.056481920730334e+31
max: 4.056481920730334e+31
max + 1: 4.056481920730334e+31
-----
bits used to store value: 107
min: -8.112963841460668e+31
min - 1: -8.112963841460668e+31
max: 8.112963841460668e+31
max + 1: 8.112963841460668e+31
-----
bits used to store value: 108
min: -1.6225927682921336e+32
min - 1: -1.6225927682921336e+32
max: 1.6225927682921336e+32
max + 1: 1.6225927682921336e+32
-----
bits used to store value: 109
min: -3.2451855365842673e+32
min - 1: -3.2451855365842673e+32
max: 3.2451855365842673e+32
max + 1: 3.2451855365842673e+32
-----
bits used to store value: 110
min: -6.490371073168535e+32
min - 1: -6.490371073168535e+32
max: 6.490371073168535e+32
max + 1: 6.490371073168535e+32
-----
bits used to store value: 111
min: -1.298074214633707e+33
min - 1: -1.298074214633707e+33
max: 1.298074214633707e+33
max + 1: 1.298074214633707e+33
-----
bits used to store value: 112
min: -2.596148429267414e+33
min - 1: -2.596148429267414e+33
max: 2.596148429267414e+33
max + 1: 2.596148429267414e+33
-----
bits used to store value: 113
min: -5.192296858534828e+33
min - 1: -5.192296858534828e+33
max: 5.192296858534828e+33
max + 1: 5.192296858534828e+33
-----
bits used to store value: 114
min: -1.0384593717069655e+34
min - 1: -1.0384593717069655e+34
max: 1.0384593717069655e+34
max + 1: 1.0384593717069655e+34
-----
bits used to store value: 115
min: -2.076918743413931e+34
min - 1: -2.076918743413931e+34
max: 2.076918743413931e+34
max + 1: 2.076918743413931e+34
-----
bits used to store value: 116
min: -4.153837486827862e+34
min - 1: -4.153837486827862e+34
max: 4.153837486827862e+34
max + 1: 4.153837486827862e+34
-----
bits used to store value: 117
min: -8.307674973655724e+34
min - 1: -8.307674973655724e+34
max: 8.307674973655724e+34
max + 1: 8.307674973655724e+34
-----
bits used to store value: 118
min: -1.661534994731145e+35
min - 1: -1.661534994731145e+35
max: 1.661534994731145e+35
max + 1: 1.661534994731145e+35
-----
bits used to store value: 119
min: -3.32306998946229e+35
min - 1: -3.32306998946229e+35
max: 3.32306998946229e+35
max + 1: 3.32306998946229e+35
-----
bits used to store value: 120
min: -6.64613997892458e+35
min - 1: -6.64613997892458e+35
max: 6.64613997892458e+35
max + 1: 6.64613997892458e+35
-----
bits used to store value: 121
min: -1.329227995784916e+36
min - 1: -1.329227995784916e+36
max: 1.329227995784916e+36
max + 1: 1.329227995784916e+36
-----
bits used to store value: 122
min: -2.658455991569832e+36
min - 1: -2.658455991569832e+36
max: 2.658455991569832e+36
max + 1: 2.658455991569832e+36
-----
bits used to store value: 123
min: -5.316911983139664e+36
min - 1: -5.316911983139664e+36
max: 5.316911983139664e+36
max + 1: 5.316911983139664e+36
-----
bits used to store value: 124
min: -1.0633823966279327e+37
min - 1: -1.0633823966279327e+37
max: 1.0633823966279327e+37
max + 1: 1.0633823966279327e+37
-----
bits used to store value: 125
min: -2.1267647932558654e+37
min - 1: -2.1267647932558654e+37
max: 2.1267647932558654e+37
max + 1: 2.1267647932558654e+37
-----
bits used to store value: 126
min: -4.253529586511731e+37
min - 1: -4.253529586511731e+37
max: 4.253529586511731e+37
max + 1: 4.253529586511731e+37
-----
bits used to store value: 127
min: -8.507059173023462e+37
min - 1: -8.507059173023462e+37
max: 8.507059173023462e+37
max + 1: 8.507059173023462e+37
-----
bits used to store value: 128
min: -1.7014118346046923e+38
min - 1: -1.7014118346046923e+38
max: 1.7014118346046923e+38
max + 1: 1.7014118346046923e+38
1.1 WebCore/layout-tests/fast/js/integer-extremes.html
Index: integer-extremes.html
===================================================================
<html>
<head>
<script>
function print(message) {
var paragraph = document.createElement("p");
paragraph.appendChild(document.createTextNode(message));
document.getElementById("console").appendChild(paragraph);
}
function test() {
if (window.layoutTestController) {
layoutTestController.dumpAsText();
}
print("-1: " + -1);
print("0: " + 0);
print("-0: " + -0);
for (var valueBits = 8; valueBits <= 128; valueBits++) {
print("-----");
print("bits used to store value: " + valueBits);
var max = Math.pow(2, valueBits - 1) - 1;
var min = -Math.pow(2, valueBits - 1);
print("min: " + min);
print("min - 1: " + (min - 1));
print("max: " + max);
print("max + 1: " + (max + 1));
}
}
</script>
</head>
<body onload="test();">
<p>This test verifies that the bit twiddling done in JavaScriptCore's integer machinery works correctly on the current platform.</p>
<p>Below, you will see a listing of the extremes related to representing integers using a certain number of bits. If the test succeeds, you should see:</p>
<ul>
<li> 0, -0, and -1</li>
<li> max: 2 ^ ([number of bits] - 1) - 1</li>
<li> min: -(max + 1)</li>
<li> a corresponding max + 1 and min - 1</li>
</ul>
<hr>
<div id='console'/>
</body>
</html>
More information about the webkit-changes
mailing list