mirror of
https://github.com/google/pebble.git
synced 2025-08-31 23:25:44 -04:00
Import of the watch repository from Pebble
This commit is contained in:
commit
3b92768480
10334 changed files with 2564465 additions and 0 deletions
8
third_party/nanopb/tests/regression/issue_631/SConscript
vendored
Normal file
8
third_party/nanopb/tests/regression/issue_631/SConscript
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
# Regression test for #631:
|
||||
# Wrong initializer generation
|
||||
|
||||
Import("env")
|
||||
|
||||
env.NanopbProto("submsg_callback.proto")
|
||||
t = env.Program(["test.c", "submsg_callback.pb.c", "$COMMON/pb_common.o"])
|
||||
env.RunTest(t)
|
22
third_party/nanopb/tests/regression/issue_631/submsg_callback.proto
vendored
Normal file
22
third_party/nanopb/tests/regression/issue_631/submsg_callback.proto
vendored
Normal file
|
@ -0,0 +1,22 @@
|
|||
syntax = "proto2";
|
||||
|
||||
import 'nanopb.proto';
|
||||
|
||||
message SubMsg1 {
|
||||
optional float number1 = 1 [default = 1];
|
||||
}
|
||||
|
||||
message SubMsg2 {
|
||||
repeated uint32 number2 = 1;
|
||||
}
|
||||
|
||||
message SubMsgCB {
|
||||
option (nanopb_msgopt).submsg_callback = true;
|
||||
repeated SubMsg1 field1 = 1;
|
||||
oneof data {
|
||||
uint32 uint = 2;
|
||||
sint32 sint = 3 [default = 3];
|
||||
SubMsg2 vuint = 4;
|
||||
}
|
||||
}
|
||||
|
14
third_party/nanopb/tests/regression/issue_631/test.c
vendored
Normal file
14
third_party/nanopb/tests/regression/issue_631/test.c
vendored
Normal file
|
@ -0,0 +1,14 @@
|
|||
#include "submsg_callback.pb.h"
|
||||
|
||||
SubMsg1 submsg1_zero = SubMsg1_init_zero;
|
||||
SubMsg1 submsg1_def = SubMsg1_init_default;
|
||||
SubMsg2 submsg2_zero = SubMsg2_init_zero;
|
||||
SubMsg2 submsg2_def = SubMsg2_init_default;
|
||||
SubMsgCB submsgcb_zero = SubMsgCB_init_zero;
|
||||
SubMsgCB submsgcb_def = SubMsgCB_init_default;
|
||||
|
||||
int main()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue