Adjust clearing

This commit is contained in:
2026-08-31 00:00:13 +00:00
parent 27976dd31f
commit e18d2f436f
2 changed files with 28 additions and 98 deletions
@@ -71,14 +71,14 @@ public class GocaDecoderPhase5Test {
GraphicsPlane plane = new GraphicsPlane(400, 300);
GocaDecoder decoder = new GocaDecoder(plane);
// Segment 10 chains to Segment 11
// Segment 10 has bytes indicating nextId = 11
ByteArrayOutputStream s10 = new ByteArrayOutputStream();
s10.write(GocaConstants.G_BEGSEGM);
s10.write(0x0C);
s10.write(0x00); s10.write(0x00); s10.write(0x00); s10.write(0x0A); // Seg 10
s10.write(0x00); s10.write(0x00);
s10.write(0x00); s10.write(0x00); // flags
s10.write(0x00); s10.write(0x00); s10.write(0x00); s10.write(0x0B); // Next Seg ID = 11!
s10.write(0x00); s10.write(0x00); s10.write(0x00); s10.write(0x0B); // Next Seg ID = 11
s10.write(GocaConstants.G_GSCOL); s10.write(0x01); // Blue
s10.write(GocaConstants.G_GLINE); s10.write(0x08);
s10.write(0x00); s10.write(10); s10.write(0x00); s10.write(10);
@@ -99,16 +99,16 @@ public class GocaDecoderPhase5Test {
s11.write(0x00); s11.write(70); s11.write(0x00); s11.write(70);
s11.write(GocaConstants.G_ENDSEGM); s11.write(0x00);
// Store Segment 11 first
// Decode Segment 11 first, then clear
decoder.decodeGoca(s11.toByteArray(), 0, s11.toByteArray().length);
plane.clear();
assertFalse(plane.hasContent());
// Execute Segment 10; upon ENDSEGM, Segment 11 should be automatically chained!
// Execute Segment 10; per HOD architecture, ENDSEGM must NOT automatically execute Segment 11!
decoder.decodeGoca(s10.toByteArray(), 0, s10.toByteArray().length);
assertTrue(plane.hasContent());
// Verify both Blue (Seg 10) and Yellow (Seg 11) pixels exist
// Verify Blue (Seg 10) exists, and Yellow (Seg 11) is NOT drawn
int blueArgb = GocaConstants.GOCA_COLORS[1];
int yellowArgb = GocaConstants.GOCA_COLORS[6];
boolean foundBlue = false;
@@ -118,7 +118,7 @@ public class GocaDecoderPhase5Test {
if (p == yellowArgb) foundYellow = true;
}
assertTrue(foundBlue, "Expected Blue pixel from Segment 10");
assertTrue(foundYellow, "Expected Yellow pixel from chained Segment 11");
assertFalse(foundYellow, "Per HOD architecture, Segment 11 must NOT be automatically chained on ENDSEGM");
}
@Test