Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tradfri] Adapt tests to ColorUtil changes on core #16699

Merged
merged 1 commit into from
Apr 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
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