MOS Source Code
Loading...
Searching...
No Matches
callback_pointer.c
Go to the documentation of this file.
1
#include "callback_pointer.pb.h"
2
#include <
unittests.h
>
3
#include <pb_decode.h>
4
5
int
main
()
6
{
7
int
status = 0;
8
const
uint8_t
msgdata[] = {0x0A, 0x02, 0x08, 0x7F};
9
10
MainMessage msg = MainMessage_init_zero;
11
12
{
13
pb_istream_t stream =
pb_istream_from_buffer
(msgdata,
sizeof
(msgdata));
14
COMMENT
(
"Running first decode"
);
15
TEST
(
pb_decode
(&stream, MainMessage_fields, &msg));
16
pb_release
(MainMessage_fields, &msg);
17
}
18
19
{
20
pb_istream_t stream =
pb_istream_from_buffer
(msgdata,
sizeof
(msgdata));
21
COMMENT
(
"Running second decode"
);
22
TEST
(
pb_decode
(&stream, MainMessage_fields, &msg));
23
pb_release
(MainMessage_fields, &msg);
24
}
25
26
TEST
(
get_alloc_count
() == 0);
27
28
return
status;
29
}
30
main
int main()
Definition
callback_pointer.c:5
get_alloc_count
size_t get_alloc_count()
Definition
malloc_wrappers.c:162
pb_decode
bool pb_decode(pb_istream_t *stream, const pb_msgdesc_t *fields, void *dest_struct)
Definition
pb_decode.c:1182
pb_release
void pb_release(const pb_msgdesc_t *fields, void *dest_struct)
Definition
pb_decode.c:1336
pb_istream_from_buffer
pb_istream_t pb_istream_from_buffer(const pb_byte_t *buf, size_t msglen)
Definition
pb_decode.c:143
uint8_t
unsigned char uint8_t
Definition
pb_syshdr.h:20
TEST
#define TEST(x)
Definition
test.h:3
unittests.h
COMMENT
#define COMMENT(x)
Definition
unittests.h:17
libs
nanopb
nanopb
tests
regression
issue_259
callback_pointer.c
Generated on Sun Sep 1 2024 18:22:52 for MOS Source Code by
1.12.0