| OLD | NEW |
| 1 // Copyright 2015 PDFium Authors. All rights reserved. | 1 // Copyright 2015 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
| 8 #include "../../../testing/fx_string_testhelpers.h" | 8 #include "../../../testing/fx_string_testhelpers.h" |
| 9 #include "../../include/fxcrt/fx_system.h" | 9 #include "../../include/fxcrt/fx_system.h" |
| 10 | 10 |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 FXSYS_i64toa(42, buf, 1); | 122 FXSYS_i64toa(42, buf, 1); |
| 123 EXPECT_EQ(std::string(""), buf); | 123 EXPECT_EQ(std::string(""), buf); |
| 124 | 124 |
| 125 FXSYS_i64toa(42, buf, 0); | 125 FXSYS_i64toa(42, buf, 0); |
| 126 EXPECT_EQ(std::string(""), buf); | 126 EXPECT_EQ(std::string(""), buf); |
| 127 | 127 |
| 128 FXSYS_i64toa(42, buf, -1); | 128 FXSYS_i64toa(42, buf, -1); |
| 129 EXPECT_EQ(std::string(""), buf); | 129 EXPECT_EQ(std::string(""), buf); |
| 130 }; | 130 }; |
| 131 | 131 |
| 132 | |
| 133 TEST(fxcrt, FXSYS_i64toa) { | 132 TEST(fxcrt, FXSYS_i64toa) { |
| 134 Check64BitBase16Itoa( | 133 Check64BitBase16Itoa(std::numeric_limits<int64_t>::min(), |
| 135 std::numeric_limits<int64_t>::min(), "-8000000000000000"); | 134 "-8000000000000000"); |
| 136 Check64BitBase10Itoa( | 135 Check64BitBase10Itoa(std::numeric_limits<int64_t>::min(), |
| 137 std::numeric_limits<int64_t>::min(), "-9223372036854775808"); | 136 "-9223372036854775808"); |
| 138 Check64BitBase2Itoa( | 137 Check64BitBase2Itoa( |
| 139 std::numeric_limits<int64_t>::min(), | 138 std::numeric_limits<int64_t>::min(), |
| 140 "-1000000000000000000000000000000000000000000000000000000000000000"); | 139 "-1000000000000000000000000000000000000000000000000000000000000000"); |
| 141 | 140 |
| 142 Check64BitBase16Itoa(-1, "-1"); | 141 Check64BitBase16Itoa(-1, "-1"); |
| 143 Check64BitBase10Itoa(-1, "-1"); | 142 Check64BitBase10Itoa(-1, "-1"); |
| 144 Check64BitBase2Itoa(-1, "-1"); | 143 Check64BitBase2Itoa(-1, "-1"); |
| 145 | 144 |
| 146 Check64BitBase16Itoa(0, "0"); | 145 Check64BitBase16Itoa(0, "0"); |
| 147 Check64BitBase10Itoa(0, "0"); | 146 Check64BitBase10Itoa(0, "0"); |
| 148 Check64BitBase2Itoa(0, "0"); | 147 Check64BitBase2Itoa(0, "0"); |
| 149 | 148 |
| 150 Check64BitBase16Itoa(42, "2a"); | 149 Check64BitBase16Itoa(42, "2a"); |
| 151 Check64BitBase10Itoa(42, "42"); | 150 Check64BitBase10Itoa(42, "42"); |
| 152 Check64BitBase2Itoa(42, "101010"); | 151 Check64BitBase2Itoa(42, "101010"); |
| 153 | 152 |
| 154 Check64BitBase16Itoa( | 153 Check64BitBase16Itoa(std::numeric_limits<int64_t>::max(), "7fffffffffffffff"); |
| 155 std::numeric_limits<int64_t>::max(), "7fffffffffffffff"); | 154 Check64BitBase10Itoa(std::numeric_limits<int64_t>::max(), |
| 156 Check64BitBase10Itoa( | 155 "9223372036854775807"); |
| 157 std::numeric_limits<int64_t>::max(), "9223372036854775807"); | |
| 158 Check64BitBase2Itoa( | 156 Check64BitBase2Itoa( |
| 159 std::numeric_limits<int64_t>::max(), | 157 std::numeric_limits<int64_t>::max(), |
| 160 "111111111111111111111111111111111111111111111111111111111111111"); | 158 "111111111111111111111111111111111111111111111111111111111111111"); |
| 161 } | 159 } |
| 162 | 160 |
| 163 #endif // _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ | 161 #endif // _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ |
| 164 | |
| OLD | NEW |