summaryrefslogtreecommitdiff
path: root/core/fxcrt/fx_system_unittest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxcrt/fx_system_unittest.cpp')
-rw-r--r--core/fxcrt/fx_system_unittest.cpp29
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) {