Document how tested prefix lengths are chosen
diff --git a/tests/suites/test_suite_asn1parse.function b/tests/suites/test_suite_asn1parse.function
index d747cc2..63e3a31 100644
--- a/tests/suites/test_suite_asn1parse.function
+++ b/tests/suites/test_suite_asn1parse.function
@@ -185,6 +185,10 @@
size_t buffer_size;
int ret;
+ /* Test every prefix of the input, except the empty string.
+ * The first byte of the string is the tag. Without a tag byte,
+ * we wouldn't know what to parse the input as.
+ */
for( buffer_size = 1; buffer_size <= input->len; buffer_size++ )
{
test_set_step( buffer_size );
@@ -221,6 +225,12 @@
size_t actual_length = actual_length_arg;
size_t buffer_size;
+ /* Test prefixes of a buffer containing the given length string
+ * followed by `actual_length` bytes of payload. To save a bit of
+ * time, we skip some "boring" prefixes: we don't test prefixes where
+ * the payload is truncated more than one byte away from either end,
+ * and we only test the empty string on a 1-byte input.
+ */
for( buffer_size = 1; buffer_size <= input->len + 1; buffer_size++ )
{
if( ! get_len_step( input, buffer_size, actual_length ) )