diff --git a/services/backup/test/ToolsTest.cpp b/services/backup/test/ToolsTest.cpp new file mode 100644 --- /dev/null +++ b/services/backup/test/ToolsTest.cpp @@ -0,0 +1,86 @@ +#include "Tools.h" +#include + +#include + +#include +#include +#include +#include + +using namespace comm::network::tools; + +class ToolsTest : public testing::Test { +protected: + virtual void SetUp() { + } + virtual void TearDown() { + } +}; + +int expectedLength = 50; + +std::vector examples = { + "𒀱ʪ৺i𒁭fc𒀗𒀱v𒀱˨d𒃆zͲh࣍𒁭𒀕𒀠ˀ˲bࢵʒew0ङ৾ύɈ̂nഫ𒀍̶𒃘ȴ𒁞ȾȐϱ𒂊xι0" + "1" + "ॻ", + "Ɉ𒁄Θː࣫ɸɊ𒃚ૂchೞ𒀰ͤহুࣣ𒂍𒃨𒃝ࢂீwq𒀮2𒀧ࣙʘȨ𒂒ʔబoଵણ𒀒kమ𒂓χj𒃡z𒁤i𒁋Σ" + "੨" + "𒁈", + "zृp𒁱ʼ̾ΣથhȾ𒂼𒃘𒁏ঽbwࣛ𒂽𒀏Ϸz𒁂𒂎2Ȩis𒂁𒂃𒁞𒀷ˠɖओ̚˘01yૼcಕlpࡥ̈ϑ𒃏" + "ˬ" + "˜", + "Ɍଢyফi𒁝͐ॿˢ࢑𒀹ͦv͞𒂼ʞɪ࡞ா𒀛k𒁂𒀦r𒀹ЃͶூϣȸ𒁦Ȍ𒁗𒂕𒂷ʞzࡂ৾mʜʺॉnk̜𒁴ࣇ" + "q" + "e", + "ɨɐയ𒂂nঢ়˦ࡺૡyiuwঊx𒁑ˆ௬ȖfdsapϡશેȜc𒀠𒂍࣫𒁗𒀛ࡎȚc𒃖ɴb𒁞Χ˜॓wࡴgs" + "q" + "ఇ", + "𒀸𒀟uέkେ𒁆𒃋ࢥ𒁃𒀋ࡼಡlͦ𒁔rͤਓˎɘ𒀱͐iɲ𒂽rr𒃈uࡐ𒁨ॷೡ𒂁ଵˢ3୫e0𒁻p𒂄r̜Ϗ𒀠" + "૯" + "˰", + "𒃃ɞ͂𒂍̪ষjಝࡘ𒁢b𒀐𒀜𒂓𒃃o˨ࡒ𒃗̤Ѕ𒂿𒀺ஸd𒃍𒁫zȤക𒀠bऽϏʸ𒁦𒁵iࡆ𒁄𒀑ϡ॥ɾ𒂂ࢱȌΊ" + "e" + "𒀦", + "rऩ𒃂𒀮𒀁𒃀हம𒀝γ𒀟0𒁛𒂪l͢1ૌ3𒃂𒂸ঢ়তwdɄ𒁨̮͈͊m௶𒀹৮𒂖Ϋa𒀠𒁴ࣻetഉ𒂍𒁥̶͘p˚͔", + "𒂍𒀦jࡰ𒂣ˮ𒂇o𒁎vek୭˺sʄufϑʠ𒁯y𒃦ూΧ০t̜w1࢙𒁝latε࢑ʐЃϥీ𒁋ͦ𒁹𒀚𒃛𒁊̼" + "అ" + "̴", + "ࣣൈssࡴ൝ˊ𒀦ɾౠଦদl૧jy2ૼ𒂔𒂂𒁫xॻ͖d𒀻𒃬ʬʒeg𒂚q𒂚𒀄𒀝ࡒప𒀍Ͻe𒂗2ಹ𒀹ˤ૾x" + "b" + "𒂾", + "ʚajరࡀ3ʢm𒁹̲˸మge𒀉fफ𒀨࣋tcj̤𒀓৸˪yuస𒀘ɜϽxЁఋ𒁖ɦഃou𒂴ࣥ̎ϩಣʢআೈ" + "𒀂" + "𒂝", + "̤ధ𒂵𒃄ϥvg𒂺𒃀𒃋f𒃩ುpdɜ𒃛𒀺ࢫള𒀦x୵rλv𒁒3௺1tkॣ̦nx𒃀͞ɤ͖𒃭𒀮rఓൕʘȾm" + "𒂗" + "௶", + ";dङ𒁅ɤu3ఋ𒂠𒃦ϑˢ̾d̖𒀃t𒀮3Ƞ𒁜ȼࡐ1఼b𒃫̀iˢি̬0𒀏ϑ0𒂸ʴ੨𒃮2͢ల୧ࢌ𒁳೩q" + "𒀫" + "ϙ", + "ȸϟ𒁋vq𒀣tਧࡸʔ𒃃𒁿𒂝୩𒁳zjnఐ1࣏𒃡ୟϳbɦઍm𒁆ˠϻirp𒂎n̈൙ফυ𒀭𒃓˖ಅঽࡂȖz" + "ஜ" + "𒂰", + "2huʞଖ𒀭ɘ𒁊Ⱦwൡʨbࣵ𒀍sn𒂀ɞb𒃑en𒁪ૂɦ఼͂qఉ𒀚pc𒀽lঞyk𒁮𒃪gɼΒχ3𒂓𒁂𒁸" + "𒀑" + "ૣ", + "uȪλೡऍ0ࢎˈুw𒁹૩𒁳dࡩ;𒂞3𒃊mΒy𒀟ɂluzࢽ𒁌ॏn𒁦𒁮𒃔ʮ௺𒃁അി𒂲఼হx𒃥Ȫ𒁩ঐ˪" + "o" + "̺", + "𒃫̪૩eु𒀻r૫अ𒂞डક𒁁ਂɄl𒃖𒀠ೖ𒂗ॅɪo𒀇ఐ९Θ𒀐ࣟਰ௸𒀽ηਉ1𒀳ਬ̔ʬ𒀗ਪ𒀑ω̘͚o𒃛w" + "𒁖" + "ॅ", + "𒀱Ͽ𒀤𒂈aി𒂯̄𒁵we𒃟ɂΩΩϱm𒃜ഭ𒀯oʚʦ𒃘2𒃭ണι̘ࡂsιʄਉɎচ𒀫𒁓𒀕ॿ𒂎j𒂾̘2𒁥𒀈एु" + "ࢷ", + "ࣇϑ0𒁵ଵtxoxϏ𒂉ʄ𒂙ϓoϳ𒃮tਥʪʂwൟਲ਼ˢϫ𒀲˔ফ˘eঔ𒀩Β𒃡k𒁭ਪୱଐ𒃫̊𒂶ৠ𒀧𒀑ഥਓ" + "z" + "೩", + "Ξ𒃚m𒃃ʐध𒂊𒃔𒃨ଊͪഭȒc̺ϳऋpc𒂄ɆΈȎ𒀱𒀧୭ʤ𒁣υʾઅϳ1uȎvίॕϧ𒀴𒀹ङoz𒀑𒁟aఙ𒂱ಛ", + +}; + +TEST_F(ToolsTest, TestOperationsOnTools) { + for (auto example : examples) { + EXPECT_EQ(expectedLength, getUtf8Length(example)); + } +}