/nanopb-3.4.0/tests/decode_unittests/ |
D | decode_unittests.c | 76 pb_istream_t s; in main() local 81 TEST((s = S("\x00"), pb_decode_varint(&s, &u) && u == 0)); in main() 82 TEST((s = S("\x01"), pb_decode_varint(&s, &u) && u == 1)); in main() 83 TEST((s = S("\xAC\x02"), pb_decode_varint(&s, &u) && u == 300)); in main() 84 TEST((s = S("\xFF\xFF\xFF\xFF\x0F"), pb_decode_varint(&s, &u) && u == UINT32_MAX)); in main() 85 … TEST((s = S("\xFF\xFF\xFF\xFF\x0F"), pb_decode_varint(&s, (uint64_t*)&i) && i == UINT32_MAX)); in main() 86 TEST((s = S("\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x01"), in main() 87 pb_decode_varint(&s, (uint64_t*)&i) && i == -1)); in main() 88 TEST((s = S("\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x01"), in main() 89 pb_decode_varint(&s, &u) && u == UINT64_MAX)); in main() [all …]
|
/nanopb-3.4.0/tests/encode_unittests/ |
D | encode_unittests.c | 44 s = pb_ostream_from_buffer(buffer, sizeof(buffer)), \ 77 pb_ostream_t s; in main() local 80 TEST(WRITES(pb_encode_varint(&s, 0), "\0")); in main() 81 TEST(WRITES(pb_encode_varint(&s, 1), "\1")); in main() 82 TEST(WRITES(pb_encode_varint(&s, 0x7F), "\x7F")); in main() 83 TEST(WRITES(pb_encode_varint(&s, 0x80), "\x80\x01")); in main() 84 TEST(WRITES(pb_encode_varint(&s, UINT32_MAX), "\xFF\xFF\xFF\xFF\x0F")); in main() 85 TEST(WRITES(pb_encode_varint(&s, UINT64_MAX), "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x01")); in main() 90 pb_ostream_t s; in main() local 93 TEST(WRITES(pb_encode_varint(&s, 0x00000000), "\x00")); in main() [all …]
|
/nanopb-3.4.0/tests/regression/issue_141/ |
D | testproto.expected | 1 define SubMessage_size \s* 88 2 define OneOfMessage_size \s* 113 3 define topMessage_size \s* 70 4 define MyMessage1_size \s* 46 5 define MyMessage2_size \s* 8 6 define MyMessage3_size \s* 5 7 define MyMessage4_size \s* 18
|
D | testproto.proto | 34 required string s = 3 [(nanopb).max_length = 32]; field
|
/nanopb-3.4.0/tests/regression/issue_166/ |
D | enum_encoded_size.c | 14 pb_ostream_t s; in main() local 20 s = pb_ostream_from_buffer(buf, sizeof(buf)); in main() 21 TEST(pb_encode(&s, SignedMsg_fields, &msg1)); in main() 22 TEST(s.bytes_written == SignedMsg_size); in main() 27 s = pb_ostream_from_buffer(buf, sizeof(buf)); in main() 28 TEST(pb_encode(&s, SignedMsg_fields, &msg1)); in main() 29 TEST(s.bytes_written < SignedMsg_size); in main() 36 s = pb_ostream_from_buffer(buf, sizeof(buf)); in main() 37 TEST(pb_encode(&s, UnsignedMsg_fields, &msg2)); in main() 38 TEST(s.bytes_written == UnsignedMsg_size); in main()
|
/nanopb-3.4.0/tests/fuzztest/ |
D | random_data.c | 62 size_t s; in rand_len() local 70 s = (w % max); in rand_len() 71 if (s == 0) in rand_len() 72 s = 1; in rand_len() 74 return s; in rand_len() 146 int s = rand_int(0, count - 1); in rand_mess() local 147 int l = rand_len(count - s); in rand_mess() 148 rand_fill(buf + s, l); in rand_mess() 162 int s = rand_int(0, count - 2); in rand_mess() local 163 int l = rand_len((count - s) / 2); in rand_mess() [all …]
|
D | ossfuzz.sh | 15 build/fuzztest/generate_message $(date +%s) > fuzztest_seed_corpus/rndmsg 2>/dev/null
|
/nanopb-3.4.0/ |
D | pb_common.c | 336 const pb_byte_t *s = (const pb_byte_t*)str; in pb_validate_utf8() local 337 while (*s) in pb_validate_utf8() 339 if (*s < 0x80) in pb_validate_utf8() 342 s++; in pb_validate_utf8() 344 else if ((s[0] & 0xe0) == 0xc0) in pb_validate_utf8() 347 if ((s[1] & 0xc0) != 0x80 || in pb_validate_utf8() 348 (s[0] & 0xfe) == 0xc0) /* overlong? */ in pb_validate_utf8() 351 s += 2; in pb_validate_utf8() 353 else if ((s[0] & 0xf0) == 0xe0) in pb_validate_utf8() 356 if ((s[1] & 0xc0) != 0x80 || in pb_validate_utf8() [all …]
|
D | pb_decode.h | 105 #define pb_decode_noinit(s,f,d) pb_decode_ex(s,f,d, PB_DECODE_NOINIT) argument 106 #define pb_decode_delimited(s,f,d) pb_decode_ex(s,f,d, PB_DECODE_DELIMITED) argument 107 #define pb_decode_delimited_noinit(s,f,d) pb_decode_ex(s,f,d, PB_DECODE_DELIMITED | PB_DECODE_NOINI… argument 108 #define pb_decode_nullterminated(s,f,d) pb_decode_ex(s,f,d, PB_DECODE_NULLTERMINATED) argument
|
D | pb_encode.h | 86 #define pb_encode_delimited(s,f,d) pb_encode_ex(s,f,d, PB_ENCODE_DELIMITED) argument 87 #define pb_encode_nullterminated(s,f,d) pb_encode_ex(s,f,d, PB_ENCODE_NULLTERMINATED) argument
|
D | pb_common.h | 41 bool pb_validate_utf8(const char *s);
|
/nanopb-3.4.0/tests/enum_sizes/ |
D | enumsizes_unittests.c | 26 pb_ostream_t s = pb_ostream_from_buffer(buf, sizeof(buf)); in main() local 27 TEST(pb_encode(&s, UnpackedEnums_fields, &msg1)); in main() 28 msgsize = s.bytes_written; in main() 33 pb_istream_t s = pb_istream_from_buffer(buf, msgsize); in main() local 34 TEST(pb_decode(&s, PackedEnums_fields, &msg2)); in main() 48 pb_ostream_t s = pb_ostream_from_buffer(buf, sizeof(buf)); in main() local 49 TEST(pb_encode(&s, PackedEnums_fields, &msg2)); in main() 50 msgsize = s.bytes_written; in main() 55 pb_istream_t s = pb_istream_from_buffer(buf, msgsize); in main() local 56 TEST(pb_decode(&s, UnpackedEnums_fields, &msg3)); in main()
|
/nanopb-3.4.0/spm_headers/nanopb/ |
D | pb_decode.h | 105 #define pb_decode_noinit(s,f,d) pb_decode_ex(s,f,d, PB_DECODE_NOINIT) argument 106 #define pb_decode_delimited(s,f,d) pb_decode_ex(s,f,d, PB_DECODE_DELIMITED) argument 107 #define pb_decode_delimited_noinit(s,f,d) pb_decode_ex(s,f,d, PB_DECODE_DELIMITED | PB_DECODE_NOINI… argument 108 #define pb_decode_nullterminated(s,f,d) pb_decode_ex(s,f,d, PB_DECODE_NULLTERMINATED) argument
|
D | pb_encode.h | 86 #define pb_encode_delimited(s,f,d) pb_encode_ex(s,f,d, PB_ENCODE_DELIMITED) argument 87 #define pb_encode_nullterminated(s,f,d) pb_encode_ex(s,f,d, PB_ENCODE_NULLTERMINATED) argument
|
D | pb_common.h | 41 bool pb_validate_utf8(const char *s);
|
/nanopb-3.4.0/extra/ |
D | pb_syshdr.h | 80 static size_t strlen( const char * s ) in strlen() argument 83 while ( s[rc] ) in strlen() 101 static void * memset( void * s, int c, size_t n ) in memset() argument 103 unsigned char * p = (unsigned char *) s; in memset() 108 return s; in memset()
|
/nanopb-3.4.0/tests/regression/issue_485/ |
D | uint8.expected | 1 ! ^\s*[^/* ].*uint8_t 2 ! ^\s*[^/* ].*int8_t
|
/nanopb-3.4.0/tests/intsizes/ |
D | intsizes_unittests.c | 36 pb_ostream_t s = pb_ostream_from_buffer(buffer1, sizeof(buffer1)); \ 37 TEST(pb_encode(&s, DefaultSizes_fields, &msg1)); \ 38 msgsize = s.bytes_written; \ 42 pb_istream_t s = pb_istream_from_buffer(buffer1, msgsize); \ 43 TEST(pb_decode(&s, IntSizes_fields, &msg2) == expected_result); \ 63 pb_ostream_t s = pb_ostream_from_buffer(buffer2, sizeof(buffer2)); \ 64 TEST(pb_encode(&s, IntSizes_fields, &msg2)); \ 65 TEST(s.bytes_written == msgsize); \ 121 pb_ostream_t s = pb_ostream_from_buffer(buffer, sizeof(buffer)); in main() local 137 TEST(pb_encode(&s, IntSizes_fields, &msg)); in main() [all …]
|
/nanopb-3.4.0/tests/options/ |
D | options_h.expected | 15 \s+PB_MSG\(103,[0-9]*,Message3\) \\ 16 \s+PB_MSG\(104,-1,Message4\) \\ 17 \s+PB_MSG\(105,[0-9]*,Message5\) \\
|
/nanopb-3.4.0/tests/regression/issue_610/ |
D | first.expected | 1 define First_size\s*4
|
/nanopb-3.4.0/tests/cxx_callback_datatype/ |
D | SConscript | 26 objects = [ e.Object('{}_{}'.format(os.path.basename(s), std), s) for s in sources ]
|
/nanopb-3.4.0/tests/site_scons/platforms/stm32/ |
D | run_test.sh | 10 timeout 1200s openocd -f $OPENOCD_BOARD \
|
/nanopb-3.4.0/tests/regression/issue_795/ |
D | SConscript | 9 opts.Append(NANOPBFLAGS = "-s mangle_names=M_STRIP_PACKAGE")
|
/nanopb-3.4.0/tests/splint/ |
D | splint.rc | 14 # splint's memory checks don't quite work without annotations
|
/nanopb-3.4.0/tests/any_type/google/protobuf/ |
D | duration.proto | 1 // Protocol Buffers - Google's data interchange format 95 // object, where the string ends in the suffix "s" (indicating seconds) and 98 // encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should 99 // be expressed in JSON format as "3.000000001s", and 3 seconds and 1 100 // microsecond should be expressed in JSON format as "3.000001s".
|