Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added ctesque integration tests for Color#HSVToColor.
Tests added to check the pinning of saturation and value parameters in Color#HSVToColor.
- Loading branch information
Showing
2 changed files
with
25 additions
and
89 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
integration_tests/ctesque/src/sharedTest/java/android/graphics/ColorTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package android.graphics; | ||
|
||
import static com.google.common.truth.Truth.assertThat; | ||
|
||
import androidx.test.ext.junit.runners.AndroidJUnit4; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.robolectric.annotation.internal.DoNotInstrument; | ||
|
||
/** Compatibility tests for {@link Color} */ | ||
@DoNotInstrument | ||
@RunWith(AndroidJUnit4.class) | ||
public class ColorTest { | ||
@Test | ||
public void HSVToColorValueShouldBePinned() { | ||
assertThat(Color.HSVToColor(new float[] {0f, 0f, -1.0f})).isEqualTo(Color.BLACK); | ||
assertThat(Color.HSVToColor(new float[] {0f, 0f, 2.0f})).isEqualTo(Color.WHITE); | ||
} | ||
|
||
@Test | ||
public void HSVToColorSaturationShouldBePinned() { | ||
assertThat(Color.HSVToColor(new float[] {0f, -1.0f, 0.5f})).isEqualTo(0xff808080); | ||
assertThat(Color.HSVToColor(new float[] {0f, 2.0f, 0.5f})).isEqualTo(0xff800000); | ||
} | ||
} |
89 changes: 0 additions & 89 deletions
89
robolectric/src/test/java/org/robolectric/shadows/ShadowColorTest.java
This file was deleted.
Oops, something went wrong.