/external/nanopb-c/tests/alltypes/ |
encode_alltypes.c | 8 #include "alltypes.pb.h" 16 AllTypes alltypes = {0}; local 18 alltypes.req_int32 = -1001; 19 alltypes.req_int64 = -1002; 20 alltypes.req_uint32 = 1003; 21 alltypes.req_uint64 = 1004; 22 alltypes.req_sint32 = -1005; 23 alltypes.req_sint64 = -1006; 24 alltypes.req_bool = true [all...] |
decode_alltypes.c | 10 #include "alltypes.pb.h" 22 AllTypes alltypes; local 25 memset(&alltypes, 0xAA, sizeof(alltypes)); 27 if (!pb_decode(stream, AllTypes_fields, &alltypes)) 30 TEST(alltypes.req_int32 == -1001); 31 TEST(alltypes.req_int64 == -1002); 32 TEST(alltypes.req_uint32 == 1003); 33 TEST(alltypes.req_uint64 == 1004) [all...] |
SConscript | 6 env.NanopbProto(["alltypes", "alltypes.options"]) 7 enc = env.Program(["encode_alltypes.c", "alltypes.pb.c", "$COMMON/pb_encode.o"]) 8 dec = env.Program(["decode_alltypes.c", "alltypes.pb.c", "$COMMON/pb_decode.o"]) 17 ["encode_alltypes.output", "alltypes.proto"], 18 MESSAGE='AllTypes') 20 ["encode_alltypes.output.decoded", "alltypes.proto"], 21 MESSAGE='AllTypes') 28 ["optionals.output", "alltypes.proto"], 29 MESSAGE='AllTypes') [all...] |
/external/nanopb-c/tests/alltypes_pointer/ |
decode_alltypes_pointer.c | 5 #include "alltypes.pb.h" 18 AllTypes alltypes; local 21 memset(&alltypes, 0xAA, sizeof(alltypes)); 23 if (!pb_decode(stream, AllTypes_fields, &alltypes)) 26 TEST(alltypes.req_int32 && *alltypes.req_int32 == -1001); 27 TEST(alltypes.req_int64 && *alltypes.req_int64 == -1002) [all...] |
encode_alltypes_pointer.c | 8 #include "alltypes.pb.h" 105 AllTypes alltypes = {0}; local 107 alltypes.req_int32 = &req_int32; 108 alltypes.req_int64 = &req_int64; 109 alltypes.req_uint32 = &req_uint32; 110 alltypes.req_uint64 = &req_uint64; 111 alltypes.req_sint32 = &req_sint32; 112 alltypes.req_sint64 = &req_sint64; 113 alltypes.req_bool = &req_bool [all...] |
SConscript | 1 # Encode the AllTypes message using pointers for all fields, and verify the 2 # output against the normal AllTypes test case. 23 env.Command("alltypes.proto", "#alltypes/alltypes.proto", c) 25 env.NanopbProto(["alltypes", "alltypes.options"]) 26 enc = env.Program(["encode_alltypes_pointer.c", "alltypes.pb.c", "pb_encode_with_malloc.o"]) 27 dec = env.Program(["decode_alltypes_pointer.c", "alltypes.pb.c", "pb_decode_with_malloc.o"]) 29 # Encode and compare results to non-pointer alltypes test cas [all...] |
/external/nanopb-c/tests/backwards_compatibility/ |
encode_legacy.c | 19 AllTypes alltypes = {0}; local 21 alltypes.req_int32 = -1001; 22 alltypes.req_int64 = -1002; 23 alltypes.req_uint32 = 1003; 24 alltypes.req_uint64 = 1004; 25 alltypes.req_sint32 = -1005; 26 alltypes.req_sint64 = -1006; 27 alltypes.req_bool = true; 29 alltypes.req_fixed32 = 1008 [all...] |
decode_legacy.c | 25 AllTypes alltypes; local 28 memset(&alltypes, 0xAA, sizeof(alltypes)); 30 if (!pb_decode(stream, AllTypes_fields, &alltypes)) 33 TEST(alltypes.req_int32 == -1001); 34 TEST(alltypes.req_int64 == -1002); 35 TEST(alltypes.req_uint32 == 1003); 36 TEST(alltypes.req_uint64 == 1004); 37 TEST(alltypes.req_sint32 == -1005) [all...] |
alltypes_legacy.c | 39 PB_FIELD( 1, INT32 , REQUIRED, STATIC, AllTypes, req_int32, req_int32, 0), 40 PB_FIELD( 2, INT64 , REQUIRED, STATIC, AllTypes, req_int64, req_int32, 0), 41 PB_FIELD( 3, UINT32 , REQUIRED, STATIC, AllTypes, req_uint32, req_int64, 0), 42 PB_FIELD( 4, UINT64 , REQUIRED, STATIC, AllTypes, req_uint64, req_uint32, 0), 43 PB_FIELD( 5, SINT32 , REQUIRED, STATIC, AllTypes, req_sint32, req_uint64, 0), 44 PB_FIELD( 6, SINT64 , REQUIRED, STATIC, AllTypes, req_sint64, req_sint32, 0), 45 PB_FIELD( 7, BOOL , REQUIRED, STATIC, AllTypes, req_bool, req_sint64, 0), 46 PB_FIELD( 8, FIXED32 , REQUIRED, STATIC, AllTypes, req_fixed32, req_bool, 0), 47 PB_FIELD( 9, SFIXED32, REQUIRED, STATIC, AllTypes, req_sfixed32, req_fixed32, 0), 48 PB_FIELD( 10, FLOAT , REQUIRED, STATIC, AllTypes, req_float, req_sfixed32, 0) [all...] |
alltypes_legacy.h | 133 } AllTypes; 162 STATIC_ASSERT((pb_membersize(AllTypes, req_submsg) < 256 && pb_membersize(AllTypes, rep_submsg[0]) < 256 && pb_membersize(AllTypes, opt_submsg) < 256), YOU_MUST_DEFINE_PB_FIELD_16BIT_FOR_MESSAGES_SubMessage_AllTypes) 166 STATIC_ASSERT((pb_membersize(AllTypes, req_submsg) < 65536 && pb_membersize(AllTypes, rep_submsg[0]) < 65536 && pb_membersize(AllTypes, opt_submsg) < 65536), YOU_MUST_DEFINE_PB_FIELD_32BIT_FOR_MESSAGES_SubMessage_AllTypes)
|
/external/nanopb-c/tests/package_name/ |
SConscript | 1 # Check that alltypes test case works also when the .proto file defines 6 # Build a modified alltypes.proto 13 env.Command("alltypes.proto", "#alltypes/alltypes.proto", modify_proto) 14 env.Command("alltypes.options", "#alltypes/alltypes.options", Copy("$TARGET", "$SOURCE")) 15 env.NanopbProto(["alltypes", "alltypes.options"] [all...] |
/external/nanopb-c/tests/extensions/ |
SConscript | 5 # We use the files from the alltypes test case 7 incpath.Append(PROTOCPATH = '$BUILD/alltypes') 8 incpath.Append(CPPPATH = '$BUILD/alltypes') 11 enc = incpath.Program(["encode_extensions.c", "extensions.pb.c", "$BUILD/alltypes/alltypes.pb$OBJSUFFIX", "$COMMON/pb_encode.o"]) 12 dec = incpath.Program(["decode_extensions.c", "extensions.pb.c", "$BUILD/alltypes/alltypes.pb$OBJSUFFIX", "$COMMON/pb_decode.o"])
|
extensions.proto | 1 import 'alltypes.proto'; 3 extend AllTypes { 8 extend AllTypes {
|
decode_extensions.c | 7 #include "alltypes.pb.h" 22 AllTypes alltypes = {0}; local 34 alltypes.extensions = &ext1; 45 if (!pb_decode(&stream, AllTypes_fields, &alltypes))
|
encode_extensions.c | 8 #include "alltypes.pb.h" 17 AllTypes alltypes = {0}; local 24 alltypes.extensions = &ext1; 38 if (pb_encode(&stream, AllTypes_fields, &alltypes))
|
/external/nanopb-c/tests/alltypes_callback/ |
SConscript | 1 # Test the AllTypes encoding & decoding using callbacks for all fields. 6 env.Command("alltypes.proto", "#alltypes/alltypes.proto", c) 8 env.NanopbProto(["alltypes", "alltypes.options"]) 9 enc = env.Program(["encode_alltypes_callback.c", "alltypes.pb.c", "$COMMON/pb_encode.o"]) 10 dec = env.Program(["decode_alltypes_callback.c", "alltypes.pb.c", "$COMMON/pb_decode.o"]) 12 refdec = "$BUILD/alltypes/decode_alltypes$PROGSUFFIX"
|
alltypes.options | 2 AllTypes.* type:FT_CALLBACK
|
decode_alltypes_callback.c | 10 #include "alltypes.pb.h" 219 AllTypes alltypes; local 222 memset(&alltypes, 0xAA, sizeof(alltypes)); 224 alltypes.req_int32.funcs.decode = &read_varint; 225 alltypes.req_int32.arg = (void*)-1001; 227 alltypes.req_int64.funcs.decode = &read_varint; 228 alltypes.req_int64.arg = (void*)-1002; 230 alltypes.req_uint32.funcs.decode = &read_varint [all...] |
encode_alltypes_callback.c | 10 #include "alltypes.pb.h" 206 AllTypes alltypes = {{{0}}}; local 208 alltypes.req_int32.funcs.encode = &write_varint; 209 alltypes.req_int32.arg = (void*)-1001; 211 alltypes.req_int64.funcs.encode = &write_varint; 212 alltypes.req_int64.arg = (void*)-1002; 214 alltypes.req_uint32.funcs.encode = &write_varint; 215 alltypes.req_uint32.arg = (void*)1003; 217 alltypes.req_uint32.funcs.encode = &write_varint [all...] |
/external/nanopb-c/tests/buffer_only/ |
SConscript | 1 # Run the alltypes test case, but compile with PB_BUFFER_ONLY=1 7 env.Command("alltypes.pb.h", "$BUILD/alltypes/alltypes.pb.h", c) 8 env.Command("alltypes.pb.c", "$BUILD/alltypes/alltypes.pb.c", c) 9 env.Command("encode_alltypes.c", "$BUILD/alltypes/encode_alltypes.c", c) 10 env.Command("decode_alltypes.c", "$BUILD/alltypes/decode_alltypes.c", c) 23 enc = opts.Program(["encode_alltypes.c", "alltypes.pb.c", "pb_encode_bufonly.o"] [all...] |
/external/nanopb-c/tests/cxx_main_program/ |
SConscript | 1 # Run the alltypes test case, but compile it as C++ instead. 14 env.Command("alltypes.pb.h", "$BUILD/alltypes/alltypes.pb.h", c) 15 env.Command("alltypes.pb.cxx", "$BUILD/alltypes/alltypes.pb.c", c) 16 env.Command("encode_alltypes.cxx", "$BUILD/alltypes/encode_alltypes.c", c) 17 env.Command("decode_alltypes.cxx", "$BUILD/alltypes/decode_alltypes.c", c) 20 enc = env.Program(["encode_alltypes.cxx", "alltypes.pb.cxx", "pb_encode.cxx"] [all...] |
/external/nanopb-c/tests/no_errmsg/ |
SConscript | 1 # Run the alltypes test case, but compile with PB_NO_ERRMSG=1 7 env.Command("alltypes.pb.h", "$BUILD/alltypes/alltypes.pb.h", c) 8 env.Command("alltypes.pb.c", "$BUILD/alltypes/alltypes.pb.c", c) 9 env.Command("encode_alltypes.c", "$BUILD/alltypes/encode_alltypes.c", c) 10 env.Command("decode_alltypes.c", "$BUILD/alltypes/decode_alltypes.c", c) 23 enc = opts.Program(["encode_alltypes.c", "alltypes.pb.c", "pb_encode_noerr.o"] [all...] |
/external/nanopb-c/tests/field_size_16/ |
SConscript | 1 # Run the alltypes test case, but compile with PB_FIELD_16BIT=1. 8 env.Command("encode_alltypes.c", "$BUILD/alltypes/encode_alltypes.c", c) 9 env.Command("decode_alltypes.c", "$BUILD/alltypes/decode_alltypes.c", c) 11 env.NanopbProto(["alltypes", "alltypes.options"]) 24 enc = opts.Program(["encode_alltypes.c", "alltypes.pb.c", "pb_encode_fields16.o"]) 25 dec = opts.Program(["decode_alltypes.c", "alltypes.pb.c", "pb_decode_fields16.o"])
|
/external/nanopb-c/tests/field_size_32/ |
SConscript | 1 # Run the alltypes test case, but compile with PB_FIELD_32BIT=1. 8 env.Command("encode_alltypes.c", "$BUILD/alltypes/encode_alltypes.c", c) 9 env.Command("decode_alltypes.c", "$BUILD/alltypes/decode_alltypes.c", c) 11 env.NanopbProto(["alltypes", "alltypes.options"]) 24 enc = opts.Program(["encode_alltypes.c", "alltypes.pb.c", "pb_encode_fields32.o"]) 25 dec = opts.Program(["decode_alltypes.c", "alltypes.pb.c", "pb_decode_fields32.o"])
|
/external/nanopb-c/tests/extra_fields/ |
SConscript | 13 # This uses the backwards compatibility alltypes test, so that
|