summaryrefslogtreecommitdiffstats
path: root/tests
AgeCommit message (Collapse)AuthorFilesLines
2013-12-29Fix path change: compat/ -> extra/Petteri Aimonen1-1/+1
2013-12-29Small fix for previousPetteri Aimonen1-2/+2
2013-12-29Check for supported GCC CCFLAGS when building tests.Petteri Aimonen1-6/+20
2013-12-29Add a SCons tool for nanopb protos.Petteri Aimonen5-41/+129
This tool script is useful both for building the tests and also for use in other applications.
2013-12-29Bring alltypes_pointer testcase up to datePetteri Aimonen3-96/+24
2013-12-29Improve alltypes_pointer test casePetteri Aimonen3-95/+137
2013-12-29Organize allocation logic in generator, add pb_bytes_ptr_t.Petteri Aimonen1-15/+7
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-29Generating and encoding messages with dynamic allocaitonMartin Donath4-0/+249
2013-12-21Fix problem with decode_legacy test case on Windows.Petteri Aimonen1-3/+8
2013-12-21Add test for extreme integer values (INT32_MAX etc.) in AllTypes.Petteri Aimonen7-1/+92
2013-12-21Modify the alltypes test to check re-encoding through protoc.Petteri Aimonen3-15/+53
This way we can verify that the message is encoded exactly the same way as the official protobuf implementation would do it.
2013-11-13Make tests build in a separate folder, add to gitignorePetteri Aimonen16-44/+49
2013-11-02Generate #define tags for extension fields also.Petteri Aimonen1-0/+4
Update issue 93 Status: FixedInGit
2013-10-29Remove the NANOPB_INTERNALS functions from public API.Petteri Aimonen5-6/+8
These have been deprecated since nanopb-0.1.6 (some since 0.1.3). Equivalent functions with better interface are available in the API. Update issue 91 Status: FixedInGit
2013-10-24Detect invalid sizes when encoding bytes fields.Petteri Aimonen2-2/+20
2013-10-23Generate message size #defines also for messages defined in multiple files.Petteri Aimonen4-0/+55
Add testcase for the same.
2013-10-20Check array max size when encoding.Petteri Aimonen1-0/+14
Update issue 90 Status: FixedInGit
2013-09-26Add #defines for the maximum encoded message size.Petteri Aimonen4-3/+16
Update issue 89 Status: FixedInGit
2013-09-11Expand extra_fields test to cover field skipping in case of streams.Petteri Aimonen2-0/+4
2013-09-11Disable warning about uint64_t (long long)Petteri Aimonen1-1/+4
2013-09-11Fix build error when path contains spacesPetteri Aimonen1-3/+6
2013-09-11Add tests for different compilation optionsPetteri Aimonen9-6/+286
2013-09-11Windows build fixesPetteri Aimonen4-6/+13
2013-09-11Make all the tests ANSI C compatible.Petteri Aimonen10-54/+100
2013-09-10Move the rest of the tests to sconsPetteri Aimonen17-14/+151
2013-09-10Compiler options for GCC, clang and tccPetteri Aimonen2-9/+65
2013-09-10Build fixes for Windows/Visual C++Petteri Aimonen12-49/+118
2013-09-10Add an example pb_syshdr.h file for platforms without C99.Petteri Aimonen1-0/+7
This allows building the tests easily on Visual C++ in C mode. Also add checks to pb.h that the defined integer types are of the proper sizes. This may prevent some difficult to debug problems later..
2013-09-10Convert more test cases to sconsPetteri Aimonen4-66/+124
2013-09-08Start moving the tests into subfolders. Transition to SCons for build system ↵Petteri Aimonen42-143/+131
for the tests. Only a few tests updated so far. Have to include all the rest before merging to mainline. Update issue 63 Status: Started
2013-09-08Handle unsupported extension field types more gracefully.Petteri Aimonen1-0/+2
Previously the generator would stop with NotImplementedException as soon as a required or repeated extension field is found. New behaviour is to just ignore the unsupported field and note that in a comment in the generated file. Furthermore, allow skipping of extension fields using the generator option (nanopb).type = FT_IGNORE. Update issue 83 Status: FixedInGit
2013-07-22Finish the testcase for extensionsPetteri Aimonen4-6/+29
2013-07-17Add test case for extensions decodingPetteri Aimonen3-2/+39
2013-07-17Implement generator support for extension fields (no encoder/decoder support ↵Petteri Aimonen4-2/+45
yet)
2013-07-16Add test case for extra fields in AllTypesPetteri Aimonen2-0/+1
2013-07-06Add pb_decode_delimited and pb_encode_delimited wrapper functions.Petteri Aimonen2-0/+20
Update issue 74 Status: FixedInGit
2013-04-14Handle unterminated strings when encoding.Petteri Aimonen2-3/+9
If the null terminator is not present, string will be limited to the data size of the field. If you are still using the pb_enc_string (deprecated since 0.1.3) from callbacks, now would be an excellent time to stop. The pb_field_t for the callback will not contain proper data_size. Use pb_encode_string() instead. Update issue 68 Status: FixedInGit
2013-04-14Fix bug with empty strings in repeated string callbacks.Petteri Aimonen3-0/+21
Fix suggested by Henrik Carlgren. Added also unit test for the bug. Update issue 73 Status: FixedInGit
2013-04-02Change the callback function to use void**.Petteri Aimonen4-16/+16
NOTE: This change breaks backwards-compatibility by default. If you have old callback functions, you can define PB_OLD_CALLBACK_STYLE to retain the old behaviour. If you want to convert your old callbacks to new signature, you need to do the following: 1) Change decode callback argument to void **arg and encode callback argument to void * const *arg. 2) Change any reference to arg into *arg. The rationale for making the new behaviour the default is that it simplifies the common case of "allocate some memory in decode callback". Update issue 69 Status: FixedInGit
2013-03-09Implement error message support for the encoder side.Petteri Aimonen3-1/+7
Update issue 7 Status: FixedInGit
2013-03-09alltypes.proto no longer needs to include nanopb.protoPetteri Aimonen1-2/+0
2013-03-09Switch alltypes.proto to use the new .options file mechanism.Petteri Aimonen2-23/+26
2013-03-09Add option to run the tests with mudflap to detect pointer errors.Petteri Aimonen1-0/+8
2013-03-09Improve the fuzztest.Petteri Aimonen1-4/+4
Enable -fstack-protector-all to detect any stack smashing bugs. Also use test_decode3 for maximal vulnerable surface.
2013-03-09Fix error in backwards compatibility testcasePetteri Aimonen1-1/+1
2013-03-09Fix bug with decoding empty message types. Add test for the same.Petteri Aimonen3-0/+12
Note: the bug only applies to empty message types. Empty messages of non-empty message types are not affected. Update issue 65 Status: FixedInGit
2013-02-20Rename PB_HTYPE_ARRAY -> PB_HTYPE_REPEATED.Petteri Aimonen2-305/+95
This is a more logical name in parallel with PB_HTYPE_REQUIRED and PB_HTYPE_OPTIONAL. Warning: This breaks backwards-compatibility of generated .pb.c files. You will have to regenerate the files and recompile.
2013-02-07Sanitize filenames before putting them in #ifndef.Petteri Aimonen2-1/+2
Update issue 50 Status: FixedInGit
2013-02-06Add compile-time option PB_BUFFER_ONLY.Petteri Aimonen1-2/+18
This allows slight optimizations if only memory buffer support (as opposed to stream callbacks) is wanted. On ARM difference is -12% execution time, -4% code size when enabled.
2013-01-14Add field type FT_IGNORE to generator.Petteri Aimonen1-0/+9
This allows ignoring fields that are unnecessary or too large for an embedded system using nanopb, while allowing them to remain in the .proto for other platforms. Update issue 51 Status: FixedInGit