Beispiel #1
0
TEST(MyString, Set) {
    MyString s;

    s.Set(kHelloString);
    EXPECT_EQ(0, strcmp(s.c_string(), kHelloString));

    s.Set(s.c_string());
    EXPECT_EQ(0, strcmp(s.c_string(), kHelloString));

    s.Set(NULL);
    EXPECT_STREQ(NULL, s.c_string());
}
Beispiel #2
0
TEST(MyString, DefaultConstructor) {
    const MyString s;

    EXPECT_STREQ(NULL, s.c_string());

    EXPECT_EQ(0u, s.Length());
}
Beispiel #3
0
TEST(MyString, CopyConstructor) {
    const MyString s1(kHelloString);
    const MyString s2 = s1;
    EXPECT_EQ(0, strcmp(s2.c_string(), kHelloString));
}