コード例 #1
0
ファイル: sample2_test.cpp プロジェクト: liyustar/liblyx
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());
}
コード例 #2
0
ファイル: sample2_test.cpp プロジェクト: liyustar/liblyx
TEST(MyString, DefaultConstructor) {
    const MyString s;

    EXPECT_STREQ(NULL, s.c_string());

    EXPECT_EQ(0u, s.Length());
}
コード例 #3
0
ファイル: sample2_test.cpp プロジェクト: liyustar/liblyx
TEST(MyString, CopyConstructor) {
    const MyString s1(kHelloString);
    const MyString s2 = s1;
    EXPECT_EQ(0, strcmp(s2.c_string(), kHelloString));
}