26 Commits
Author SHA1 Message Date
Petteri Aimonen 77e23acc28 Fix test case build error on clang. 2021-03-22 11:20:34 +02:00
Petteri Aimonen 0a03bdfbb5 fuzztest: Better coverage of static data in oneof (#647)
Previously added static_message member of the oneof
had the shortcoming that the first member of the submessage
was also a pointer. So when it aliased with a pointer to a message,
it was still a valid NULL pointer.
2021-03-22 11:13:27 +02:00
Petteri Aimonen 006a18b5ef Include a static submessage in alltypes pointer test case.
This gives the fuzzer a chance to find bugs like #615 in the future.
2020-11-25 09:21:10 +02:00
Petteri Aimonen 47c9b2b3f0 alltypes test case: cover the logic needed for multiple fixed length arrays 2020-08-10 10:59:45 +03:00
John Ullman 73f39186a3 Set proto2 enum fields to first value when no default is given, even if nonzero (#532) (#539) 2020-06-02 08:05:40 +03:00
Petteri Aimonen 6a85a16748 Reduce string sizes in tests for AVR 2020-01-20 20:37:34 +02:00
Petteri Aimonen c0d3d423cd AllTypes testcase: add test for integer_size option. 2020-01-13 13:32:58 +02:00
Petteri Aimonen 2198604971 Make descriptorsize:DS_8 work, add to AllTypes test case. 2020-01-02 11:47:44 +02:00
Petteri Aimonen 32795d7962 Make fixed_count option work when combined with FT_POINTER.
Also added to AllTypes testcase.
2020-01-02 11:05:36 +02:00
Petteri Aimonen 325383a0f0 Add platform support for running tests on STM32 2019-12-15 14:59:24 +02:00
Petteri Aimonen 91dcdf5737 Add fixed length bytes to alltypes test case (issue #244) 2017-02-22 21:11:01 +02:00
Petteri Aimonen f4b3a1c202 Add oneofs to AllTypes test case 2015-01-11 19:47:27 +02:00
Petteri Aimonen 0f3c0f79bc Move malloc support to tests/common directory 2014-12-26 17:34:45 +02:00
Petteri Aimonen a641e21b34 Separate field iterator logic from pb_decode to pb_common. 2014-08-10 12:42:01 +03:00
Petteri Aimonen 9cf788de54 Fix bug in alltypes test case that made fuzzing difficult. 2014-05-17 20:28:33 +03:00
Petteri Aimonen ab62402059 Documentation updates 2014-03-16 15:52:19 +02:00
Petteri Aimonen 108864963f Finish the alltypes_pointer testcase, use valgrind if available. 2014-03-15 09:39:27 +02:00
Petteri Aimonen 9be2cfe968 Get rid of pb_bytes_ptr_t, just allocate pb_bytes_array_t dynamically.
This makes the internal logic much simpler, and also keeps the datatypes
more similar between STATIC/POINTER cases. It will still be a bit cumbersome
to use because of variable length array member. Macros PB_BYTES_ARRAY_T(n) and
PB_BYTES_ARRAY_T_ALLOCSIZE(n) have been added to make life a bit easier.

This has the drawback that it is no longer as easy to use externally allocated
byte array as input for bytes field in pointer mode. However, this is still
easy to do using callbacks, so it shouldn't be a large issue.
2014-03-15 08:45:58 +02:00
Petteri Aimonen 9c196b89ba Add pb_release() function 2014-03-12 21:08:35 +02:00
Petteri Aimonen bf61d2337b More fixes for dynamic allocation 2014-03-10 18:19:38 +02:00
Petteri Aimonen 011a30af9c Beginnings of malloc support in pb_decode 2014-02-24 21:09:25 +02:00
Petteri Aimonen 10ef575d46 Fix build on Windows 2013-12-29 20:53:39 +02:00
Petteri Aimonen f4146edf01 Bring alltypes_pointer testcase up to date 2013-12-29 18:44:58 +02:00
Petteri Aimonen 8da15d8b80 Improve alltypes_pointer test case 2013-12-29 18:35:57 +02:00
Petteri Aimonen 25516b0591 Organize allocation logic in generator, add pb_bytes_ptr_t.
Allocation decision is now made before the field data type is decided.
This way the data type decisions can more cleanly account for the allocation
type, i.e. FT_DEFAULT logic etc.

Added pb_bytes_ptr_t for pointer-allocated bytes-fields. There is no point
generating separate structs for these, as they would all be of the same type.
2013-12-29 18:35:57 +02:00
Martin Donath 4ae3b2e566 Generating and encoding messages with dynamic allocaiton 2013-12-29 18:35:57 +02:00