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

Side by Side Diff: base/strings/string_number_conversions_unittest.cc

Issue 2364123002: Merge latest changes from http://www.netlib.org/fp/dtoa.c into dtoa.cc (Closed)
Patch Set: address scottmg's comments Created 4 years, 3 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
« no previous file with comments | « no previous file | base/third_party/dmg_fp/README.chromium » ('j') | base/third_party/dmg_fp/dtoa.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/strings/string_number_conversions.h" 5 #include "base/strings/string_number_conversions.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <limits.h> 8 #include <limits.h>
9 #include <stddef.h> 9 #include <stddef.h>
10 #include <stdint.h> 10 #include <stdint.h>
(...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after
883 {"8.32116e+55", 0x4b8b2628393e02cdULL}, 883 {"8.32116e+55", 0x4b8b2628393e02cdULL},
884 }; 884 };
885 885
886 for (const auto& test : cases) { 886 for (const auto& test : cases) {
887 double output; 887 double output;
888 EXPECT_TRUE(StringToDouble(test.input, &output)); 888 EXPECT_TRUE(StringToDouble(test.input, &output));
889 EXPECT_EQ(bit_cast<uint64_t>(output), test.expected); 889 EXPECT_EQ(bit_cast<uint64_t>(output), test.expected);
890 } 890 }
891 } 891 }
892 892
893 TEST(StringNumberConversionsTest, StringToDoubleHangBug588726) {
Lei Zhang 2016/09/23 19:32:16 Just add it to StringNumberConversionsTest.StringT
kcwu 2016/09/23 19:48:03 Done.
894 double output;
895 EXPECT_TRUE(StringToDouble(
896 "-0.0010000000000000000000000000000000000000001e-256", &output));
897 EXPECT_DOUBLE_EQ(-1.0000000000000001e-259, output);
898 }
899
893 } // namespace base 900 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | base/third_party/dmg_fp/README.chromium » ('j') | base/third_party/dmg_fp/dtoa.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698