Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added Unit tests for the Colour struct.
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Thu, 21 Apr 2016 23:06:36 +0000 (00:06 +0100)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Thu, 21 Apr 2016 23:06:36 +0000 (00:06 +0100)
source/tests/xestiacalendar_commonfunctions.h

index ce4fc7c..e667aa6 100644 (file)
@@ -18,6 +18,7 @@
 
 #include "../common/file.h"
 #include "../common/text.h"
+#include "../common/colour.h"
 
 TEST(CommonFunctions, FileTests){
        
@@ -258,4 +259,38 @@ TEST(CommonFunctions, HexToInt){
        Result = HexToInt(&Value11, &OutputValue);
        ASSERT_EQ(Result, false);
 
+}
+
+TEST(CommonFunctions, ColourStruct){
+       
+       Colour Colour1;
+       Colour Colour2;
+       Colour Colour3;
+       Colour Colour4;
+       
+       Colour1.red = 0;
+       Colour1.green = 0;
+       Colour1.blue = 0;
+       Colour1.alpha = 0;
+
+       Colour2.red = 512;
+       Colour2.green = 512;
+       Colour2.blue = 512;
+       Colour2.alpha = 512;
+
+       Colour3.red = 16;
+       Colour3.green = 16;
+       Colour3.blue = 16;
+       Colour3.alpha = 16;
+
+       Colour4.red = 80;
+       Colour4.green = 80;
+       Colour4.blue = 80;
+       Colour4.alpha = 80;
+
+       ASSERT_EQ("#00000000", (string)Colour1);
+       ASSERT_EQ("#FFFFFFFF", (string)Colour2);
+       ASSERT_EQ("#10101010", (string)Colour3);
+       ASSERT_EQ("#50505050", (string)Colour4);
+       
 }
\ No newline at end of file
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