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

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

Issue 9599004: Set x87 FPU precision to 64-bit for MinGW on V8 init to fix failing test (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 9 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/win32-headers.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 2
3 #include <stdlib.h> 3 #include <stdlib.h>
4 4
5 #include "v8.h" 5 #include "v8.h"
6 6
7 #include "bignum.h" 7 #include "bignum.h"
8 #include "cctest.h" 8 #include "cctest.h"
9 #include "diy-fp.h" 9 #include "diy-fp.h"
10 #include "double.h" 10 #include "double.h"
11 #include "strtod.h" 11 #include "strtod.h"
12 12
13 using namespace v8::internal; 13 using namespace v8::internal;
14 14
15 static Vector<const char> StringToVector(const char* str) { 15 static Vector<const char> StringToVector(const char* str) {
16 return Vector<const char>(str, StrLength(str)); 16 return Vector<const char>(str, StrLength(str));
17 } 17 }
18 18
19 19
20 static double StrtodChar(const char* str, int exponent) { 20 static double StrtodChar(const char* str, int exponent) {
21 return Strtod(StringToVector(str), exponent); 21 return Strtod(StringToVector(str), exponent);
22 } 22 }
23 23
24 24
25 TEST(Strtod) { 25 TEST(Strtod) {
26 v8::V8::Initialize();
27
26 Vector<const char> vector; 28 Vector<const char> vector;
27 29
28 vector = StringToVector("0"); 30 vector = StringToVector("0");
29 CHECK_EQ(0.0, Strtod(vector, 1)); 31 CHECK_EQ(0.0, Strtod(vector, 1));
30 CHECK_EQ(0.0, Strtod(vector, 2)); 32 CHECK_EQ(0.0, Strtod(vector, 2));
31 CHECK_EQ(0.0, Strtod(vector, -2)); 33 CHECK_EQ(0.0, Strtod(vector, -2));
32 CHECK_EQ(0.0, Strtod(vector, -999)); 34 CHECK_EQ(0.0, Strtod(vector, -999));
33 CHECK_EQ(0.0, Strtod(vector, +999)); 35 CHECK_EQ(0.0, Strtod(vector, +999));
34 36
35 vector = StringToVector("1"); 37 vector = StringToVector("1");
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 buffer[pos++] = random() % 10 + '0'; 446 buffer[pos++] = random() % 10 + '0';
445 } 447 }
446 int exponent = DeterministicRandom() % (308*2 + 1) - 308 - length; 448 int exponent = DeterministicRandom() % (308*2 + 1) - 308 - length;
447 buffer[pos] = '\0'; 449 buffer[pos] = '\0';
448 Vector<const char> vector(buffer, pos); 450 Vector<const char> vector(buffer, pos);
449 double strtod_result = Strtod(vector, exponent); 451 double strtod_result = Strtod(vector, exponent);
450 CHECK(CheckDouble(vector, exponent, strtod_result)); 452 CHECK(CheckDouble(vector, exponent, strtod_result));
451 } 453 }
452 } 454 }
453 } 455 }
OLDNEW
« no previous file with comments | « src/win32-headers.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698