24 TEST(StringTest, EmptyString)
28 EXPECT_EQ(len, s.length());
29 EXPECT_EQ(len, s.alloced_length());
33 TEST(StringTest, ShrinkString)
36 char foo[len]= {
'a',
'b', 0};
37 String foos(foo, len, &my_charset_bin);
39 EXPECT_EQ(len, foos.length());
40 EXPECT_STREQ(
"ab", foo);
44 TEST(StringDeathTest, AppendEmptyString)
46 ::testing::FLAGS_gtest_death_test_style =
"threadsafe";
48 const char db_name[]=
"aaaaaaa";
50 tbl_name.append(
String(db_name, system_charset_info));
52 tbl_name.append(
String(table_name, system_charset_info));
55 EXPECT_DEATH_IF_SUPPORTED(tbl_name.c_ptr(),
".*Alloced_length >= .*");
57 EXPECT_STREQ(
"aaaaaaa.", tbl_name.c_ptr_safe());