Skip to content

Commit

Permalink
[tradfri] Adapt tests to ColorUtil changes on core (#16699)
Browse files Browse the repository at this point in the history
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
  • Loading branch information
holgerfriedrich committed Apr 28, 2024
1 parent 01e8e1c commit 1af3ecd
Showing 1 changed file with 8 additions and 8 deletions.
Expand Up @@ -82,8 +82,8 @@ public void testFromCieKnownGood4() {
@Test
public void testFromHSBTypeKnownGood1() {
TradfriColor color = new TradfriColor(HSBType.RED);
assertEquals(45789, (int) color.xyX);
assertEquals(19490, (int) color.xyY);
assertEquals(45792, (int) color.xyX);
assertEquals(19492, (int) color.xyY);
assertEquals(254, (int) color.brightness);
HSBType hsbType = color.getHSB();
assertNotNull(hsbType);
Expand All @@ -95,8 +95,8 @@ public void testFromHSBTypeKnownGood1() {
@Test
public void testFromHSBTypeKnownGood2() {
TradfriColor color = new TradfriColor(new HSBType("0,100,1"));
assertEquals(45789, (int) color.xyX);
assertEquals(19490, (int) color.xyY);
assertEquals(45792, (int) color.xyX);
assertEquals(19492, (int) color.xyY);
assertEquals(2, (int) color.brightness);
HSBType hsbType = color.getHSB();
assertNotNull(hsbType);
Expand All @@ -109,8 +109,8 @@ public void testFromHSBTypeKnownGood2() {
public void testConversionReverse() {
// convert from HSBType
TradfriColor color = new TradfriColor(HSBType.GREEN);
assertEquals(11298, (int) color.xyX);
assertEquals(48935, (int) color.xyY);
assertEquals(11299, (int) color.xyX);
assertEquals(48941, (int) color.xyY);
assertEquals(254, (int) color.brightness);
HSBType hsbType = color.getHSB();
assertNotNull(hsbType);
Expand All @@ -119,8 +119,8 @@ public void testConversionReverse() {
assertEquals(100, hsbType.getBrightness().intValue());
// convert the result again based on the XY values
TradfriColor reverse = new TradfriColor(color.xyX, color.xyY, color.brightness);
assertEquals(11298, (int) reverse.xyX);
assertEquals(48935, (int) reverse.xyY);
assertEquals(11299, (int) reverse.xyX);
assertEquals(48941, (int) reverse.xyY);
assertEquals(254, (int) reverse.brightness);
HSBType hsbTypeReverse = color.getHSB();
assertNotNull(hsbTypeReverse);
Expand Down

0 comments on commit 1af3ecd

Please sign in to comment.