mirror of
https://github.com/google/pebble
synced 2026-10-18 01:04:12 +02:00
Import of the watch repository from Pebble
This commit is contained in:
@@ -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)
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user