summaryrefslogtreecommitdiffstats
path: root/tests/multiple_files
diff options
context:
space:
mode:
Diffstat (limited to 'tests/multiple_files')
-rw-r--r--tests/multiple_files/callbacks.proto16
-rw-r--r--tests/multiple_files/callbacks2.proto9
-rw-r--r--tests/multiple_files/test_multiple_files.c13
3 files changed, 38 insertions, 0 deletions
diff --git a/tests/multiple_files/callbacks.proto b/tests/multiple_files/callbacks.proto
new file mode 100644
index 00000000..ccd1edd8
--- /dev/null
+++ b/tests/multiple_files/callbacks.proto
@@ -0,0 +1,16 @@
+message SubMessage {
+ optional string stringvalue = 1;
+ repeated int32 int32value = 2;
+ repeated fixed32 fixed32value = 3;
+ repeated fixed64 fixed64value = 4;
+}
+
+message TestMessage {
+ optional string stringvalue = 1;
+ repeated int32 int32value = 2;
+ repeated fixed32 fixed32value = 3;
+ repeated fixed64 fixed64value = 4;
+ optional SubMessage submsg = 5;
+ repeated string repeatedstring = 6;
+}
+
diff --git a/tests/multiple_files/callbacks2.proto b/tests/multiple_files/callbacks2.proto
new file mode 100644
index 00000000..9a55e15a
--- /dev/null
+++ b/tests/multiple_files/callbacks2.proto
@@ -0,0 +1,9 @@
+// Test if including generated header file for this file + implicit include of
+// callbacks.pb.h still compiles. Used with test_compiles.c.
+import "callbacks.proto";
+
+message Callback2Message {
+ required TestMessage tstmsg = 1;
+ required SubMessage submsg = 2;
+}
+
diff --git a/tests/multiple_files/test_multiple_files.c b/tests/multiple_files/test_multiple_files.c
new file mode 100644
index 00000000..cb4e16d3
--- /dev/null
+++ b/tests/multiple_files/test_multiple_files.c
@@ -0,0 +1,13 @@
+/*
+ * Tests if still compile if typedefs are redfefined in STATIC_ASSERTS when
+ * proto file includes another poto file
+ */
+
+#include <stdio.h>
+#include <pb_encode.h>
+#include "callbacks2.pb.h"
+
+int main()
+{
+ return 0;
+}