Skip to content

StateGuardContractSuite

abstract class StateGuardContractSuite
Package: dev.joid.test.contract · Module: tool-testkit · Source: StateGuardContractSuite.java

The contract tests of a render bridge that shares its graphics context with a host: every frame must look the same and give the host its state back, whatever the host left set.

Each test draws a frame on a clean state, sets one StateTrap, draws the frame again and compares both, pixel for pixel; it also checks the state of the host before, during and after a drawing of the host. A trap that the context lacks is skipped.

ReturnsSignatureSummary
StateGuardContractSuite()Creates the suite, for a subclass.

ReturnsSignatureSummary
voiddrawsThroughTheScissorSetBeforeJoid()Checks the frame with a scissor test left on by the host.
voiddrawsThroughTheLogicOperationSetBeforeJoid()Checks the frame with a logic operation left on by the host.
voiddrawsThroughTheAlphaTestSetBeforeJoid()Checks the frame with an alpha test left on by the host.
voiddrawsWhateverTheReadFrameBufferSetBeforeJoid()Checks the frame with a read framebuffer bound by the host.
voidrastersANativeDrawingUprightAtItsPixelSize()Checks that a drawing of the host inside DrawUtils.RASTER lands upright at the pixel size of its area.
voidgivesTheHostItsStateBackAroundARasterNestedInItsDrawing()Checks that a raster nested in the drawing of another raster gives that drawing its state back, and that the outer raster gives the host its state back.
ReturnsSignatureSummary
voidstartBackend()Creates a new snapshot backend before each test, at 64×64 pixels.
voidstopBackend()Releases the pooled framebuffers and destroys the snapshot backend after each test.
voidleavesACleanStateAsItWas()Checks that a frame of JOID leaves a clean state of the host as it found it.
voidrestoresTheBlendingSetBeforeJoid()Checks the frame with a blending set by the host.
voidcullsWhateverTheFrontFaceSetBeforeJoid()Checks the frame with the front face of the host reversed.
voiduploadsWhateverThePixelStoreSetBeforeJoid()Checks the uploads with pixel storage parameters set by the host.
voiduploadsWhateverThePixelBufferSetBeforeJoid()Checks the uploads with a pixel buffer bound by the host.
voidfillsWhateverThePolygonModeSetBeforeJoid()Checks the frame with a polygon mode set by the host.
voidkeepsTheVertexArraySetBeforeJoid()Checks the frame with a vertex array bound by the host, and that the host gets it back.
voidkeepsTheClientArraysSetBeforeJoid()Checks the frame with client vertex arrays set by the host, and that the host gets them back.
voidkeepsTheMaterialSetBeforeJoid()Checks the frame with color material left on by the host.
voidtestsTheDepthWhateverTheDepthFunctionSetBeforeJoid()Checks the depth test with a depth function set by the host.
voidsamplesWhateverTheSamplerObjectsSetBeforeJoid()Checks the sampling with sampler objects bound by the host.
voidkeepsTheTextureParametersSetBeforeJoid()Checks that the parameters of a texture of the host survive the frame.
voidsurvivesEveryTrapAtOnce()Checks the frame with every trap set at once.
voidmasksWhateverTheStencilMaskSetBeforeJoid()Checks the frame with a stencil write mask set by the host.
ReturnsSignatureSummary
IStateGuardBackendcreateBackend() hook abstract protectedJOID calls it before every test.

StateGuardContractSuite()

Creates the suite, for a subclass.

void drawsThroughTheScissorSetBeforeJoid()

Checks the frame with a scissor test left on by the host.

drawsThroughTheLogicOperationSetBeforeJoid

Section titled “drawsThroughTheLogicOperationSetBeforeJoid”

void drawsThroughTheLogicOperationSetBeforeJoid()

Checks the frame with a logic operation left on by the host.

void drawsThroughTheAlphaTestSetBeforeJoid()

Checks the frame with an alpha test left on by the host.

drawsWhateverTheReadFrameBufferSetBeforeJoid

Section titled “drawsWhateverTheReadFrameBufferSetBeforeJoid”

void drawsWhateverTheReadFrameBufferSetBeforeJoid()

Checks the frame with a read framebuffer bound by the host.

rastersANativeDrawingUprightAtItsPixelSize

Section titled “rastersANativeDrawingUprightAtItsPixelSize”

void rastersANativeDrawingUprightAtItsPixelSize()

Checks that a drawing of the host inside DrawUtils.RASTER lands upright at the pixel size of its area.

givesTheHostItsStateBackAroundARasterNestedInItsDrawing

Section titled “givesTheHostItsStateBackAroundARasterNestedInItsDrawing”

void givesTheHostItsStateBackAroundARasterNestedInItsDrawing()

Checks that a raster nested in the drawing of another raster gives that drawing its state back, and that the outer raster gives the host its state back.

void startBackend()

Creates a new snapshot backend before each test, at 64×64 pixels.

void stopBackend()

Releases the pooled framebuffers and destroys the snapshot backend after each test.

void leavesACleanStateAsItWas()

Checks that a frame of JOID leaves a clean state of the host as it found it.

void restoresTheBlendingSetBeforeJoid()

Checks the frame with a blending set by the host.

void cullsWhateverTheFrontFaceSetBeforeJoid()

Checks the frame with the front face of the host reversed.

void uploadsWhateverThePixelStoreSetBeforeJoid()

Checks the uploads with pixel storage parameters set by the host.

uploadsWhateverThePixelBufferSetBeforeJoid

Section titled “uploadsWhateverThePixelBufferSetBeforeJoid”

void uploadsWhateverThePixelBufferSetBeforeJoid()

Checks the uploads with a pixel buffer bound by the host.

void fillsWhateverThePolygonModeSetBeforeJoid()

Checks the frame with a polygon mode set by the host.

void keepsTheVertexArraySetBeforeJoid()

Checks the frame with a vertex array bound by the host, and that the host gets it back.

void keepsTheClientArraysSetBeforeJoid()

Checks the frame with client vertex arrays set by the host, and that the host gets them back.

void keepsTheMaterialSetBeforeJoid()

Checks the frame with color material left on by the host.

testsTheDepthWhateverTheDepthFunctionSetBeforeJoid

Section titled “testsTheDepthWhateverTheDepthFunctionSetBeforeJoid”

void testsTheDepthWhateverTheDepthFunctionSetBeforeJoid()

Checks the depth test with a depth function set by the host.

samplesWhateverTheSamplerObjectsSetBeforeJoid

Section titled “samplesWhateverTheSamplerObjectsSetBeforeJoid”

void samplesWhateverTheSamplerObjectsSetBeforeJoid()

Checks the sampling with sampler objects bound by the host.

void keepsTheTextureParametersSetBeforeJoid()

Checks that the parameters of a texture of the host survive the frame.

void survivesEveryTrapAtOnce()

Checks the frame with every trap set at once.

void masksWhateverTheStencilMaskSetBeforeJoid()

Checks the frame with a stencil write mask set by the host.

IStateGuardBackend createBackend() hook abstract protected

JOID calls it before every test. Return a new snapshot backend of your backend that implements IStateGuardBackend.


fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses

Report a problem with this page