Home
last modified time | relevance | path

Searched refs:buffer (Results 1 – 25 of 75) sorted by relevance

123

/nanopb-2.7.6/tests/regression/issue_407/
Dtest_extensions.c8 uint8_t buffer[256]; in main() local
29 stream = pb_ostream_from_buffer(buffer, sizeof(buffer)); in main()
33 TEST(buffer[0] == 0x08); /* varint 1 */ in main()
34 TEST(buffer[1] == 0xD2); /* number = 1234 */ in main()
35 TEST(buffer[2] == 0x09); in main()
36 TEST(buffer[3] == 0xE2); /* submsg 1100 */ in main()
37 TEST(buffer[4] == 0x44); in main()
38 TEST(buffer[5] == 0x03); /* length 3 */ in main()
39 TEST(buffer[6] == 0x08); /* varint 1 */ in main()
40 TEST(buffer[7] == 0xae); /* second_number = 5678 */ in main()
[all …]
/nanopb-2.7.6/tests/regression/issue_242/
Dzero_value.c13 uint8_t buffer[256] = {0}; in main() local
23 ostream = pb_ostream_from_buffer(buffer, sizeof(buffer)); in main()
27 TEST(memcmp(buffer, "\x58\x00", 2) == 0); in main()
35 uint8_t buffer[256] = {0}; in main() local
42 ostream = pb_ostream_from_buffer(buffer, sizeof(buffer)); in main()
46 TEST(memcmp(buffer, "\x58\x00", 2) == 0); in main()
/nanopb-2.7.6/tests/io_errors/
Dio_errors.c13 uint8_t *buffer; member
26 *buf++ = *state->buffer++; in read_callback()
40 *state->buffer++ = *buf++; in write_callback()
48 uint8_t buffer[2048]; in main() local
54 msglen = fread(buffer, 1, sizeof(buffer), stdin); in main()
67 fs.buffer = buffer; in main()
85 fs.buffer = buffer; in main()
108 fs.buffer = buffer; in main()
127 fs.buffer = buffer; in main()
/nanopb-2.7.6/tests/oneof_callback/
Ddecode_oneof.c25 uint8_t buffer[64]; in SubMsg3_callback() local
28 if (strlen > sizeof(buffer) - 1) in SubMsg3_callback()
31 buffer[strlen] = '\0'; in SubMsg3_callback()
33 if (!pb_read(istream, buffer, strlen)) in SubMsg3_callback()
36 printf(" strvalue: \"%s\"\n", buffer); in SubMsg3_callback()
57 uint8_t buffer[64]; in print_string() local
60 if (strlen > sizeof(buffer) - 1) in print_string()
63 buffer[strlen] = '\0'; in print_string()
65 if (!pb_read(stream, buffer, strlen)) in print_string()
71 printf((char*)*arg, buffer); in print_string()
[all …]
/nanopb-2.7.6/tests/regression/issue_395/
Dtest.c12 uint8_t buffer[512] = {0}; in main() local
19 ostream = pb_ostream_from_buffer(buffer, sizeof(buffer)); in main()
28 printf("%02X", buffer[i]); in main()
33 TEST(buffer[0] == 0x08); in main()
34 TEST(buffer[1] == 0x01); in main()
/nanopb-2.7.6/tests/missing_fields/
Dmissing_fields.c10 uint8_t buffer[512]; in main() local
16 pb_ostream_t stream = pb_ostream_from_buffer(buffer, sizeof(buffer)); in main()
30 pb_istream_t stream = pb_istream_from_buffer(buffer, size); in main()
42 pb_istream_t stream = pb_istream_from_buffer(buffer, size); in main()
/nanopb-2.7.6/tests/basic_buffer/
Dencode_buffer.c13 uint8_t buffer[Person_size]; in main() local
23 stream = pb_ostream_from_buffer(buffer, sizeof(buffer)); in main()
30 fwrite(buffer, 1, stream.bytes_written, stdout); in main()
Ddecode_buffer.c63 uint8_t buffer[Person_size]; in main() local
69 count = fread(buffer, 1, sizeof(buffer), stdin); in main()
78 stream = pb_istream_from_buffer(buffer, count); in main()
/nanopb-2.7.6/tests/regression/issue_504/
Dtest.c14 uint8_t buffer[512] = {0}; in main() local
23 ostream = pb_ostream_from_buffer(buffer, sizeof(buffer)); in main()
43 printf("%02X", buffer[i]); in main()
58 ostream = pb_ostream_from_buffer(buffer, sizeof(buffer)); in main()
69 printf("%02X", buffer[i]); in main()
/nanopb-2.7.6/examples/cmake_simple/
Dsimple.c9 uint8_t buffer[128]; in main() local
25 pb_ostream_t stream = pb_ostream_from_buffer(buffer, sizeof(buffer)); in main()
53 pb_istream_t stream = pb_istream_from_buffer(buffer, message_length); in main()
/nanopb-2.7.6/examples/simple/
Dsimple.c9 uint8_t buffer[128]; in main() local
25 pb_ostream_t stream = pb_ostream_from_buffer(buffer, sizeof(buffer)); in main()
53 pb_istream_t stream = pb_istream_from_buffer(buffer, message_length); in main()
/nanopb-2.7.6/examples/cmake_relpath/
Dsimple.c9 uint8_t buffer[128]; in main() local
25 pb_ostream_t stream = pb_ostream_from_buffer(buffer, sizeof(buffer)); in main()
54 pb_istream_t stream = pb_istream_from_buffer(buffer, message_length); in main()
/nanopb-2.7.6/tests/regression/issue_376/
Dtest_fixarray.c12 uint8_t buffer[64]; in main() local
16 pb_ostream_t stream = pb_ostream_from_buffer(buffer, sizeof(buffer)); in main()
29 pb_istream_t stream = pb_istream_from_buffer(buffer, msglen); in main()
/nanopb-2.7.6/tests/encode_unittests/
Dencode_unittests.c43 memset(buffer, 0xAA, sizeof(buffer)), \
44 s = pb_ostream_from_buffer(buffer, sizeof(buffer)), \
46 memcmp(buffer, y, sizeof(y) - 1) == 0 && \
47 buffer[sizeof(y) - 1] == 0xAA
76 uint8_t buffer[30]; in main() local
89 uint8_t buffer[50]; in main() local
111 uint8_t buffer[50]; in main() local
134 uint8_t buffer[30]; in main() local
143 uint8_t buffer[30]; in main() local
163 uint8_t buffer[30]; in main() local
[all …]
/nanopb-2.7.6/tests/extensions/
Dencode_extensions.c14 uint8_t buffer[1024]; in main() local
35 stream = pb_ostream_from_buffer(buffer, sizeof(buffer)); in main()
41 fwrite(buffer, 1, stream.bytes_written, stdout); in main()
Ddecode_extensions.c14 uint8_t buffer[1024]; in main() local
27 count = fread(buffer, 1, sizeof(buffer), stdin); in main()
28 stream = pb_istream_from_buffer(buffer, count); in main()
/nanopb-2.7.6/tests/map/
Dencode_map.c11 uint8_t buffer[MyMessage_size]; in main() local
24 stream = pb_ostream_from_buffer(buffer, sizeof(buffer)); in main()
29 fwrite(buffer, 1, stream.bytes_written, stdout); in main()
/nanopb-2.7.6/tests/callbacks/
Ddecode_callbacks.c12 uint8_t buffer[1024] = {0}; in print_string() local
15 if (stream->bytes_left > sizeof(buffer) - 1) in print_string()
18 if (!pb_read(stream, buffer, stream->bytes_left)) in print_string()
24 printf((char*)*arg, buffer); in print_string()
60 uint8_t buffer[1024]; in main() local
70 length = fread(buffer, 1, 1024, stdin); in main()
71 stream = pb_istream_from_buffer(buffer, length); in main()
/nanopb-2.7.6/tests/any_type/
Ddecode_any.c12 uint8_t buffer[256]; in main() local
19 count = fread(buffer, 1, sizeof(buffer), stdin); in main()
20 stream = pb_istream_from_buffer(buffer, count); in main()
Dencode_any.c13 uint8_t buffer[256]; in main() local
33 stream = pb_ostream_from_buffer(buffer, sizeof(buffer)); in main()
38 fwrite(buffer, 1, stream.bytes_written, stdout); in main()
/nanopb-2.7.6/tests/regression/issue_363/
Dtest_oneofmsg.c12 uint8_t buffer[512]; in main() local
16 pb_ostream_t stream = pb_ostream_from_buffer(buffer, sizeof(buffer)); in main()
30 pb_istream_t stream = pb_istream_from_buffer(buffer, msglen); in main()
/nanopb-2.7.6/tests/mem_release/
Dmem_release.c45 uint8_t buffer[256]; in test_TestMessage() local
55 stream = pb_ostream_from_buffer(buffer, sizeof(buffer)); in test_TestMessage()
66 fwrite(buffer, 1, msgsize, stdout); in test_TestMessage()
82 stream = pb_istream_from_buffer(buffer, msgsize); in test_TestMessage()
95 TEST(memcmp(buffer, buffer2, msgsize) == 0); in test_TestMessage()
116 uint8_t buffer[256]; in test_OneofMessage() local
120 pb_ostream_t stream = pb_ostream_from_buffer(buffer, sizeof(buffer)); in test_OneofMessage()
178 pb_istream_t stream = pb_istream_from_buffer(buffer, msgsize); in test_OneofMessage()
213 const uint8_t buffer[] = "I'm only happy when it rains"; in test_Garbage() local
214 const size_t msgsize = sizeof(buffer); in test_Garbage()
[all …]
/nanopb-2.7.6/tests/fuzztest/
Dflakystream.c18 memcpy(buf, state->buffer + state->position, count); in flakystream_callback()
23 void flakystream_init(flakystream_t *stream, const uint8_t *buffer, size_t msglen, size_t fail_afte… in flakystream_init() argument
29 stream->buffer = buffer; in flakystream_init()
Dfuzztest.c65 static bool do_decode(const uint8_t *buffer, size_t msglen, size_t structsize, const pb_msgdesc_t *… in do_decode() argument
90 stream = pb_istream_from_buffer(buffer, msglen); in do_decode()
112 static bool do_stream_decode(const uint8_t *buffer, size_t msglen, size_t fail_after, size_t struct… in do_stream_decode() argument
121 flakystream_init(&stream, buffer, msglen, fail_after); in do_stream_decode()
160 bool do_callback_decode(const uint8_t *buffer, size_t msglen, bool assert_success) in do_callback_decode() argument
169 stream = pb_istream_from_buffer(buffer, msglen); in do_callback_decode()
198 void do_roundtrip(const uint8_t *buffer, size_t msglen, size_t structsize, const pb_msgdesc_t *msgt… in do_roundtrip() argument
229 pb_istream_t stream = pb_istream_from_buffer(buffer, msglen); in do_roundtrip()
364 static bool generate_base_message(uint8_t *buffer, size_t *msglen) in generate_base_message() argument
380 stream = pb_ostream_from_buffer(buffer, g_bufsize); in generate_base_message()
[all …]
/nanopb-2.7.6/tests/regression/issue_342/
Dtest_extensions.c18 uint8_t buffer[64]; in main() local
22 pb_ostream_t stream = pb_ostream_from_buffer(buffer, sizeof(buffer)); in main()
39 pb_istream_t stream = pb_istream_from_buffer(buffer, msglen); in main()

123