Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nanopb/nanopb.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>2020-08-10 11:20:13 +0300
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>2020-08-10 11:20:13 +0300
commitddda911ff101d1e0db864743ed4d342ead9d5dc2 (patch)
tree4ba59d720630b9d9acea0da49005a16275802c49
parent47c9b2b3f007338db3859f076d867ea825abcab8 (diff)
Fuzztest: speed up io errors test case
-rw-r--r--tests/fuzztest/fuzztest.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/tests/fuzztest/fuzztest.c b/tests/fuzztest/fuzztest.c
index 6e2982a..20819cd 100644
--- a/tests/fuzztest/fuzztest.c
+++ b/tests/fuzztest/fuzztest.c
@@ -329,15 +329,14 @@ void do_roundtrips(const uint8_t *data, size_t size, bool expect_valid)
set_max_alloc_bytes(orig_max_alloc_bytes);
}
- /* Test decoding on a failing stream */
+ /* Test decoding on a failing stream.
+ * Testing proto2 is enough for good coverage, as there is no difference in IO when decoding proto3 fields.
+ */
do_stream_decode(data, size, size - 16, sizeof(alltypes_static_AllTypes), alltypes_static_AllTypes_fields, false);
- do_stream_decode(data, size, size - 16, sizeof(alltypes_proto3_static_AllTypes), alltypes_proto3_static_AllTypes_fields, false);
do_stream_decode(data, size, size - 16, sizeof(alltypes_pointer_AllTypes), alltypes_pointer_AllTypes_fields, false);
- do_stream_decode(data, size, size - 16, sizeof(alltypes_proto3_pointer_AllTypes), alltypes_proto3_pointer_AllTypes_fields, false);
/* Test pb_decode_ex() modes */
- do_decode(data, size, sizeof(alltypes_static_AllTypes), alltypes_static_AllTypes_fields, PB_DECODE_NOINIT, false);
- do_decode(data, size, sizeof(alltypes_static_AllTypes), alltypes_static_AllTypes_fields, PB_DECODE_DELIMITED, false);
+ do_decode(data, size, sizeof(alltypes_static_AllTypes), alltypes_static_AllTypes_fields, PB_DECODE_NOINIT | PB_DECODE_DELIMITED, false);
do_decode(data, size, sizeof(alltypes_static_AllTypes), alltypes_static_AllTypes_fields, PB_DECODE_NULLTERMINATED, false);
/* Test callbacks also when message is not valid */