Home
last modified time | relevance | path

Searched refs:s (Results 1 – 25 of 39) sorted by relevance

12

/nanopb-3.4.0/tests/decode_unittests/
Ddecode_unittests.c76 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/
Dencode_unittests.c44 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/
Dtestproto.expected1 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
Dtestproto.proto34 required string s = 3 [(nanopb).max_length = 32]; field
/nanopb-3.4.0/tests/regression/issue_166/
Denum_encoded_size.c14 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/
Drandom_data.c62 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 …]
Dossfuzz.sh15 build/fuzztest/generate_message $(date +%s) > fuzztest_seed_corpus/rndmsg 2>/dev/null
/nanopb-3.4.0/
Dpb_common.c336 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 …]
Dpb_decode.h105 #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
Dpb_encode.h86 #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
Dpb_common.h41 bool pb_validate_utf8(const char *s);
/nanopb-3.4.0/tests/enum_sizes/
Denumsizes_unittests.c26 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/
Dpb_decode.h105 #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
Dpb_encode.h86 #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
Dpb_common.h41 bool pb_validate_utf8(const char *s);
/nanopb-3.4.0/extra/
Dpb_syshdr.h80 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/
Duint8.expected1 ! ^\s*[^/* ].*uint8_t
2 ! ^\s*[^/* ].*int8_t
/nanopb-3.4.0/tests/intsizes/
Dintsizes_unittests.c36 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/
Doptions_h.expected15 \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/
Dfirst.expected1 define First_size\s*4
/nanopb-3.4.0/tests/cxx_callback_datatype/
DSConscript26 objects = [ e.Object('{}_{}'.format(os.path.basename(s), std), s) for s in sources ]
/nanopb-3.4.0/tests/site_scons/platforms/stm32/
Drun_test.sh10 timeout 1200s openocd -f $OPENOCD_BOARD \
/nanopb-3.4.0/tests/regression/issue_795/
DSConscript9 opts.Append(NANOPBFLAGS = "-s mangle_names=M_STRIP_PACKAGE")
/nanopb-3.4.0/tests/splint/
Dsplint.rc14 # splint's memory checks don't quite work without annotations
/nanopb-3.4.0/tests/any_type/google/protobuf/
Dduration.proto1 // 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".

12