add tab and delete space

This commit is contained in:
2021-03-01 14:39:29 +03:00
parent e9af135b02
commit 116d8e091a

View File

@@ -7,596 +7,596 @@ using namespace std;
template <typename T>
bool is_equal(T x, T y) {
return std::fabs(x - y) < std::numeric_limits<T>::epsilon();
return std::fabs(x - y) < std::numeric_limits<T>::epsilon();
}
TEST(PIString_Tests, constructor_empty){
PIString str1;
ASSERT_TRUE(str1.isEmpty());
PIString str1;
ASSERT_TRUE(str1.isEmpty());
}
TEST(PIString_Tests, operator_concatenation_pichar){
PIString str1 = "AB C";
const PIChar str2 = " ";
str1 += str2;
PIString res = "AB C ";
ASSERT_EQ(str1, res);
PIString str1 = "AB C";
const PIChar str2 = " ";
str1 += str2;
PIString res = "AB C ";
ASSERT_EQ(str1, res);
}
TEST(PIString_Tests, operator_concatenation_pichar_zero1){
PIString str1 = "";
const PIChar str2 = "D";
str1 += str2;
ASSERT_EQ(str1, "D");
PIString str1 = "";
const PIChar str2 = "D";
str1 += str2;
ASSERT_EQ(str1, "D");
}
TEST(PIString_Tests, operator_concatenation_cstring){
PIString str1 = "AB C";
const char *str2 = "D D ";
str1 += str2;
ASSERT_EQ(str1, "AB CD D ");
PIString str1 = "AB C";
const char *str2 = "D D ";
str1 += str2;
ASSERT_EQ(str1, "AB CD D ");
}
TEST(PIString_Tests, operator_concatenation_cstring_zero1){
PIString str1 = "";
const char *str2 = "D D ";
str1 += str2;
ASSERT_EQ(str1, "D D ");
PIString str1 = "";
const char *str2 = "D D ";
str1 += str2;
ASSERT_EQ(str1, "D D ");
}
TEST(PIString_Tests, operator_concatenation_wchar){
PIString str1= "AB C";
wchar_t str2[] = L"C";
str1 += str2;
ASSERT_EQ(str1, "AB CC");
PIString str1= "AB C";
wchar_t str2[] = L"C";
str1 += str2;
ASSERT_EQ(str1, "AB CC");
}
TEST(PIString_Tests, operator_concatenation_wchar_zero1){
PIString str1 = "";
wchar_t str2[] = L"C";
str1 += str2;
ASSERT_EQ(str1, "C");
PIString str1 = "";
wchar_t str2[] = L"C";
str1 += str2;
ASSERT_EQ(str1, "C");
}
TEST(PIString_Tests, operator_concatenation_pistring){
PIString str1 = "AB C";
PIString str2 = " CD ";
str1 += str2;
ASSERT_EQ(str1, "AB C CD ");
PIString str1 = "AB C";
PIString str2 = " CD ";
str1 += str2;
ASSERT_EQ(str1, "AB C CD ");
}
TEST(PIString_Tests, operator_concatenation_pistring_zero1){
PIString str1 = "";
PIString str2 = "D DD";
str1 += str2;
ASSERT_EQ(str1, "D DD");
PIString str1 = "";
PIString str2 = "D DD";
str1 += str2;
ASSERT_EQ(str1, "D DD");
}
TEST(PIString_Tests, operator_concatenation_pistring_zero2){
PIString str1 = "AB C";
PIString str2 = "";
str1 += str2;
ASSERT_EQ(str1, "AB C");
PIString str1 = "AB C";
PIString str2 = "";
str1 += str2;
ASSERT_EQ(str1, "AB C");
}
TEST(PIString_Tests, operator_concatenation_pistring_zero_zero){
PIString str1;
PIString str2;
str1 += str2;
ASSERT_EQ(str1, "");
PIString str1;
PIString str2;
str1 += str2;
ASSERT_EQ(str1, "");
}
TEST(PIString_Tests, operator_concatenation_piByteArray){
PIString str1 = "AB C";
PIByteArray str2;
str2.append('g');
str1 += str2;
ASSERT_EQ(str1, "AB Cg");
PIString str1 = "AB C";
PIByteArray str2;
str2.append('g');
str1 += str2;
ASSERT_EQ(str1, "AB Cg");
}
TEST(PIString_Tests, operator_concatenation_piByteArray_zero1){
PIString str1 = "";
PIByteArray str2;
str2.append('0');
str1 += str2;
ASSERT_EQ(str1, "0");
PIString str1 = "";
PIByteArray str2;
str2.append('0');
str1 += str2;
ASSERT_EQ(str1, "0");
}
TEST(PIString_Tests, operator_concatenation_piByteArray_zero2){
PIString str1 = "AB C";
PIByteArray str2;
str1 += str2;
ASSERT_EQ(str1, "AB C");
PIString str1 = "AB C";
PIByteArray str2;
str1 += str2;
ASSERT_EQ(str1, "AB C");
}
TEST(PIString_Tests, operator_concatenation_piByteArray_zero_zero){
PIString str1;
PIByteArray str2;
str1 += str2;
ASSERT_EQ(str1, "");
PIString str1;
PIByteArray str2;
str1 += str2;
ASSERT_EQ(str1, "");
}
TEST(PIString_Tests, construct_pistring){
PIString str1 = "New";
PIString str(str1);
ASSERT_EQ(str1, str);
PIString str1 = "New";
PIString str(str1);
ASSERT_EQ(str1, str);
}
TEST(PIString_Tests, construct_pistring_move){
PIString str1 = "New";
PIString res = str1;
PIString str(move(str1));
ASSERT_EQ(res, str);
PIString str1 = "New";
PIString res = str1;
PIString str(move(str1));
ASSERT_EQ(res, str);
}
TEST(PIString_Tests, construct_from_pichar){
PIChar str1 = 'n';
PIString res = "n";
ASSERT_EQ(res, PIString(str1));
PIChar str1 = 'n';
PIString res = "n";
ASSERT_EQ(res, PIString(str1));
}
TEST(PIString_Tests, construct_from_char){
char str1 = 'n';
PIString res = "n";
ASSERT_EQ(res, PIString(str1));
char str1 = 'n';
PIString res = "n";
ASSERT_EQ(res, PIString(str1));
}
TEST(PIString_Tests, construct_from_cstring){
char str1[] = "mew";
PIString res = "mew";
ASSERT_EQ(res, PIString(str1));
char str1[] = "mew";
PIString res = "mew";
ASSERT_EQ(res, PIString(str1));
}
TEST(PIString_Tests, construct_from_wchar_string){
wchar_t str1[] = L"gav";
PIString res = "gav";
ASSERT_EQ(res, PIString(str1));
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));
PIByteArray str1;
str1.append('m');
PIString res = "m";
ASSERT_EQ(res, PIString(str1));
}
TEST(PIString_Tests, construct_from_pichar_array){
PIChar str1[3];
str1[0] = 'n';
str1[1] = 'e';
str1[2] = 'w';
PIString res = "new";
ASSERT_EQ(res, PIString(str1, 3));
PIChar str1[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_array){
char str1[] = "good";
PIString res = "good";
ASSERT_EQ(res, PIString(str1, 4));
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));
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));
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);
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);
ASSERT_TRUE(str1.isEmpty());
PIString str1 = "testing";
PIString str;
str = move(str1);
ASSERT_EQ(PIString("testing"), str);
ASSERT_TRUE(str1.isEmpty());
}
TEST(PIString_Tests, operator_symbol){
PIString str1 = "testing";
PIChar symbo = "i";
ASSERT_EQ(symbo, str1[4]);
PIString str1 = "testing";
PIChar symbo = "i";
ASSERT_EQ(symbo, str1[4]);
}
TEST(PIString_Tests, operator_equal_pistring_true){
PIString str1 = "testing";
PIString str2 = "testing";
ASSERT_TRUE(str1 == str2);
PIString str1 = "testing";
PIString str2 = "testing";
ASSERT_TRUE(str1 == str2);
}
TEST(PIString_Tests, operator_equal_pistring_false){
PIString str1 = "tes";
PIString str2 = "testing";
ASSERT_FALSE(str1 == str2);
PIString str1 = "tes";
PIString str2 = "testing";
ASSERT_FALSE(str1 == str2);
}
TEST(PIString_Tests, operator_equal_pichar_true){
PIString str1 = "t";
PIChar str2 = "t";
ASSERT_TRUE(str1 == str2);
PIString str1 = "t";
PIChar str2 = "t";
ASSERT_TRUE(str1 == str2);
}
TEST(PIString_Tests, operator_equal_pichar_false){
PIString str1 = "t";
PIChar str2 = "p";
ASSERT_FALSE(str1 == str2);
PIString str1 = "t";
PIChar str2 = "p";
ASSERT_FALSE(str1 == str2);
}
TEST(PIString_Tests, operator_equal_cstring_true){
PIString str1 = "test";
char str2[] = "test";
ASSERT_TRUE(str1 == str2);
PIString str1 = "test";
char str2[] = "test";
ASSERT_TRUE(str1 == str2);
}
TEST(PIString_Tests, operator_equal_cstring_false){
PIString str1 = "t";
char str2[] = "test";
ASSERT_FALSE(str1 == str2);
PIString str1 = "t";
char str2[] = "test";
ASSERT_FALSE(str1 == str2);
}
TEST(PIString_Tests, operator_not_equal_pistring_false){
PIString str1 = "testing";
PIString str2 = "testing";
ASSERT_FALSE(str1 != str2);
PIString str1 = "testing";
PIString str2 = "testing";
ASSERT_FALSE(str1 != str2);
}
TEST(PIString_Tests, operator_not_equal_pistring_true){
PIString str1 = "tes";
PIString str2 = "testing";
ASSERT_TRUE(str1 != str2);
PIString str1 = "tes";
PIString str2 = "testing";
ASSERT_TRUE(str1 != str2);
}
TEST(PIString_Tests, operator_not_equal_pichar_false){
PIString str1 = "t";
PIChar str2 = "t";
ASSERT_FALSE(str1 != str2);
PIString str1 = "t";
PIChar str2 = "t";
ASSERT_FALSE(str1 != str2);
}
TEST(PIString_Tests, operator_not_equal_pichar_true){
PIString str1 = "t";
PIChar str2 = "p";
ASSERT_TRUE(str1 != str2);
PIString str1 = "t";
PIChar str2 = "p";
ASSERT_TRUE(str1 != str2);
}
TEST(PIString_Tests, operator_not_equal_cstring_false){
PIString str1 = "test";
char str2[] = "test";
ASSERT_FALSE(str1 != str2);
PIString str1 = "test";
char str2[] = "test";
ASSERT_FALSE(str1 != str2);
}
TEST(PIString_Tests, operator_not_equal_cstring_true){
PIString str1 = "t";
char str2[] = "test";
ASSERT_TRUE(str1 != str2);
PIString str1 = "t";
char str2[] = "test";
ASSERT_TRUE(str1 != str2);
}
TEST(PIString_Tests, operator_less_pistring_true){
PIString str1 = "testin";
PIString str2 = "testing";
ASSERT_TRUE(str1 < str2);
PIString str1 = "testin";
PIString str2 = "testing";
ASSERT_TRUE(str1 < str2);
}
TEST(PIString_Tests, operator_less_pistring_false){
PIString str1 = "testing";
PIString str2 = "testin";
ASSERT_FALSE(str1 < str2);
PIString str1 = "testing";
PIString str2 = "testin";
ASSERT_FALSE(str1 < str2);
}
TEST(PIString_Tests, operator_less_pistring_false_equal){
PIString str1 = "testing";
PIString str2 = "testing";
ASSERT_FALSE(str1 < str2);
PIString str1 = "testing";
PIString str2 = "testing";
ASSERT_FALSE(str1 < str2);
}
TEST(PIString_Tests, operator_less_pichar_true){
PIString str1 = "a";
PIChar str2 = "t";
ASSERT_TRUE(str1 < str2);
PIString str1 = "a";
PIChar str2 = "t";
ASSERT_TRUE(str1 < str2);
}
TEST(PIString_Tests, operator_less_pichar_false){
PIString str1 = "t";
PIChar str2 = "a";
ASSERT_FALSE(str1 < str2);
PIString str1 = "t";
PIChar str2 = "a";
ASSERT_FALSE(str1 < str2);
}
TEST(PIString_Tests, operator_less_pichar_false_equal){
PIString str1 = "t";
PIChar str2 = "t";
ASSERT_FALSE(str1 < str2);
PIString str1 = "t";
PIChar str2 = "t";
ASSERT_FALSE(str1 < str2);
}
TEST(PIString_Tests, operator_less_cstring_true){
PIString str1 = "a";
char str2[] = "t";
ASSERT_TRUE(str1 < str2);
PIString str1 = "a";
char str2[] = "t";
ASSERT_TRUE(str1 < str2);
}
TEST(PIString_Tests, operator_less_cstring_false){
PIString str1 = "t";
char str2[] = "a";
ASSERT_FALSE(str1 < str2);
PIString str1 = "t";
char str2[] = "a";
ASSERT_FALSE(str1 < str2);
}
TEST(PIString_Tests, operator_less_cstring_false_equal){
PIString str1 = "t";
char str2[] = "t";
ASSERT_FALSE(str1 < str2);
PIString str1 = "t";
char str2[] = "t";
ASSERT_FALSE(str1 < str2);
}
TEST(PIString_Tests, operator_grater_pistring_true){
PIString str1 = "testin";
PIString str2 = "testing";
ASSERT_TRUE(str2 > str1);
PIString str1 = "testin";
PIString str2 = "testing";
ASSERT_TRUE(str2 > str1);
}
TEST(PIString_Tests, operator_grater_pistring_false){
PIString str1 = "testing";
PIString str2 = "testin";
ASSERT_FALSE(str2 > str1);
PIString str1 = "testing";
PIString str2 = "testin";
ASSERT_FALSE(str2 > str1);
}
TEST(PIString_Tests, operator_grater_pistring_false_equal){
PIString str1 = "testing";
PIString str2 = "testing";
ASSERT_FALSE(str1 > str2);
PIString str1 = "testing";
PIString str2 = "testing";
ASSERT_FALSE(str1 > str2);
}
TEST(PIString_Tests, operator_grater_pichar_true){
PIString str1 = "t";
PIChar str2 = "a";
ASSERT_TRUE(str1 > str2);
PIString str1 = "t";
PIChar str2 = "a";
ASSERT_TRUE(str1 > str2);
}
TEST(PIString_Tests, operator_grater_pichar_false){
PIString str1 = "a";
PIChar str2 = "t";
ASSERT_FALSE(str1 > str2);
PIString str1 = "a";
PIChar str2 = "t";
ASSERT_FALSE(str1 > str2);
}
TEST(PIString_Tests, operator_grater_pichar_false_equal){
PIString str1 = "t";
PIChar str2 = "t";
ASSERT_FALSE(str1 > str2);
PIString str1 = "t";
PIChar str2 = "t";
ASSERT_FALSE(str1 > str2);
}
TEST(PIString_Tests, operator_grater_cstring_true){
PIString str1 = "t";
char str2[] = "a";
ASSERT_TRUE(str1 > str2);
PIString str1 = "t";
char str2[] = "a";
ASSERT_TRUE(str1 > str2);
}
TEST(PIString_Tests, operator_grater_cstring_false){
PIString str1 = "a";
char str2[] = "t";
ASSERT_FALSE(str1 > str2);
PIString str1 = "a";
char str2[] = "t";
ASSERT_FALSE(str1 > str2);
}
TEST(PIString_Tests, operator_grater_cstring_false_equal){
PIString str1 = "t";
char str2[] = "t";
ASSERT_FALSE(str1 > str2);
PIString str1 = "t";
char str2[] = "t";
ASSERT_FALSE(str1 > str2);
}
TEST(PIString_Tests, operator_less_eq_pistring_true_less){
PIString str1 = "testin";
PIString str2 = "testing";
ASSERT_TRUE(str1 <= str2);
PIString str1 = "testin";
PIString str2 = "testing";
ASSERT_TRUE(str1 <= str2);
}
TEST(PIString_Tests, operator_less_eq_pistring_false){
PIString str1 = "testing";
PIString str2 = "testin";
ASSERT_FALSE(str1 <= str2);
PIString str1 = "testing";
PIString str2 = "testin";
ASSERT_FALSE(str1 <= str2);
}
TEST(PIString_Tests, operator_less_eq_pistring_true_equal){
PIString str1 = "testing";
PIString str2 = "testing";
ASSERT_TRUE(str1 <= str2);
PIString str1 = "testing";
PIString str2 = "testing";
ASSERT_TRUE(str1 <= str2);
}
TEST(PIString_Tests, operator_less_eq_pichar_true){
PIString str1 = "a";
PIChar str2 = "t";
ASSERT_TRUE(str1 <= str2);
PIString str1 = "a";
PIChar str2 = "t";
ASSERT_TRUE(str1 <= str2);
}
TEST(PIString_Tests, operator_less_eq_pichar_false){
PIString str1 = "t";
PIChar str2 = "a";
ASSERT_FALSE(str1 <= str2);
PIString str1 = "t";
PIChar str2 = "a";
ASSERT_FALSE(str1 <= str2);
}
TEST(PIString_Tests, operator_less_eq_pichar_true_equal){
PIString str1 = "t";
PIChar str2 = "t";
ASSERT_TRUE(str1 <= str2);
PIString str1 = "t";
PIChar str2 = "t";
ASSERT_TRUE(str1 <= str2);
}
TEST(PIString_Tests, operator_less_eq_cstring_true){
PIString str1 = "a";
char str2[] = "t";
ASSERT_TRUE(str1 <= str2);
PIString str1 = "a";
char str2[] = "t";
ASSERT_TRUE(str1 <= str2);
}
TEST(PIString_Tests, operator_less_eq_cstring_false){
PIString str1 = "t";
char str2[] = "a";
ASSERT_FALSE(str1 <= str2);
PIString str1 = "t";
char str2[] = "a";
ASSERT_FALSE(str1 <= str2);
}
TEST(PIString_Tests, operator_less_eq_cstring_true_equal){
PIString str1 = "t";
char str2[] = "t";
ASSERT_TRUE(str1 <= str2);
PIString str1 = "t";
char str2[] = "t";
ASSERT_TRUE(str1 <= str2);
}
TEST(PIString_Tests, operator_grater_eq_pistring_true){
PIString str1 = "testin";
PIString str2 = "testing";
ASSERT_TRUE(str2 >= str1);
PIString str1 = "testin";
PIString str2 = "testing";
ASSERT_TRUE(str2 >= str1);
}
TEST(PIString_Tests, operator_grater_eq_pistring_false){
PIString str1 = "testing";
PIString str2 = "testin";
ASSERT_FALSE(str2 >= str1);
PIString str1 = "testing";
PIString str2 = "testin";
ASSERT_FALSE(str2 >= str1);
}
TEST(PIString_Tests, operator_grater_eq_pistring_true_equal){
PIString str1 = "testing";
PIString str2 = "testing";
ASSERT_TRUE(str1 >= str2);
PIString str1 = "testing";
PIString str2 = "testing";
ASSERT_TRUE(str1 >= str2);
}
TEST(PIString_Tests, operator_grater_eq_pichar_true){
PIString str1 = "t";
PIChar str2 = "a";
ASSERT_TRUE(str1 >= str2);
PIString str1 = "t";
PIChar str2 = "a";
ASSERT_TRUE(str1 >= str2);
}
TEST(PIString_Tests, operator_grater_eq_pichar_false){
PIString str1 = "a";
PIChar str2 = "t";
ASSERT_FALSE(str1 >= str2);
PIString str1 = "a";
PIChar str2 = "t";
ASSERT_FALSE(str1 >= str2);
}
TEST(PIString_Tests, operator_grater_eq_pichar_true_equal){
PIString str1 = "t";
PIChar str2 = "t";
ASSERT_TRUE(str1 >= str2);
PIString str1 = "t";
PIChar str2 = "t";
ASSERT_TRUE(str1 >= str2);
}
TEST(PIString_Tests, operator_grater_eq_cstring_true){
PIString str1 = "t";
char str2[] = "a";
ASSERT_TRUE(str1 >= str2);
PIString str1 = "t";
char str2[] = "a";
ASSERT_TRUE(str1 >= str2);
}
TEST(PIString_Tests, operator_grater_eq_cstring_false){
PIString str1 = "a";
char str2[] = "t";
ASSERT_FALSE(str1 >= str2);
PIString str1 = "a";
char str2[] = "t";
ASSERT_FALSE(str1 >= str2);
}
TEST(PIString_Tests, operator_grater_eq_cstring_true_equal){
PIString str1 = "t";
char str2[] = "t";
ASSERT_TRUE(str1 >= str2);
PIString str1 = "t";
char str2[] = "t";
ASSERT_TRUE(str1 >= str2);
}
TEST(PIString_Tests, operator_shift_pistring){
PIString str1 = "shift";
PIString str2 = " good";
str1 << str2;
PIString res = "shift good";
ASSERT_EQ(res, str1);
PIString str1 = "shift";
PIString str2 = " good";
str1 << str2;
PIString res = "shift good";
ASSERT_EQ(res, str1);
}
TEST(PIString_Tests, operator_shift_pichar){
PIString str1 = "shif";
PIChar str2 = 't';
str1 << str2;
PIString res = "shift";
ASSERT_EQ(res, str1);
PIString str1 = "shif";
PIChar str2 = 't';
str1 << str2;
PIString res = "shift";
ASSERT_EQ(res, str1);
}
TEST(PIString_Tests, operator_shift_cstring){
PIString str1 = "shif";
char str2[] = "t chat";
str1 << str2;
PIString res = "shift chat";
ASSERT_EQ(res, str1);
PIString str1 = "shif";
char str2[] = "t chat";
str1 << str2;
PIString res = "shift chat";
ASSERT_EQ(res, str1);
}
TEST(PIString_Tests, operator_shift_wchar_t){
PIString str1 = "shif";
wchar_t str2[] = L"t cc";
str1 << str2;
PIString res = "shift cc";
ASSERT_EQ(res, str1);
PIString str1 = "shif";
wchar_t str2[] = L"t cc";
str1 << str2;
PIString res = "shift cc";
ASSERT_EQ(res, str1);
}
TEST(PIString_Tests, operator_shift_int){
PIString str1 = "shift ";
int numb = -2147483648;
str1 << numb;
PIString res = "shift -2147483648";
ASSERT_EQ(res, str1);
PIString str1 = "shift ";
int numb = -2147483648;
str1 << numb;
PIString res = "shift -2147483648";
ASSERT_EQ(res, str1);
}
TEST(PIString_Tests, operator_shift_uint){
PIString str1 = "shift ";
uint numb = 4294967295;
str1 << numb;
PIString res = "shift 4294967295";
ASSERT_EQ(res, str1);
PIString str1 = "shift ";
uint numb = 4294967295;
str1 << numb;
PIString res = "shift 4294967295";
ASSERT_EQ(res, str1);
}
TEST(PIString_Tests, operator_shift_short){
PIString str1 = "shift ";
short numb = -32768;
str1 << numb;
PIString res = "shift -32768";
ASSERT_EQ(res, str1);
PIString str1 = "shift ";
short numb = -32768;
str1 << numb;
PIString res = "shift -32768";
ASSERT_EQ(res, str1);
}
TEST(PIString_Tests, operator_shift_ushort){
PIString str1 = "shift ";
ushort numb = 65535;
str1 << numb;
PIString res = "shift 65535";
ASSERT_EQ(res, str1);
PIString str1 = "shift ";
ushort numb = 65535;
str1 << numb;
PIString res = "shift 65535";
ASSERT_EQ(res, str1);
}
TEST(PIString_Tests, operator_shift_long){
PIString str1 = "shift ";
long numb = -2147483648;
str1 << numb;
PIString res = "shift -2147483648";
ASSERT_EQ(res, str1);
PIString str1 = "shift ";
long numb = -2147483648;
str1 << numb;
PIString res = "shift -2147483648";
ASSERT_EQ(res, str1);
}
TEST(PIString_Tests, operator_shift_ulong){
PIString str1 = "shift ";
ulong numb = 4294967295;
str1 << numb;
PIString res = "shift 4294967295";
ASSERT_EQ(res, str1);
PIString str1 = "shift ";
ulong numb = 4294967295;
str1 << numb;
PIString res = "shift 4294967295";
ASSERT_EQ(res, str1);
}
TEST(PIString_Tests, operator_shift_llong){
PIString str1 = "shift ";
llong numb = -9223372036854775807;
str1 << numb;
PIString res = "shift -9223372036854775807";
ASSERT_EQ(res, str1);
PIString str1 = "shift ";
llong numb = -9223372036854775807;
str1 << numb;
PIString res = "shift -9223372036854775807";
ASSERT_EQ(res, str1);
}
TEST(PIString_Tests, operator_shift_ullong){
PIString str1 = "shift ";
ullong numb = 1844674407370955161;
str1 << numb;
PIString res = "shift 1844674407370955161";
ASSERT_EQ(res, str1);
PIString str1 = "shift ";
ullong numb = 1844674407370955161;
str1 << numb;
PIString res = "shift 1844674407370955161";
ASSERT_EQ(res, str1);
}
TEST(PIString_Tests, operator_shift_float){
PIString str1 = "shift ";
float numb = -67.88999939f;
str1 << numb;
PIString res = "shift -67.88999939";
ASSERT_EQ(res, str1);
PIString str1 = "shift ";
float numb = -67.88999939f;
str1 << numb;
PIString res = "shift -67.88999939";
ASSERT_EQ(res, str1);
}