X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Ftests%2Fxestiacalendar_commonfunctions.h;h=90fd432059ca442a3825d3431c6aa19b4b2892fc;hb=cba151c4b833a26c63984769f921bab5e755decd;hp=d5c065d089d468210ee11d7ba6e84873926f4576;hpb=27cc754cbf82331f76dd416e4e7d1e69adb90d8b;p=xestiacalendar%2F.git diff --git a/source/tests/xestiacalendar_commonfunctions.h b/source/tests/xestiacalendar_commonfunctions.h index d5c065d..90fd432 100644 --- a/source/tests/xestiacalendar_commonfunctions.h +++ b/source/tests/xestiacalendar_commonfunctions.h @@ -1,14 +1,14 @@ // xestiacalendar_commonfunctions.h - Xestia Calendar Common Functions Unit Tests // -// (c) 2016 Xestia Software Development. +// (c) 2016-2017 Xestia Software Development. // // This file is part of Xestia Calendar. // -// Xestia Address Book is free software: you can redistribute it and/or modify +// Xestia Calendar is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by the // Free Software Foundation, version 3 of the license. // -// Xestia Address Book is distributed in the hope that it will be useful, +// Xestia Calendar is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. @@ -326,7 +326,41 @@ TEST(CommonFunctions, ColourStruct){ ASSERT_EQ("#FFFFFFFF", (string)Colour2); ASSERT_EQ("#10101010", (string)Colour3); ASSERT_EQ("#50505050", (string)Colour4); - + + string ColourInput1 = "#204040FF"; + string ColourInput2 = "#408080FF"; + string ColourInput3 = "#A0A0A000"; + string ColourInput4 = "#FFFFFF20"; + + Colour Colour5; + Colour Colour6; + Colour Colour7; + Colour Colour8; + + Colour5 = ColourInput1; + Colour6 = ColourInput2; + Colour7 = ColourInput3; + Colour8 = ColourInput4; + + ASSERT_EQ(32, Colour5.red); + ASSERT_EQ(64, Colour5.green); + ASSERT_EQ(64, Colour5.blue); + ASSERT_EQ(255, Colour5.alpha); + + ASSERT_EQ(64, Colour6.red); + ASSERT_EQ(128, Colour6.green); + ASSERT_EQ(128, Colour6.blue); + ASSERT_EQ(255, Colour6.alpha); + + ASSERT_EQ(160, Colour7.red); + ASSERT_EQ(160, Colour7.green); + ASSERT_EQ(160, Colour7.blue); + ASSERT_EQ(0, Colour7.alpha); + + ASSERT_EQ(255, Colour8.red); + ASSERT_EQ(255, Colour8.green); + ASSERT_EQ(255, Colour8.blue); + ASSERT_EQ(32, Colour8.alpha); } TEST(CommonFunctions, OutputText){