| 93 | static char const charArray[] = "abc"; |
| 94 | |
| 95 | static bool testFromCharArray(cm::String str) |
| 96 | { |
| 97 | cm::String const& str_const = str; |
| 98 | ASSERT_TRUE(str_const.data() != charArray); |
| 99 | ASSERT_TRUE(str_const.size() == sizeof(charArray) - 1); |
| 100 | ASSERT_TRUE(str_const.is_stable()); |
| 101 | ASSERT_TRUE(str.c_str() != charArray); |
| 102 | ASSERT_TRUE(str.is_stable()); |
| 103 | cm::String substr = str.substr(1); |
| 104 | cm::String const& substr_const = substr; |
| 105 | ASSERT_TRUE(substr_const.data() != &charArray[1]); |
| 106 | ASSERT_TRUE(substr_const.size() == 2); |
| 107 | ASSERT_TRUE(!substr_const.is_stable()); |
| 108 | ASSERT_TRUE(substr.c_str() != &charArray[1]); |
| 109 | ASSERT_TRUE(!substr.is_stable()); |
| 110 | return true; |
| 111 | } |
| 112 | |
| 113 | static bool testConstructFromCharArray() |
| 114 | { |