summaryrefslogtreecommitdiff
path: root/core/fxcrt/cfx_bytestring_unittest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxcrt/cfx_bytestring_unittest.cpp')
-rw-r--r--core/fxcrt/cfx_bytestring_unittest.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/core/fxcrt/cfx_bytestring_unittest.cpp b/core/fxcrt/cfx_bytestring_unittest.cpp
index 89c8ac6060..d843afef97 100644
--- a/core/fxcrt/cfx_bytestring_unittest.cpp
+++ b/core/fxcrt/cfx_bytestring_unittest.cpp
@@ -454,21 +454,25 @@ TEST(fxcrt, ByteStringInsertAtFrontAndInsertAtBack) {
TEST(fxcrt, ByteStringDelete) {
CFX_ByteString fred("FRED");
- fred.Delete(0, 2);
+ EXPECT_EQ(4, fred.Delete(0, 0));
+ EXPECT_EQ("FRED", fred);
+ EXPECT_EQ(2, fred.Delete(0, 2));
EXPECT_EQ("ED", fred);
- fred.Delete(1);
+ EXPECT_EQ(1, fred.Delete(1));
+ EXPECT_EQ("E", fred);
+ EXPECT_EQ(1, fred.Delete(-1));
EXPECT_EQ("E", fred);
- fred.Delete(-1);
+ EXPECT_EQ(0, fred.Delete(0));
EXPECT_EQ("", fred);
- fred.Delete(1);
+ EXPECT_EQ(0, fred.Delete(0));
EXPECT_EQ("", fred);
CFX_ByteString empty;
- empty.Delete(0);
+ EXPECT_EQ(0, empty.Delete(0));
EXPECT_EQ("", empty);
- empty.Delete(-1);
+ EXPECT_EQ(0, empty.Delete(-1));
EXPECT_EQ("", empty);
- empty.Delete(1);
+ EXPECT_EQ(0, empty.Delete(1));
EXPECT_EQ("", empty);
}