unittests (some)

git-svn-id: https://svn.kapsi.fi/jpa/nanopb@949 e3a754e5-d11d-0410-8d38-ebb782a927b9
This commit is contained in:
Petteri Aimonen
2011-07-30 09:59:08 +00:00
parent d7863b7424
commit f8364310d3
5 changed files with 145 additions and 24 deletions

9
pb.h
View File

@@ -112,8 +112,6 @@ struct _pb_field_t {
const void *ptr;
} pb_packed;
#define PB_LAST_FIELD {0,0,0,0}
/* This structure is used for 'bytes' arrays.
* It has the number of bytes in the beginning, and after that an array. */
#define PB_BYTES_ARRAY(buffersize) \
@@ -152,4 +150,11 @@ struct _pb_callback_t {
void *arg;
};
/* These macros are used to declare pb_field_t's in the constant array. */
#define pb_membersize(st, m) (sizeof ((st*)0)->m)
#define pb_arraysize(st, m) (pb_membersize(st, m) / pb_membersize(st, m[0]))
#define pb_delta(st, m1, m2) ((int)offsetof(st, m1) - (int)offsetof(st, m2))
#define PB_LAST_FIELD {0,0,0,0}
#endif