| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2012 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 | 101 |
| 102 TEST(CStringTest, CopyOnWrite) | 102 TEST(CStringTest, CopyOnWrite) |
| 103 { | 103 { |
| 104 const char* initialString = "Webkit"; | 104 const char* initialString = "Webkit"; |
| 105 CString string(initialString); | 105 CString string(initialString); |
| 106 CString copy = string; | 106 CString copy = string; |
| 107 | 107 |
| 108 string.mutableData()[3] = 'K'; | 108 string.mutableData()[3] = 'K'; |
| 109 EXPECT_TRUE(string != copy); | 109 EXPECT_TRUE(string != copy); |
| 110 EXPECT_STREQ("WebKit", string.data()); | 110 EXPECT_STREQ("WebKit", string.data()); |
| 111 EXPECT_EQ("WebKit", string.toStdString()); |
| 111 EXPECT_STREQ(initialString, copy.data()); | 112 EXPECT_STREQ(initialString, copy.data()); |
| 113 EXPECT_EQ(initialString, copy.toStdString()); |
| 112 } | 114 } |
| 113 | 115 |
| 114 TEST(CStringTest, Comparison) | 116 TEST(CStringTest, Comparison) |
| 115 { | 117 { |
| 116 // Comparison with another CString. | 118 // Comparison with another CString. |
| 117 CString a; | 119 CString a; |
| 118 CString b; | 120 CString b; |
| 119 EXPECT_TRUE(a == b); | 121 EXPECT_TRUE(a == b); |
| 120 EXPECT_FALSE(a != b); | 122 EXPECT_FALSE(a != b); |
| 121 a = "a"; | 123 a = "a"; |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 d = ""; | 194 d = ""; |
| 193 EXPECT_FALSE(c == d); | 195 EXPECT_FALSE(c == d); |
| 194 EXPECT_TRUE(c != d); | 196 EXPECT_TRUE(c != d); |
| 195 c = ""; | 197 c = ""; |
| 196 d = "b"; | 198 d = "b"; |
| 197 EXPECT_FALSE(c == d); | 199 EXPECT_FALSE(c == d); |
| 198 EXPECT_TRUE(c != d); | 200 EXPECT_TRUE(c != d); |
| 199 } | 201 } |
| 200 | 202 |
| 201 } // namespace WTF | 203 } // namespace WTF |
| OLD | NEW |