Tests for PIString 21-30
This commit is contained in:
@@ -147,3 +147,69 @@ TEST(PIString_Tests, construct_from_cstring){
|
|||||||
PIString res = "mew";
|
PIString res = "mew";
|
||||||
ASSERT_EQ(res, PIString(str1));
|
ASSERT_EQ(res, PIString(str1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST(PIString_Tests, construct_from_wchar_t){
|
||||||
|
wchar_t str1[] = L"gav";
|
||||||
|
PIString res = "gav";
|
||||||
|
ASSERT_EQ(res, PIString(str1));
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(PIString_Tests, construct_from_pibyte_array){
|
||||||
|
PIByteArray str1;
|
||||||
|
str1.append('m');
|
||||||
|
PIString res = "m";
|
||||||
|
ASSERT_EQ(res, PIString(str1));
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(PIString_Tests, construct_from_pichar_size){
|
||||||
|
PIChar *str1 = new PIChar[3];
|
||||||
|
str1[0] = 'n';
|
||||||
|
str1[1] = 'e';
|
||||||
|
str1[2] = 'w';
|
||||||
|
PIString res = "new";
|
||||||
|
ASSERT_EQ(res, PIString(str1, 3));
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(PIString_Tests, construct_from_char_size){
|
||||||
|
char str1[] = "good";
|
||||||
|
PIString res = "good";
|
||||||
|
ASSERT_EQ(res, PIString(str1, 4));
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(PIString_Tests, construct_from_char_len){
|
||||||
|
char str1 = 'n';
|
||||||
|
PIString res = "nnn";
|
||||||
|
ASSERT_EQ(res, PIString(3, str1));
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(PIString_Tests, construct_from_pichar_len){
|
||||||
|
PIChar str1 = 'n';
|
||||||
|
PIString res = "nnnnn";
|
||||||
|
ASSERT_EQ(res, PIString(5, str1));
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(PIString_Tests, operator_assignment){
|
||||||
|
PIString str1 = "testing";
|
||||||
|
PIString str;
|
||||||
|
str = str1;
|
||||||
|
ASSERT_EQ(PIString("testing"), str);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(PIString_Tests, operator_assignment_move){
|
||||||
|
PIString str1 = "testing";
|
||||||
|
PIString str;
|
||||||
|
str = move(str1);
|
||||||
|
ASSERT_EQ(PIString("testing"), str);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(PIString_Tests, operator_symbol){
|
||||||
|
PIString str1 = "testing";
|
||||||
|
PIChar symbo = "i";
|
||||||
|
ASSERT_EQ(symbo, str1[4]);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(PIString_Tests, operator_compare_pistring_true){
|
||||||
|
PIString str1 = "testing";
|
||||||
|
PIString str2 = "testing";
|
||||||
|
ASSERT_TRUE(str1 == str2);
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user