[riot-notifications] [RIOT-OS/RIOT] tests/unittests: test black corner case for color_rgb2hsv() (#9940)

Martine Lenders notifications at github.com
Tue Mar 26 10:45:57 CET 2019


miri64 commented on this pull request.



> @@ -73,6 +73,18 @@ static void test_rgb2hex__success(void)
     TEST_ASSERT_EQUAL_INT(0x000AB13C, hex);
 }
 
+static void test_rgb2hsv__black(void)
+{
+    color_hsv_t hsv;
+    color_rgb_t rgb = { .r = 0x00, .g = 0x00, .b = 0x00 };
+
+    color_rgb2hsv(&rgb, &hsv);
+
+    TEST_ASSERT(0.0f == hsv.h);
+    TEST_ASSERT(0.0f == hsv.s);
+    TEST_ASSERT(0.0f == hsv.v);

Done.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/9940#discussion_r269015436
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190326/0a8f68c9/attachment-0001.html>


More information about the notifications mailing list