| 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 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 string8.ensure16Bit(); | 438 string8.ensure16Bit(); |
| 439 EXPECT_FALSE(string8.is8Bit()); | 439 EXPECT_FALSE(string8.is8Bit()); |
| 440 EXPECT_EQ("8bit", string8); | 440 EXPECT_EQ("8bit", string8); |
| 441 | 441 |
| 442 String string16(reinterpret_cast<const UChar*>(u"16bit")); | 442 String string16(reinterpret_cast<const UChar*>(u"16bit")); |
| 443 EXPECT_FALSE(string16.is8Bit()); | 443 EXPECT_FALSE(string16.is8Bit()); |
| 444 string16.ensure16Bit(); | 444 string16.ensure16Bit(); |
| 445 EXPECT_FALSE(string16.is8Bit()); | 445 EXPECT_FALSE(string16.is8Bit()); |
| 446 EXPECT_EQ("16bit", string16); | 446 EXPECT_EQ("16bit", string16); |
| 447 | 447 |
| 448 String empty8(StringImpl::empty()); | 448 String empty8(StringImpl::empty); |
| 449 EXPECT_TRUE(empty8.is8Bit()); | 449 EXPECT_TRUE(empty8.is8Bit()); |
| 450 empty8.ensure16Bit(); | 450 empty8.ensure16Bit(); |
| 451 EXPECT_FALSE(empty8.is8Bit()); | 451 EXPECT_FALSE(empty8.is8Bit()); |
| 452 EXPECT_TRUE(empty8.isEmpty()); | 452 EXPECT_TRUE(empty8.isEmpty()); |
| 453 EXPECT_FALSE(empty8.isNull()); | 453 EXPECT_FALSE(empty8.isNull()); |
| 454 | 454 |
| 455 String empty16(StringImpl::empty16Bit()); | 455 String empty16(StringImpl::empty16Bit); |
| 456 EXPECT_FALSE(empty16.is8Bit()); | 456 EXPECT_FALSE(empty16.is8Bit()); |
| 457 empty16.ensure16Bit(); | 457 empty16.ensure16Bit(); |
| 458 EXPECT_FALSE(empty16.is8Bit()); | 458 EXPECT_FALSE(empty16.is8Bit()); |
| 459 EXPECT_TRUE(empty16.isEmpty()); | 459 EXPECT_TRUE(empty16.isEmpty()); |
| 460 EXPECT_FALSE(empty16.isNull()); | 460 EXPECT_FALSE(empty16.isNull()); |
| 461 | 461 |
| 462 String nullString; | 462 String nullString; |
| 463 nullString.ensure16Bit(); | 463 nullString.ensure16Bit(); |
| 464 EXPECT_TRUE(nullString.isNull()); | 464 EXPECT_TRUE(nullString.isNull()); |
| 465 } | 465 } |
| (...skipping 27 matching lines...) Expand all Loading... |
| 493 EXPECT_EQ(CString("<null>"), toCStringThroughPrinter(String())); | 493 EXPECT_EQ(CString("<null>"), toCStringThroughPrinter(String())); |
| 494 | 494 |
| 495 static const UChar unicodeSample[] = {0x30C6, 0x30B9, | 495 static const UChar unicodeSample[] = {0x30C6, 0x30B9, |
| 496 0x30C8}; // "Test" in Japanese. | 496 0x30C8}; // "Test" in Japanese. |
| 497 EXPECT_EQ(CString("\"\\u30C6\\u30B9\\u30C8\""), | 497 EXPECT_EQ(CString("\"\\u30C6\\u30B9\\u30C8\""), |
| 498 toCStringThroughPrinter( | 498 toCStringThroughPrinter( |
| 499 String(unicodeSample, WTF_ARRAY_LENGTH(unicodeSample)))); | 499 String(unicodeSample, WTF_ARRAY_LENGTH(unicodeSample)))); |
| 500 } | 500 } |
| 501 | 501 |
| 502 } // namespace WTF | 502 } // namespace WTF |
| OLD | NEW |