diff options
author | Lei Zhang <thestig@chromium.org> | 2017-06-19 11:29:56 -0700 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-06-19 19:14:22 +0000 |
commit | e5749afd07de3b66c02bb76176d145e11f6ced34 (patch) | |
tree | e641f0a8fcdfe7296ecc7fdb31f70ba68a508d06 /core/fxcrt | |
parent | ea8a62416238977f0f437579f095786a3a99367e (diff) | |
download | pdfium-e5749afd07de3b66c02bb76176d145e11f6ced34.tar.xz |
Use EXPECT_STREQ() in fx_system_unittest.cpp.
Instead of using EXPECT_EQ() and constructing a std::string.
Change-Id: I7f349f49a03b1ebbad15865f9783568f4d025d91
Reviewed-on: https://pdfium-review.googlesource.com/6670
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fxcrt')
-rw-r--r-- | core/fxcrt/fx_system_unittest.cpp | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/core/fxcrt/fx_system_unittest.cpp b/core/fxcrt/fx_system_unittest.cpp index a83b275111..9182fdf7d9 100644 --- a/core/fxcrt/fx_system_unittest.cpp +++ b/core/fxcrt/fx_system_unittest.cpp @@ -3,7 +3,6 @@ // found in the LICENSE file. #include <limits> -#include <string> #include "core/fxcrt/fx_system.h" #include "testing/fx_string_testhelpers.h" @@ -23,7 +22,7 @@ void Check32BitBase16Itoa(int32_t input, const char* expected_output) { char buf[kBufLen]; buf[kBufLen - 1] = kSentinel; FXSYS_itoa(input, buf, 16); - EXPECT_EQ(std::string(expected_output), buf); + EXPECT_STREQ(expected_output, buf); EXPECT_EQ(kSentinel, buf[kBufLen - 1]); } @@ -32,7 +31,7 @@ void Check32BitBase10Itoa(int32_t input, const char* expected_output) { char buf[kBufLen]; buf[kBufLen - 1] = kSentinel; FXSYS_itoa(input, buf, 10); - EXPECT_EQ(std::string(expected_output), buf); + EXPECT_STREQ(expected_output, buf); EXPECT_EQ(kSentinel, buf[kBufLen - 1]); } @@ -41,7 +40,7 @@ void Check32BitBase2Itoa(int32_t input, const char* expected_output) { char buf[kBufLen]; buf[kBufLen - 1] = kSentinel; FXSYS_itoa(input, buf, 2); - EXPECT_EQ(std::string(expected_output), buf); + EXPECT_STREQ(expected_output, buf); EXPECT_EQ(kSentinel, buf[kBufLen - 1]); } @@ -50,7 +49,7 @@ void Check64BitBase16Itoa(int64_t input, const char* expected_output) { char buf[kBufLen]; buf[kBufLen - 1] = kSentinel; FXSYS_i64toa(input, buf, 16); - EXPECT_EQ(std::string(expected_output), buf); + EXPECT_STREQ(expected_output, buf); EXPECT_EQ(kSentinel, buf[kBufLen - 1]); } @@ -59,7 +58,7 @@ void Check64BitBase10Itoa(int64_t input, const char* expected_output) { char buf[kBufLen]; buf[kBufLen - 1] = kSentinel; FXSYS_i64toa(input, buf, 10); - EXPECT_EQ(std::string(expected_output), buf); + EXPECT_STREQ(expected_output, buf); EXPECT_EQ(kSentinel, buf[kBufLen - 1]); } @@ -68,7 +67,7 @@ void Check64BitBase2Itoa(int64_t input, const char* expected_output) { char buf[kBufLen]; buf[kBufLen - 1] = kSentinel; FXSYS_i64toa(input, buf, 2); - EXPECT_EQ(std::string(expected_output), buf); + EXPECT_STREQ(expected_output, buf); EXPECT_EQ(kSentinel, buf[kBufLen - 1]); } @@ -78,16 +77,16 @@ TEST(fxcrt, FXSYS_itoa_InvalidRadix) { char buf[32]; FXSYS_itoa(42, buf, 17); // Ours stops at 16. - EXPECT_EQ(std::string(""), buf); + EXPECT_STREQ("", buf); FXSYS_itoa(42, buf, 1); - EXPECT_EQ(std::string(""), buf); + EXPECT_STREQ("", buf); FXSYS_itoa(42, buf, 0); - EXPECT_EQ(std::string(""), buf); + EXPECT_STREQ("", buf); FXSYS_itoa(42, buf, -1); - EXPECT_EQ(std::string(""), buf); + EXPECT_STREQ("", buf); } TEST(fxcrt, FXSYS_itoa) { @@ -118,16 +117,16 @@ TEST(fxcrt, FXSYS_i64toa_InvalidRadix) { char buf[32]; FXSYS_i64toa(42, buf, 17); // Ours stops at 16. - EXPECT_EQ(std::string(""), buf); + EXPECT_STREQ("", buf); FXSYS_i64toa(42, buf, 1); - EXPECT_EQ(std::string(""), buf); + EXPECT_STREQ("", buf); FXSYS_i64toa(42, buf, 0); - EXPECT_EQ(std::string(""), buf); + EXPECT_STREQ("", buf); FXSYS_i64toa(42, buf, -1); - EXPECT_EQ(std::string(""), buf); + EXPECT_STREQ("", buf); } TEST(fxcrt, FXSYS_i64toa) { |