Improves
- check move really occurs in operator_assignment_move - get rid off dynamic memory allocation - refactor test naming
This commit is contained in:
@@ -148,7 +148,7 @@ TEST(PIString_Tests, construct_from_cstring){
|
|||||||
ASSERT_EQ(res, PIString(str1));
|
ASSERT_EQ(res, PIString(str1));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(PIString_Tests, construct_from_wchar_t){
|
TEST(PIString_Tests, construct_from_wchar_string){
|
||||||
wchar_t str1[] = L"gav";
|
wchar_t str1[] = L"gav";
|
||||||
PIString res = "gav";
|
PIString res = "gav";
|
||||||
ASSERT_EQ(res, PIString(str1));
|
ASSERT_EQ(res, PIString(str1));
|
||||||
@@ -161,8 +161,8 @@ TEST(PIString_Tests, construct_from_pibyte_array){
|
|||||||
ASSERT_EQ(res, PIString(str1));
|
ASSERT_EQ(res, PIString(str1));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(PIString_Tests, construct_from_pichar_size){
|
TEST(PIString_Tests, construct_from_pichar_array){
|
||||||
PIChar *str1 = new PIChar[3];
|
PIChar str1[3];
|
||||||
str1[0] = 'n';
|
str1[0] = 'n';
|
||||||
str1[1] = 'e';
|
str1[1] = 'e';
|
||||||
str1[2] = 'w';
|
str1[2] = 'w';
|
||||||
@@ -170,7 +170,7 @@ TEST(PIString_Tests, construct_from_pichar_size){
|
|||||||
ASSERT_EQ(res, PIString(str1, 3));
|
ASSERT_EQ(res, PIString(str1, 3));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(PIString_Tests, construct_from_cstring_size){
|
TEST(PIString_Tests, construct_from_char_array){
|
||||||
char str1[] = "good";
|
char str1[] = "good";
|
||||||
PIString res = "good";
|
PIString res = "good";
|
||||||
ASSERT_EQ(res, PIString(str1, 4));
|
ASSERT_EQ(res, PIString(str1, 4));
|
||||||
@@ -200,6 +200,7 @@ TEST(PIString_Tests, operator_assignment_move){
|
|||||||
PIString str;
|
PIString str;
|
||||||
str = move(str1);
|
str = move(str1);
|
||||||
ASSERT_EQ(PIString("testing"), str);
|
ASSERT_EQ(PIString("testing"), str);
|
||||||
|
ASSERT_TRUE(str1.isEmpty());
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(PIString_Tests, operator_symbol){
|
TEST(PIString_Tests, operator_symbol){
|
||||||
|
|||||||
Reference in New Issue
Block a user