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,10 @@
|
||||
syntax = "proto3";
|
||||
|
||||
import "LogMessage.proto";
|
||||
|
||||
message DataPacket {
|
||||
oneof packet {
|
||||
LogMessage log_message = 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
syntax = "proto3";
|
||||
|
||||
message LogMessage {
|
||||
string msg = 1;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
# Regression test for #610:
|
||||
# Error "'dict_values' object does not support indexing" while compiling .proto files
|
||||
|
||||
Import("env")
|
||||
|
||||
# First the simple case with two files
|
||||
env.NanopbProto("LogMessage.proto")
|
||||
env.NanopbProto(["DataPacket.proto", "LogMessage.proto"])
|
||||
env.Object("LogMessage.pb.c")
|
||||
env.Object("DataPacket.pb.c")
|
||||
|
||||
# Then the complex hierarchy case
|
||||
all_files = [
|
||||
'nanopb_generator_bug/first/a/aa.proto',
|
||||
'nanopb_generator_bug/first/a/ab.proto',
|
||||
'nanopb_generator_bug/first/a.proto',
|
||||
'nanopb_generator_bug/first/b/ba.proto',
|
||||
'nanopb_generator_bug/first/b.proto',
|
||||
'nanopb_generator_bug/first.proto'
|
||||
]
|
||||
|
||||
env2 = env.Clone()
|
||||
env2.Append(CPPPATH = "$BUILD/regression/issue_610")
|
||||
|
||||
for f in all_files:
|
||||
env2.NanopbProto([f] + all_files)
|
||||
|
||||
for f in all_files:
|
||||
env2.Object(f.replace('.proto', '.pb.c'))
|
||||
|
||||
env2.Match(["nanopb_generator_bug/first.pb.h", "first.expected"])
|
||||
@@ -0,0 +1,2 @@
|
||||
define First_size\s*4
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
syntax="proto3";
|
||||
|
||||
import "nanopb_generator_bug/first/a.proto";
|
||||
import "nanopb_generator_bug/first/b.proto";
|
||||
|
||||
message First {
|
||||
oneof oneof_first {
|
||||
first.A obj_a = 1;
|
||||
first.B obj_b = 2;
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
syntax="proto3";
|
||||
|
||||
package first;
|
||||
|
||||
import "nanopb_generator_bug/first/a/aa.proto";
|
||||
import "nanopb_generator_bug/first/a/ab.proto";
|
||||
|
||||
message A {
|
||||
oneof oneof_a {
|
||||
a.A obj_a = 1;
|
||||
a.B obj_b = 2;
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
syntax="proto3";
|
||||
|
||||
package first.a;
|
||||
|
||||
message A {}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
syntax="proto3";
|
||||
|
||||
package first.a;
|
||||
|
||||
message B {}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
syntax="proto3";
|
||||
|
||||
package first;
|
||||
|
||||
import "nanopb_generator_bug/first/b/ba.proto";
|
||||
|
||||
message B {
|
||||
oneof oneof_b {
|
||||
b.A obj_a = 1;
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
syntax="proto3";
|
||||
|
||||
package first.b;
|
||||
|
||||
message A {}
|
||||
Reference in New Issue
Block a user