This introduces konsist (a static analyzer) in order to create a test suite to ensure that written buffer sizes (via buffer.p*) match the declared size. I've added the new suite (konsistTest) as a dependency of check, so it will automatically be ran alongside other check tasks.
A test container is created for each dynamically discovered module that defines a GameServerProt enum, and tests for each encoder are nested under it.
notes:
encoders annotated with @Consistent are ignored
CombinedId methods are hardcoded to 4 bytes
the expected size from the enum is naively grabbing the second argument
if the expected size is dynamic (-1 or -2), the test is marked successful without any validation
if running repeatedly via gradle, the konsistTest suite will always be up-to-date. this is because the inputs are from different modules. to force a run, you'll need --rerun-tasks. see the konsist docs
This introduces konsist (a static analyzer) in order to create a test suite to ensure that written buffer sizes (via
buffer.p*
) match the declared size. I've added the new suite (konsistTest
) as a dependency ofcheck
, so it will automatically be ran alongside other check tasks.A test container is created for each dynamically discovered module that defines a
GameServerProt
enum, and tests for each encoder are nested under it.notes:
@Consistent
are ignoredCombinedId
methods are hardcoded to 4 bytes-1
or-2
), the test is marked successful without any validationkonsistTest
suite will always beup-to-date
. this is because the inputs are from different modules. to force a run, you'll need--rerun-tasks
. see the konsist docs