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.
Description
Section titled “Description”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.
Learn more
Section titled “Learn more”Creation
Section titled “Creation”| Returns | Signature | Summary |
|---|---|---|
| StateGuardContractSuite() | Creates the suite, for a subclass. |
Methods
Section titled “Methods”Drawing
Section titled “Drawing”| Returns | Signature | Summary |
|---|---|---|
void | drawsThroughTheScissorSetBeforeJoid() | Checks the frame with a scissor test left on by the host. |
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. |
void | drawsWhateverTheReadFrameBufferSetBeforeJoid() | Checks the frame with a read framebuffer bound by the host. |
void | rastersANativeDrawingUprightAtItsPixelSize() | Checks that a drawing of the host inside DrawUtils.RASTER lands upright at the pixel size of its area. |
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. |
Actions
Section titled “Actions”| Returns | Signature | Summary |
|---|---|---|
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. |
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. |
void | testsTheDepthWhateverTheDepthFunctionSetBeforeJoid() | Checks the depth test with a depth function set by the host. |
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. |
For subclasses
Section titled “For subclasses”| Returns | Signature | Summary |
|---|---|---|
IStateGuardBackend | createBackend() hook abstract protected | JOID calls it before every test. |
Creation details
Section titled “Creation details”StateGuardContractSuite
Section titled “StateGuardContractSuite”StateGuardContractSuite()
Creates the suite, for a subclass.
Method details
Section titled “Method details”drawsThroughTheScissorSetBeforeJoid
Section titled “drawsThroughTheScissorSetBeforeJoid”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.
drawsThroughTheAlphaTestSetBeforeJoid
Section titled “drawsThroughTheAlphaTestSetBeforeJoid”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.
startBackend
Section titled “startBackend”void startBackend()
Creates a new snapshot backend before each test, at 64×64 pixels.
stopBackend
Section titled “stopBackend”void stopBackend()
Releases the pooled framebuffers and destroys the snapshot backend after each test.
leavesACleanStateAsItWas
Section titled “leavesACleanStateAsItWas”void leavesACleanStateAsItWas()
Checks that a frame of JOID leaves a clean state of the host as it found it.
restoresTheBlendingSetBeforeJoid
Section titled “restoresTheBlendingSetBeforeJoid”void restoresTheBlendingSetBeforeJoid()
Checks the frame with a blending set by the host.
cullsWhateverTheFrontFaceSetBeforeJoid
Section titled “cullsWhateverTheFrontFaceSetBeforeJoid”void cullsWhateverTheFrontFaceSetBeforeJoid()
Checks the frame with the front face of the host reversed.
uploadsWhateverThePixelStoreSetBeforeJoid
Section titled “uploadsWhateverThePixelStoreSetBeforeJoid”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.
fillsWhateverThePolygonModeSetBeforeJoid
Section titled “fillsWhateverThePolygonModeSetBeforeJoid”void fillsWhateverThePolygonModeSetBeforeJoid()
Checks the frame with a polygon mode set by the host.
keepsTheVertexArraySetBeforeJoid
Section titled “keepsTheVertexArraySetBeforeJoid”void keepsTheVertexArraySetBeforeJoid()
Checks the frame with a vertex array bound by the host, and that the host gets it back.
keepsTheClientArraysSetBeforeJoid
Section titled “keepsTheClientArraysSetBeforeJoid”void keepsTheClientArraysSetBeforeJoid()
Checks the frame with client vertex arrays set by the host, and that the host gets them back.
keepsTheMaterialSetBeforeJoid
Section titled “keepsTheMaterialSetBeforeJoid”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.
keepsTheTextureParametersSetBeforeJoid
Section titled “keepsTheTextureParametersSetBeforeJoid”void keepsTheTextureParametersSetBeforeJoid()
Checks that the parameters of a texture of the host survive the frame.
survivesEveryTrapAtOnce
Section titled “survivesEveryTrapAtOnce”void survivesEveryTrapAtOnce()
Checks the frame with every trap set at once.
masksWhateverTheStencilMaskSetBeforeJoid
Section titled “masksWhateverTheStencilMaskSetBeforeJoid”void masksWhateverTheStencilMaskSetBeforeJoid()
Checks the frame with a stencil write mask set by the host.
createBackend
Section titled “createBackend”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
