Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(404)

Side by Side Diff: test/cctest/test-conversions.cc

Issue 19300002: ES6: Add support for explicit octal and binary integer literals (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix long lines Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/scanner.cc ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 19 matching lines...) Expand all
30 #include "v8.h" 30 #include "v8.h"
31 31
32 #include "platform.h" 32 #include "platform.h"
33 #include "cctest.h" 33 #include "cctest.h"
34 34
35 using namespace v8::internal; 35 using namespace v8::internal;
36 36
37 37
38 TEST(Hex) { 38 TEST(Hex) {
39 UnicodeCache uc; 39 UnicodeCache uc;
40 CHECK_EQ(0.0, StringToDouble(&uc, "0x0", ALLOW_HEX | ALLOW_OCTALS)); 40 CHECK_EQ(0.0, StringToDouble(&uc, "0x0", ALLOW_HEX | ALLOW_IMPLICIT_OCTAL));
41 CHECK_EQ(0.0, StringToDouble(&uc, "0X0", ALLOW_HEX | ALLOW_OCTALS)); 41 CHECK_EQ(0.0, StringToDouble(&uc, "0X0", ALLOW_HEX | ALLOW_IMPLICIT_OCTAL));
42 CHECK_EQ(1.0, StringToDouble(&uc, "0x1", ALLOW_HEX | ALLOW_OCTALS)); 42 CHECK_EQ(1.0, StringToDouble(&uc, "0x1", ALLOW_HEX | ALLOW_IMPLICIT_OCTAL));
43 CHECK_EQ(16.0, StringToDouble(&uc, "0x10", ALLOW_HEX | ALLOW_OCTALS)); 43 CHECK_EQ(16.0, StringToDouble(&uc, "0x10", ALLOW_HEX | ALLOW_IMPLICIT_OCTAL));
44 CHECK_EQ(255.0, StringToDouble(&uc, "0xff", ALLOW_HEX | ALLOW_OCTALS)); 44 CHECK_EQ(255.0, StringToDouble(&uc, "0xff",
45 CHECK_EQ(175.0, StringToDouble(&uc, "0xAF", ALLOW_HEX | ALLOW_OCTALS)); 45 ALLOW_HEX | ALLOW_IMPLICIT_OCTAL));
46 CHECK_EQ(175.0, StringToDouble(&uc, "0xAF",
47 ALLOW_HEX | ALLOW_IMPLICIT_OCTAL));
46 48
47 CHECK_EQ(0.0, StringToDouble(&uc, "0x0", ALLOW_HEX)); 49 CHECK_EQ(0.0, StringToDouble(&uc, "0x0", ALLOW_HEX));
48 CHECK_EQ(0.0, StringToDouble(&uc, "0X0", ALLOW_HEX)); 50 CHECK_EQ(0.0, StringToDouble(&uc, "0X0", ALLOW_HEX));
49 CHECK_EQ(1.0, StringToDouble(&uc, "0x1", ALLOW_HEX)); 51 CHECK_EQ(1.0, StringToDouble(&uc, "0x1", ALLOW_HEX));
50 CHECK_EQ(16.0, StringToDouble(&uc, "0x10", ALLOW_HEX)); 52 CHECK_EQ(16.0, StringToDouble(&uc, "0x10", ALLOW_HEX));
51 CHECK_EQ(255.0, StringToDouble(&uc, "0xff", ALLOW_HEX)); 53 CHECK_EQ(255.0, StringToDouble(&uc, "0xff", ALLOW_HEX));
52 CHECK_EQ(175.0, StringToDouble(&uc, "0xAF", ALLOW_HEX)); 54 CHECK_EQ(175.0, StringToDouble(&uc, "0xAF", ALLOW_HEX));
53 } 55 }
54 56
55 57
56 TEST(Octal) { 58 TEST(Octal) {
57 UnicodeCache uc; 59 UnicodeCache uc;
58 CHECK_EQ(0.0, StringToDouble(&uc, "0", ALLOW_HEX | ALLOW_OCTALS)); 60 CHECK_EQ(0.0, StringToDouble(&uc, "0o0", ALLOW_OCTAL | ALLOW_IMPLICIT_OCTAL));
59 CHECK_EQ(0.0, StringToDouble(&uc, "00", ALLOW_HEX | ALLOW_OCTALS)); 61 CHECK_EQ(0.0, StringToDouble(&uc, "0O0", ALLOW_OCTAL | ALLOW_IMPLICIT_OCTAL));
60 CHECK_EQ(1.0, StringToDouble(&uc, "01", ALLOW_HEX | ALLOW_OCTALS)); 62 CHECK_EQ(1.0, StringToDouble(&uc, "0o1", ALLOW_OCTAL | ALLOW_IMPLICIT_OCTAL));
61 CHECK_EQ(7.0, StringToDouble(&uc, "07", ALLOW_HEX | ALLOW_OCTALS)); 63 CHECK_EQ(7.0, StringToDouble(&uc, "0o7", ALLOW_OCTAL | ALLOW_IMPLICIT_OCTAL));
62 CHECK_EQ(8.0, StringToDouble(&uc, "010", ALLOW_HEX | ALLOW_OCTALS)); 64 CHECK_EQ(8.0, StringToDouble(&uc, "0o10",
63 CHECK_EQ(63.0, StringToDouble(&uc, "077", ALLOW_HEX | ALLOW_OCTALS)); 65 ALLOW_OCTAL | ALLOW_IMPLICIT_OCTAL));
66 CHECK_EQ(63.0, StringToDouble(&uc, "0o77",
67 ALLOW_OCTAL | ALLOW_IMPLICIT_OCTAL));
68
69 CHECK_EQ(0.0, StringToDouble(&uc, "0o0", ALLOW_OCTAL));
70 CHECK_EQ(0.0, StringToDouble(&uc, "0O0", ALLOW_OCTAL));
71 CHECK_EQ(1.0, StringToDouble(&uc, "0o1", ALLOW_OCTAL));
72 CHECK_EQ(7.0, StringToDouble(&uc, "0o7", ALLOW_OCTAL));
73 CHECK_EQ(8.0, StringToDouble(&uc, "0o10", ALLOW_OCTAL));
74 CHECK_EQ(63.0, StringToDouble(&uc, "0o77", ALLOW_OCTAL));
75 }
76
77
78 TEST(ImplicitOctal) {
79 UnicodeCache uc;
80 CHECK_EQ(0.0, StringToDouble(&uc, "0", ALLOW_HEX | ALLOW_IMPLICIT_OCTAL));
81 CHECK_EQ(0.0, StringToDouble(&uc, "00", ALLOW_HEX | ALLOW_IMPLICIT_OCTAL));
82 CHECK_EQ(1.0, StringToDouble(&uc, "01", ALLOW_HEX | ALLOW_IMPLICIT_OCTAL));
83 CHECK_EQ(7.0, StringToDouble(&uc, "07", ALLOW_HEX | ALLOW_IMPLICIT_OCTAL));
84 CHECK_EQ(8.0, StringToDouble(&uc, "010", ALLOW_HEX | ALLOW_IMPLICIT_OCTAL));
85 CHECK_EQ(63.0, StringToDouble(&uc, "077", ALLOW_HEX | ALLOW_IMPLICIT_OCTAL));
64 86
65 CHECK_EQ(0.0, StringToDouble(&uc, "0", ALLOW_HEX)); 87 CHECK_EQ(0.0, StringToDouble(&uc, "0", ALLOW_HEX));
66 CHECK_EQ(0.0, StringToDouble(&uc, "00", ALLOW_HEX)); 88 CHECK_EQ(0.0, StringToDouble(&uc, "00", ALLOW_HEX));
67 CHECK_EQ(1.0, StringToDouble(&uc, "01", ALLOW_HEX)); 89 CHECK_EQ(1.0, StringToDouble(&uc, "01", ALLOW_HEX));
68 CHECK_EQ(7.0, StringToDouble(&uc, "07", ALLOW_HEX)); 90 CHECK_EQ(7.0, StringToDouble(&uc, "07", ALLOW_HEX));
69 CHECK_EQ(10.0, StringToDouble(&uc, "010", ALLOW_HEX)); 91 CHECK_EQ(10.0, StringToDouble(&uc, "010", ALLOW_HEX));
70 CHECK_EQ(77.0, StringToDouble(&uc, "077", ALLOW_HEX)); 92 CHECK_EQ(77.0, StringToDouble(&uc, "077", ALLOW_HEX));
71 93
72 const double x = 010000000000; // Power of 2, no rounding errors. 94 const double x = 010000000000; // Power of 2, no rounding errors.
73 CHECK_EQ(x * x * x * x * x, StringToDouble(&uc, "01" "0000000000" "0000000000" 95 CHECK_EQ(x * x * x * x * x, StringToDouble(&uc, "01" "0000000000" "0000000000"
74 "0000000000" "0000000000" "0000000000", ALLOW_OCTALS)); 96 "0000000000" "0000000000" "0000000000", ALLOW_IMPLICIT_OCTAL));
97 }
98
99
100 TEST(Binary) {
101 UnicodeCache uc;
102 CHECK_EQ(0.0, StringToDouble(&uc, "0b0",
103 ALLOW_BINARY | ALLOW_IMPLICIT_OCTAL));
104 CHECK_EQ(0.0, StringToDouble(&uc, "0B0",
105 ALLOW_BINARY | ALLOW_IMPLICIT_OCTAL));
106 CHECK_EQ(1.0, StringToDouble(&uc, "0b1",
107 ALLOW_BINARY | ALLOW_IMPLICIT_OCTAL));
108 CHECK_EQ(2.0, StringToDouble(&uc, "0b10",
109 ALLOW_BINARY | ALLOW_IMPLICIT_OCTAL));
110 CHECK_EQ(3.0, StringToDouble(&uc, "0b11",
111 ALLOW_BINARY | ALLOW_IMPLICIT_OCTAL));
112
113 CHECK_EQ(0.0, StringToDouble(&uc, "0b0", ALLOW_BINARY));
114 CHECK_EQ(0.0, StringToDouble(&uc, "0B0", ALLOW_BINARY));
115 CHECK_EQ(1.0, StringToDouble(&uc, "0b1", ALLOW_BINARY));
116 CHECK_EQ(2.0, StringToDouble(&uc, "0b10", ALLOW_BINARY));
117 CHECK_EQ(3.0, StringToDouble(&uc, "0b11", ALLOW_BINARY));
75 } 118 }
76 119
77 120
78 TEST(MalformedOctal) { 121 TEST(MalformedOctal) {
79 UnicodeCache uc; 122 UnicodeCache uc;
80 CHECK_EQ(8.0, StringToDouble(&uc, "08", ALLOW_HEX | ALLOW_OCTALS)); 123 CHECK_EQ(8.0, StringToDouble(&uc, "08", ALLOW_HEX | ALLOW_IMPLICIT_OCTAL));
81 CHECK_EQ(81.0, StringToDouble(&uc, "081", ALLOW_HEX | ALLOW_OCTALS)); 124 CHECK_EQ(81.0, StringToDouble(&uc, "081", ALLOW_HEX | ALLOW_IMPLICIT_OCTAL));
82 CHECK_EQ(78.0, StringToDouble(&uc, "078", ALLOW_HEX | ALLOW_OCTALS)); 125 CHECK_EQ(78.0, StringToDouble(&uc, "078", ALLOW_HEX | ALLOW_IMPLICIT_OCTAL));
83 126
84 CHECK(std::isnan(StringToDouble(&uc, "07.7", ALLOW_HEX | ALLOW_OCTALS))); 127 CHECK(std::isnan(StringToDouble(&uc, "07.7",
85 CHECK(std::isnan(StringToDouble(&uc, "07.8", ALLOW_HEX | ALLOW_OCTALS))); 128 ALLOW_HEX | ALLOW_IMPLICIT_OCTAL)));
86 CHECK(std::isnan(StringToDouble(&uc, "07e8", ALLOW_HEX | ALLOW_OCTALS))); 129 CHECK(std::isnan(StringToDouble(&uc, "07.8",
87 CHECK(std::isnan(StringToDouble(&uc, "07e7", ALLOW_HEX | ALLOW_OCTALS))); 130 ALLOW_HEX | ALLOW_IMPLICIT_OCTAL)));
131 CHECK(std::isnan(StringToDouble(&uc, "07e8",
132 ALLOW_HEX | ALLOW_IMPLICIT_OCTAL)));
133 CHECK(std::isnan(StringToDouble(&uc, "07e7",
134 ALLOW_HEX | ALLOW_IMPLICIT_OCTAL)));
88 135
89 CHECK_EQ(8.7, StringToDouble(&uc, "08.7", ALLOW_HEX | ALLOW_OCTALS)); 136 CHECK_EQ(8.7, StringToDouble(&uc, "08.7", ALLOW_HEX | ALLOW_IMPLICIT_OCTAL));
90 CHECK_EQ(8e7, StringToDouble(&uc, "08e7", ALLOW_HEX | ALLOW_OCTALS)); 137 CHECK_EQ(8e7, StringToDouble(&uc, "08e7", ALLOW_HEX | ALLOW_IMPLICIT_OCTAL));
91 138
92 CHECK_EQ(0.001, StringToDouble(&uc, "0.001", ALLOW_HEX | ALLOW_OCTALS)); 139 CHECK_EQ(0.001, StringToDouble(&uc, "0.001",
93 CHECK_EQ(0.713, StringToDouble(&uc, "0.713", ALLOW_HEX | ALLOW_OCTALS)); 140 ALLOW_HEX | ALLOW_IMPLICIT_OCTAL));
141 CHECK_EQ(0.713, StringToDouble(&uc, "0.713",
142 ALLOW_HEX | ALLOW_IMPLICIT_OCTAL));
94 143
95 CHECK_EQ(8.0, StringToDouble(&uc, "08", ALLOW_HEX)); 144 CHECK_EQ(8.0, StringToDouble(&uc, "08", ALLOW_HEX));
96 CHECK_EQ(81.0, StringToDouble(&uc, "081", ALLOW_HEX)); 145 CHECK_EQ(81.0, StringToDouble(&uc, "081", ALLOW_HEX));
97 CHECK_EQ(78.0, StringToDouble(&uc, "078", ALLOW_HEX)); 146 CHECK_EQ(78.0, StringToDouble(&uc, "078", ALLOW_HEX));
98 147
99 CHECK_EQ(7.7, StringToDouble(&uc, "07.7", ALLOW_HEX)); 148 CHECK_EQ(7.7, StringToDouble(&uc, "07.7", ALLOW_HEX));
100 CHECK_EQ(7.8, StringToDouble(&uc, "07.8", ALLOW_HEX)); 149 CHECK_EQ(7.8, StringToDouble(&uc, "07.8", ALLOW_HEX));
101 CHECK_EQ(7e8, StringToDouble(&uc, "07e8", ALLOW_HEX)); 150 CHECK_EQ(7e8, StringToDouble(&uc, "07e8", ALLOW_HEX));
102 CHECK_EQ(7e7, StringToDouble(&uc, "07e7", ALLOW_HEX)); 151 CHECK_EQ(7e7, StringToDouble(&uc, "07e7", ALLOW_HEX));
103 152
104 CHECK_EQ(8.7, StringToDouble(&uc, "08.7", ALLOW_HEX)); 153 CHECK_EQ(8.7, StringToDouble(&uc, "08.7", ALLOW_HEX));
105 CHECK_EQ(8e7, StringToDouble(&uc, "08e7", ALLOW_HEX)); 154 CHECK_EQ(8e7, StringToDouble(&uc, "08e7", ALLOW_HEX));
106 155
107 CHECK_EQ(0.001, StringToDouble(&uc, "0.001", ALLOW_HEX)); 156 CHECK_EQ(0.001, StringToDouble(&uc, "0.001", ALLOW_HEX));
108 CHECK_EQ(0.713, StringToDouble(&uc, "0.713", ALLOW_HEX)); 157 CHECK_EQ(0.713, StringToDouble(&uc, "0.713", ALLOW_HEX));
109 } 158 }
110 159
111 160
112 TEST(TrailingJunk) { 161 TEST(TrailingJunk) {
113 UnicodeCache uc; 162 UnicodeCache uc;
114 CHECK_EQ(8.0, StringToDouble(&uc, "8q", ALLOW_TRAILING_JUNK)); 163 CHECK_EQ(8.0, StringToDouble(&uc, "8q", ALLOW_TRAILING_JUNK));
115 CHECK_EQ(63.0, 164 CHECK_EQ(63.0, StringToDouble(&uc, "077qqq",
116 StringToDouble(&uc, "077qqq", ALLOW_OCTALS | ALLOW_TRAILING_JUNK)); 165 ALLOW_IMPLICIT_OCTAL | ALLOW_TRAILING_JUNK));
117 CHECK_EQ(10.0, 166 CHECK_EQ(10.0, StringToDouble(&uc, "10e",
118 StringToDouble(&uc, "10e", ALLOW_OCTALS | ALLOW_TRAILING_JUNK)); 167 ALLOW_IMPLICIT_OCTAL | ALLOW_TRAILING_JUNK));
119 CHECK_EQ(10.0, 168 CHECK_EQ(10.0, StringToDouble(&uc, "10e-",
120 StringToDouble(&uc, "10e-", ALLOW_OCTALS | ALLOW_TRAILING_JUNK)); 169 ALLOW_IMPLICIT_OCTAL | ALLOW_TRAILING_JUNK));
121 } 170 }
122 171
123 172
124 TEST(NonStrDecimalLiteral) { 173 TEST(NonStrDecimalLiteral) {
125 UnicodeCache uc; 174 UnicodeCache uc;
126 CHECK(std::isnan(StringToDouble(&uc, " ", NO_FLAGS, OS::nan_value()))); 175 CHECK(std::isnan(StringToDouble(&uc, " ", NO_FLAGS, OS::nan_value())));
127 CHECK(std::isnan(StringToDouble(&uc, "", NO_FLAGS, OS::nan_value()))); 176 CHECK(std::isnan(StringToDouble(&uc, "", NO_FLAGS, OS::nan_value())));
128 CHECK(std::isnan(StringToDouble(&uc, " ", NO_FLAGS, OS::nan_value()))); 177 CHECK(std::isnan(StringToDouble(&uc, " ", NO_FLAGS, OS::nan_value())));
129 CHECK_EQ(0.0, StringToDouble(&uc, "", NO_FLAGS)); 178 CHECK_EQ(0.0, StringToDouble(&uc, "", NO_FLAGS));
130 CHECK_EQ(0.0, StringToDouble(&uc, " ", NO_FLAGS)); 179 CHECK_EQ(0.0, StringToDouble(&uc, " ", NO_FLAGS));
131 } 180 }
132 181
133 182
134 TEST(IntegerStrLiteral) { 183 TEST(IntegerStrLiteral) {
135 UnicodeCache uc; 184 UnicodeCache uc;
136 CHECK_EQ(0.0, StringToDouble(&uc, "0.0", NO_FLAGS)); 185 CHECK_EQ(0.0, StringToDouble(&uc, "0.0", NO_FLAGS));
137 CHECK_EQ(0.0, StringToDouble(&uc, "0", NO_FLAGS)); 186 CHECK_EQ(0.0, StringToDouble(&uc, "0", NO_FLAGS));
138 CHECK_EQ(0.0, StringToDouble(&uc, "00", NO_FLAGS)); 187 CHECK_EQ(0.0, StringToDouble(&uc, "00", NO_FLAGS));
139 CHECK_EQ(0.0, StringToDouble(&uc, "000", NO_FLAGS)); 188 CHECK_EQ(0.0, StringToDouble(&uc, "000", NO_FLAGS));
140 CHECK_EQ(1.0, StringToDouble(&uc, "1", NO_FLAGS)); 189 CHECK_EQ(1.0, StringToDouble(&uc, "1", NO_FLAGS));
141 CHECK_EQ(-1.0, StringToDouble(&uc, "-1", NO_FLAGS)); 190 CHECK_EQ(-1.0, StringToDouble(&uc, "-1", NO_FLAGS));
142 CHECK_EQ(-1.0, StringToDouble(&uc, " -1 ", NO_FLAGS)); 191 CHECK_EQ(-1.0, StringToDouble(&uc, " -1 ", NO_FLAGS));
143 CHECK_EQ(1.0, StringToDouble(&uc, " +1 ", NO_FLAGS)); 192 CHECK_EQ(1.0, StringToDouble(&uc, " +1 ", NO_FLAGS));
144 CHECK(std::isnan(StringToDouble(&uc, " - 1 ", NO_FLAGS))); 193 CHECK(std::isnan(StringToDouble(&uc, " - 1 ", NO_FLAGS)));
145 CHECK(std::isnan(StringToDouble(&uc, " + 1 ", NO_FLAGS))); 194 CHECK(std::isnan(StringToDouble(&uc, " + 1 ", NO_FLAGS)));
146 195
147 CHECK_EQ(0.0, StringToDouble(&uc, "0e0", ALLOW_HEX | ALLOW_OCTALS)); 196 CHECK_EQ(0.0, StringToDouble(&uc, "0e0", ALLOW_HEX | ALLOW_IMPLICIT_OCTAL));
148 CHECK_EQ(0.0, StringToDouble(&uc, "0e1", ALLOW_HEX | ALLOW_OCTALS)); 197 CHECK_EQ(0.0, StringToDouble(&uc, "0e1", ALLOW_HEX | ALLOW_IMPLICIT_OCTAL));
149 CHECK_EQ(0.0, StringToDouble(&uc, "0e-1", ALLOW_HEX | ALLOW_OCTALS)); 198 CHECK_EQ(0.0, StringToDouble(&uc, "0e-1", ALLOW_HEX | ALLOW_IMPLICIT_OCTAL));
150 CHECK_EQ(0.0, StringToDouble(&uc, "0e-100000", ALLOW_HEX | ALLOW_OCTALS)); 199 CHECK_EQ(0.0, StringToDouble(&uc, "0e-100000",
151 CHECK_EQ(0.0, StringToDouble(&uc, "0e+100000", ALLOW_HEX | ALLOW_OCTALS)); 200 ALLOW_HEX | ALLOW_IMPLICIT_OCTAL));
152 CHECK_EQ(0.0, StringToDouble(&uc, "0.", ALLOW_HEX | ALLOW_OCTALS)); 201 CHECK_EQ(0.0, StringToDouble(&uc, "0e+100000",
202 ALLOW_HEX | ALLOW_IMPLICIT_OCTAL));
203 CHECK_EQ(0.0, StringToDouble(&uc, "0.", ALLOW_HEX | ALLOW_IMPLICIT_OCTAL));
153 } 204 }
154 205
155 206
156 TEST(LongNumberStr) { 207 TEST(LongNumberStr) {
157 UnicodeCache uc; 208 UnicodeCache uc;
158 CHECK_EQ(1e10, StringToDouble(&uc, "1" "0000000000", NO_FLAGS)); 209 CHECK_EQ(1e10, StringToDouble(&uc, "1" "0000000000", NO_FLAGS));
159 CHECK_EQ(1e20, StringToDouble(&uc, "1" "0000000000" "0000000000", NO_FLAGS)); 210 CHECK_EQ(1e20, StringToDouble(&uc, "1" "0000000000" "0000000000", NO_FLAGS));
160 211
161 CHECK_EQ(1e60, StringToDouble(&uc, "1" "0000000000" "0000000000" "0000000000" 212 CHECK_EQ(1e60, StringToDouble(&uc, "1" "0000000000" "0000000000" "0000000000"
162 "0000000000" "0000000000" "0000000000", NO_FLAGS)); 213 "0000000000" "0000000000" "0000000000", NO_FLAGS));
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 // Test most significant bits. 352 // Test most significant bits.
302 x = V8_2PART_UINT64_C(0xE0000000, 00000000); 353 x = V8_2PART_UINT64_C(0xE0000000, 00000000);
303 CHECK(x == UpperBits::encode(7)); 354 CHECK(x == UpperBits::encode(7));
304 CHECK_EQ(7, UpperBits::decode(x)); 355 CHECK_EQ(7, UpperBits::decode(x));
305 356
306 // Test the 32/64-bit boundary bits. 357 // Test the 32/64-bit boundary bits.
307 x = V8_2PART_UINT64_C(0x00000001, 80000000); 358 x = V8_2PART_UINT64_C(0x00000001, 80000000);
308 CHECK(x == MiddleBits::encode(3)); 359 CHECK(x == MiddleBits::encode(3));
309 CHECK_EQ(3, MiddleBits::decode(x)); 360 CHECK_EQ(3, MiddleBits::decode(x));
310 } 361 }
OLDNEW
« no previous file with comments | « src/scanner.cc ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698