Array methods for case conversion

This commit is contained in:
Pavel Kirienko
2015-03-20 23:37:42 +03:00
parent a6b5f753f1
commit 241ae8a538
2 changed files with 50 additions and 0 deletions
+18
View File
@@ -1278,3 +1278,21 @@ TEST(Array, FuzzyComparison)
uavcan::YamlStreamer<ArrayDynamic64>::stream(std::cout, array_d64, 0);
std::cout << std::endl;
}
TEST(Array, CaseConversion)
{
Array<IntegerSpec<8, SignednessUnsigned, CastModeTruncate>, ArrayModeDynamic, 30> str;
str.convertToLowerCaseASCII();
str.convertToUpperCaseASCII();
ASSERT_STREQ("", str.c_str());
str = "Hello World!";
ASSERT_STREQ("Hello World!", str.c_str());
str.convertToLowerCaseASCII();
ASSERT_STREQ("hello world!", str.c_str());
str.convertToUpperCaseASCII();
ASSERT_STREQ("HELLO WORLD!", str.c_str());
}