summaryrefslogtreecommitdiff
path: root/core/fxcrt/fx_extension_unittest.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-05-23 23:41:00 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-05-23 23:41:00 +0000
commit7e33dbeec78dfa051df52619672133da6a799240 (patch)
treedbcd9f395ed0b89de890af24deae9fa1744fdd8e /core/fxcrt/fx_extension_unittest.cpp
parent105ea1c0f896a4a2718f1356cae0dce8c01859cc (diff)
downloadpdfium-7e33dbeec78dfa051df52619672133da6a799240.tar.xz
Remove GetBits32().
Replace it with CFX_BitStream. Change-Id: Ib74657f888b8dec8b6fdad7b49e28d250991c590 Reviewed-on: https://pdfium-review.googlesource.com/32852 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fxcrt/fx_extension_unittest.cpp')
-rw-r--r--core/fxcrt/fx_extension_unittest.cpp23
1 files changed, 0 insertions, 23 deletions
diff --git a/core/fxcrt/fx_extension_unittest.cpp b/core/fxcrt/fx_extension_unittest.cpp
index 155b7014b7..39f26b534b 100644
--- a/core/fxcrt/fx_extension_unittest.cpp
+++ b/core/fxcrt/fx_extension_unittest.cpp
@@ -5,19 +5,6 @@
#include "core/fxcrt/fx_extension.h"
#include "testing/gtest/include/gtest/gtest.h"
-namespace {
-
-uint32_t ReferenceGetBits32(const uint8_t* pData, int bitpos, int nbits) {
- int result = 0;
- for (int i = 0; i < nbits; i++) {
- if (pData[(bitpos + i) / 8] & (1 << (7 - (bitpos + i) % 8)))
- result |= 1 << (nbits - i - 1);
- }
- return result;
-}
-
-} // namespace
-
TEST(fxcrt, FXSYS_HexCharToInt) {
EXPECT_EQ(10, FXSYS_HexCharToInt('a'));
EXPECT_EQ(10, FXSYS_HexCharToInt('A'));
@@ -103,16 +90,6 @@ TEST(fxcrt, FXSYS_ToUTF16BE) {
EXPECT_STREQ("D840DC3E", buf);
}
-TEST(fxcrt, GetBits32) {
- unsigned char data[] = {0xDE, 0x3F, 0xB1, 0x7C, 0x12, 0x9A, 0x04, 0x56};
- for (int nbits = 1; nbits <= 32; ++nbits) {
- for (int bitpos = 0; bitpos < (int)sizeof(data) * 8 - nbits; ++bitpos) {
- EXPECT_EQ(ReferenceGetBits32(data, bitpos, nbits),
- GetBits32(data, bitpos, nbits));
- }
- }
-}
-
TEST(fxcrt, FXSYS_wcstof) {
int32_t used_len = 0;
EXPECT_FLOAT_EQ(-12.0f, FXSYS_wcstof(L"-12", 3, &used_len));