Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Updated ColourStruct unit tests
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sun, 25 Dec 2016 01:29:49 +0000 (01:29 +0000)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sun, 25 Dec 2016 01:29:49 +0000 (01:29 +0000)
source/tests/xestiacalendar_commonfunctions.h

index d5c065d..d8cace2 100644 (file)
@@ -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