Skip to content

Commit cfc137f

Browse files
committed
Added test fixes
1 parent 6c08a0c commit cfc137f

File tree

5 files changed

+13
-9
lines changed

5 files changed

+13
-9
lines changed

doc/changes.txt

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
Image to ZX Spec Changes
22
------------------------
33

4+
Version 2.1.0
5+
- Fixed Gigascreen palette choice bug in converter
6+
- Improved/added new colour distance algorithms (used to determine which palette colour should be used)
7+
- Fixed Ordered Dither algorithm
8+
- Removed broken incompatible ordered dither strategies (e.g. "Lightness")
9+
410
Version 2.0.2
511
- Fixed related bugs to do with output image naming and missing output images
612
- Updated copyright

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>uk.co.silentsoftware</groupId>
55
<artifactId>imagetozxspec</artifactId>
6-
<version>2.0.2</version>
6+
<version>2.1.0-alpha</version>
77
<name>Image To ZX Spec</name>
88
<description>Image converter for the ZX Spectrum</description>
99
<licenses>

src/test/groovy/uk/co/silentsoftware/core/attributestrategy/ForceReducedHalfBrightAttributeStrategyTest.groovy

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,6 @@ class ForceReducedHalfBrightAttributeStrategyTest {
5454
AttributeStrategy strategy = new ForceReducedHalfBrightAttributeStrategy()
5555
int[] result = strategy.enforceAttributeRule(0xFF00CDCDi, 0xFFCD00CDi)
5656
Assert.assertEquals(0xFFCDCDCDi,result[0])
57-
Assert.assertEquals(0xFFCDCDCDi,result[1]) // Switch to half bright
57+
Assert.assertEquals(0xFFCD0000i,result[1]) // Switch to half bright
5858
}
5959
}

src/test/groovy/uk/co/silentsoftware/core/colourstrategy/ColourChoiceStrategyTest.groovy

+1-3
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ class ColourChoiceStrategyTest {
2727
void testMonochromePaletteStrategyColour() {
2828
ColourChoiceStrategy strategy = new MonochromePaletteStrategy()
2929
int result = strategy.chooseBestPaletteMatch(0xFFBBCCDDi, createPopularColours())
30-
31-
// Just passes back the same value
32-
Assert.assertEquals(0xFFBBCCDDi, result)
30+
Assert.assertEquals((int)0xFFFFFFFF, result)
3331
}
3432

3533
@Test(expected=UnsupportedOperationException.class)

src/test/groovy/uk/co/silentsoftware/core/converters/image/orderedditherstrategy/AbstractOrderedDitherStrategyTest.groovy

+4-4
Original file line numberDiff line numberDiff line change
@@ -50,23 +50,23 @@ class AbstractOrderedDitherStrategyTest {
5050
}
5151

5252
@Test
53-
void testApplyDitherWillFullColour() {
53+
void testApplyDitherWithFullColour() {
5454
OptionsObject.getInstance().setColourMode(OptionsObject.getInstance().getColourModes()[0])
5555
int[] dither = strategy.applyDither(createRgbStrip())
56-
Assert.assertArrayEquals([0xFFCDCDCD,0xFF000000,0xFF000000,0xFFCDCDCD] as int[], dither)
56+
Assert.assertArrayEquals([0xFF2D2D2D,0xFF000000,0xFF000000,0xFF2D2D2D] as int[], dither)
5757
}
5858

5959
@Test
6060
void testApplyDitherWithGigascreen() {
6161
OptionsObject.getInstance().setColourMode(OptionsObject.getInstance().getColourModes()[1])
6262
int[] dither = strategy.applyDither(createRgbStrip())
63-
Assert.assertArrayEquals([0xFF7F7F7F,0xFF000000,0xFF000000,0xFF7F7F7F] as int[], dither)
63+
Assert.assertArrayEquals([0xFF3E3E3E,0xFF000000,0xFF000000,0xFF3E3E3E] as int[], dither)
6464
}
6565

6666
@Test
6767
void testApplyDitherWithMonochrome() {
6868
OptionsObject.getInstance().setColourMode(OptionsObject.getInstance().getColourModes()[2])
6969
int[] dither = strategy.applyDither(createRgbStrip())
70-
Assert.assertArrayEquals([0xFFFFFFFF,0xFF000000,0xFF000000,0xFFFFFFFF] as int[], dither)
70+
Assert.assertArrayEquals([0xFF282828,0xFF000000,0xFF000000,0xFF282828] as int[], dither)
7171
}
7272
}

0 commit comments

Comments
 (0)