Class BinaryStubBundleTest
java.lang.Object
org.checkerframework.framework.stub.BinaryStubBundleTest
Tests that a damaged binary stub bundle is reported as a malformed file, not a crash. Mirrors
BinaryStubDataTest, which does the same for the per-file format that a bundle's entries
are made of; see that class's documentation for why the files here are hand-built rather than
produced by BinaryStubFileGenerator and then damaged.
Unlike a per-file binary stub, a bundle's own container is not GZIP-compressed (only each
entry's bytes are; see BinaryStubBundle's class documentation), so these bytes are built
directly, uncompressed.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAn absurdly large entry count must be rejected, not allocated.voidAn absurdly large entry length must be rejected, not allocated.voidA negative entry count must be rejected, not passed to a negative-size allocation.voidA negative entry length must be rejected, not passed tonew byte[-1].voidA file that stops in the middle of an entry must be rejected.voidA file that is not a binary stub bundle at all must be rejected.voidA bundle written by a different version of the format must be rejected.
-
Constructor Details
-
BinaryStubBundleTest
public BinaryStubBundleTest()
-
-
Method Details
-
negativeEntryCountIsMalformed
A negative entry count must be rejected, not passed to a negative-size allocation.- Throws:
IOException
-
hugeEntryCountIsMalformed
An absurdly large entry count must be rejected, not allocated.- Throws:
IOException
-
negativeEntryLengthIsMalformed
A negative entry length must be rejected, not passed tonew byte[-1].- Throws:
IOException
-
hugeEntryLengthIsMalformed
An absurdly large entry length must be rejected, not allocated.- Throws:
IOException
-
truncatedFileIsMalformed
A file that stops in the middle of an entry must be rejected.- Throws:
IOException
-
wrongMagicIsMalformed
A file that is not a binary stub bundle at all must be rejected.- Throws:
IOException
-
wrongVersionIsMalformed
A bundle written by a different version of the format must be rejected.- Throws:
IOException
-