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

Side by Side Diff: core/fxcrt/fx_basic_util_unittest.cpp

Issue 2382723003: Move core/fxcrt/include to core/fxcrt (Closed)
Patch Set: Rebase to master Created 4 years, 2 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 | « core/fxcrt/fx_basic_util.cpp ('k') | core/fxcrt/fx_basic_wstring.cpp » ('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 2016 PDFium Authors. All rights reserved. 1 // Copyright 2016 PDFium 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 <limits> 5 #include <limits>
6 6
7 #include "core/fxcrt/include/fx_basic.h" 7 #include "core/fxcrt/fx_basic.h"
8 #include "testing/fx_string_testhelpers.h" 8 #include "testing/fx_string_testhelpers.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
11 namespace { 11 namespace {
12 12
13 uint32_t ReferenceGetBits32(const uint8_t* pData, int bitpos, int nbits) { 13 uint32_t ReferenceGetBits32(const uint8_t* pData, int bitpos, int nbits) {
14 int result = 0; 14 int result = 0;
15 for (int i = 0; i < nbits; i++) { 15 for (int i = 0; i < nbits; i++) {
16 if (pData[(bitpos + i) / 8] & (1 << (7 - (bitpos + i) % 8))) 16 if (pData[(bitpos + i) / 8] & (1 << (7 - (bitpos + i) % 8)))
17 result |= 1 << (nbits - i - 1); 17 result |= 1 << (nbits - i - 1);
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 EXPECT_TRUE(FX_atonum("-4294965252", &i)); 68 EXPECT_TRUE(FX_atonum("-4294965252", &i));
69 EXPECT_EQ(0, i); 69 EXPECT_EQ(0, i);
70 70
71 EXPECT_TRUE(FX_atonum("+4294965252", &i)); 71 EXPECT_TRUE(FX_atonum("+4294965252", &i));
72 EXPECT_EQ(0, i); 72 EXPECT_EQ(0, i);
73 73
74 float f; 74 float f;
75 EXPECT_FALSE(FX_atonum("3.24", &f)); 75 EXPECT_FALSE(FX_atonum("3.24", &f));
76 EXPECT_FLOAT_EQ(3.24f, f); 76 EXPECT_FLOAT_EQ(3.24f, f);
77 } 77 }
OLDNEW
« no previous file with comments | « core/fxcrt/fx_basic_util.cpp ('k') | core/fxcrt/fx_basic_wstring.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698