Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Updated/Added copyright header and licensing to all source files
[xestiacalendar/.git] / source / tests / xestiacalendar_commonfunctions.h
index d5c065d..90fd432 100644 (file)
@@ -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){
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy