Petteri Aimonen
f2f9f8a9ed
Fix problem with .options file and extension fields.
...
The options for an extension field were being looked up under wrong name
(MessageName instead of MessageName.fieldname).
Fixed the problem and added regression test. Created a new subfolder for
regression test cases.
Update issue 125
Status: FixedInGit
2014-07-20 14:02:56 +03:00
Petteri Aimonen
788d2825b0
Add unit tests for allocate_field().
2014-06-02 21:20:57 +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
d177af1639
Fix typos in scons command line options
2014-04-15 20:30:50 +03:00
Petteri Aimonen
3b36235cef
Remove -O0 from tests CFLAGS so that optimized builds can be tested also
2014-04-15 20:27:38 +03:00
Petteri Aimonen
1d249a48ea
Fix bug in missing_fields test case
2014-04-09 19:39:12 +03:00
Petteri Aimonen
3e83d81b09
Use -fsanitize=undefined when running tests with clang
2014-04-09 19:28:57 +03:00
Petteri Aimonen
a8de6acf2d
Add rule for building coverage summary using lcov.
...
Also modified a few tests to be more compatible with coverage information,
so that they use the same pb_encode/decode.c instead of making a copy.
2014-04-05 13:26:37 +03:00
Petteri Aimonen
b63e582bdb
Add a convenience function pb_get_encoded_size()
...
There is minimal size penalty from this, and it is probably much more
intuitive to use than PB_OSTREAM_SIZING itself.
This has been suggested before also, but I ended up refusing it back
them. Reconsidering it now, I see that an intuitive API is much better
than any amount of documentation explaining a non-intuitive API.
Update issue 16
Status: FixedInGit
2014-04-05 11:26:39 +03:00
Petteri Aimonen
e5b855fec5
Add a 'found' field to pb_extension_t.
...
Update issue 112
Status: FixedInGit
2014-04-05 11:11:05 +03:00
Petteri Aimonen
99434724d0
Fix splint warnings, add splint test case
2014-04-02 21:07:30 +03:00
Petteri Aimonen
6c90e824c4
Fix compile error when default value given for extension field.
...
Update issue 111
Status: FixedInGit
2014-04-01 16:47:53 +03:00
Petteri Aimonen
f4949119ad
Add stdlib.h to pb_syshdr.h for dynamic allocation
2014-03-18 16:13:54 +02: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
fe0bf121eb
Add test case for package names defined in .proto file.
2014-02-12 19:22:01 +02:00
Petteri Aimonen
057165966c
Add AllTypes decoding test with callbacks.
...
Update issue 99
Status: FixedInGit
2014-02-10 21:00:26 +02:00
Petteri Aimonen
235219a295
Add AllTypes encoding test for callbacks (issue #99 )
...
Still need to do the decoding side.
2014-02-09 19:28:50 +02:00
Petteri Aimonen
d3ed0744d0
Extreme negative integer constants are a bit nasty to define in C, just avoid the trouble in tests for now.
2014-02-05 17:56:37 +02:00
Petteri Aimonen
a2f8112166
Add proper suffixes for integer default values.
...
Update issue 102
Status: FixedInGit
2014-02-04 20:24:44 +02:00
Petteri Aimonen
5efeb392e0
Add strict-aliasing GCC warnings for core
2014-02-04 20:11:52 +02:00
Petteri Aimonen
18e71bbfe2
Fix bundled protoc detection in scons script
2013-12-29 22:08:13 +02:00
Petteri Aimonen
125b49bf24
Fix spaces in paths on Windows also
2013-12-29 21:36:06 +02:00
Petteri Aimonen
da8210b947
Fix handling spaces in directory name
2013-12-29 21:16:38 +02:00
Petteri Aimonen
10ef575d46
Fix build on Windows
2013-12-29 20:53:39 +02:00
Petteri Aimonen
ae7b9a3bd3
Fix path change: compat/ -> extra/
2013-12-29 20:41:36 +02:00
Petteri Aimonen
b1cb035373
Small fix for previous
2013-12-29 20:26:58 +02:00
Petteri Aimonen
6d0e0695d0
Check for supported GCC CCFLAGS when building tests.
2013-12-29 20:26:58 +02:00
Petteri Aimonen
1fc90ab4c4
Add a SCons tool for nanopb protos.
...
This tool script is useful both for building the tests and also for use in other applications.
2013-12-29 20:26:58 +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
Petteri Aimonen
ed93db08dc
Fix problem with decode_legacy test case on Windows.
2013-12-21 18:08:04 +02:00
Petteri Aimonen
cd9004089f
Add test for extreme integer values (INT32_MAX etc.) in AllTypes.
2013-12-21 12:41:20 +02:00
Petteri Aimonen
9cc19a5e99
Modify the alltypes test to check re-encoding through protoc.
...
This way we can verify that the message is encoded exactly the same way
as the official protobuf implementation would do it.
2013-12-21 12:14:20 +02:00
Petteri Aimonen
5813144246
Make tests build in a separate folder, add to gitignore
2013-11-13 22:10:42 +02:00
Petteri Aimonen
dcdd7f98fd
Generate #define tags for extension fields also.
...
Update issue 93
Status: FixedInGit
2013-11-02 22:05:49 +02:00
Petteri Aimonen
287207841d
Remove the NANOPB_INTERNALS functions from public API.
...
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-29 16:32:47 +02:00
Petteri Aimonen
ed564186e1
Detect invalid sizes when encoding bytes fields.
2013-10-24 21:45:39 +03:00
Petteri Aimonen
49bd3f35a0
Generate message size #defines also for messages defined in multiple files.
...
Add testcase for the same.
2013-10-23 21:01:11 +03:00
Petteri Aimonen
e83fbd18d3
Check array max size when encoding.
...
Update issue 90
Status: FixedInGit
2013-10-20 21:42:00 +03:00
Petteri Aimonen
388d4de833
Add #defines for the maximum encoded message size.
...
Update issue 89
Status: FixedInGit
2013-09-26 10:23:37 +03:00
Petteri Aimonen
59cba0beea
Expand extra_fields test to cover field skipping in case of streams.
2013-09-11 17:33:50 +03:00
Petteri Aimonen
152c2c910c
Disable warning about uint64_t (long long)
2013-09-11 16:51:53 +03:00
Petteri Aimonen
2b72815036
Fix build error when path contains spaces
2013-09-11 16:45:52 +03:00