Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nanopb/nanopb.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>2021-03-22 14:08:46 +0300
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>2021-03-22 14:59:14 +0300
commite7f8c405b3cb124a4dca7045fdd4714b86dd3e56 (patch)
tree6dc16b5e1fdd1e317a4beddde73dab92f0e8d0b5 /tests
parent77e23acc2850568ce788764e33aa908165830492 (diff)
Fix descriptor width calculation for 64-bit types (#644)
Diffstat (limited to 'tests')
-rw-r--r--tests/regression/issue_644/SConscript8
-rw-r--r--tests/regression/issue_644/int64.proto21
2 files changed, 29 insertions, 0 deletions
diff --git a/tests/regression/issue_644/SConscript b/tests/regression/issue_644/SConscript
new file mode 100644
index 0000000..ba8719f
--- /dev/null
+++ b/tests/regression/issue_644/SConscript
@@ -0,0 +1,8 @@
+# Regression test for #644:
+# Generator fails to account for padding when estimating struct size
+
+Import("env")
+
+env.NanopbProto("int64.proto")
+env.Object("int64.pb.c")
+
diff --git a/tests/regression/issue_644/int64.proto b/tests/regression/issue_644/int64.proto
new file mode 100644
index 0000000..0681b8d
--- /dev/null
+++ b/tests/regression/issue_644/int64.proto
@@ -0,0 +1,21 @@
+syntax = "proto2";
+message MessageTest {
+ optional int64 test1 = 1;
+ optional int64 test2 = 2;
+ optional int64 test3 = 3;
+ optional int64 test4 = 4;
+ optional int64 test5 = 5;
+ optional int64 test6 = 6;
+ optional int64 test7 = 7;
+ optional int64 test8 = 8;
+ optional int64 test9 = 9;
+ optional int64 test10 = 10;
+ optional int64 test11 = 11;
+ optional int64 test12 = 12;
+ optional int64 test13 = 13;
+ optional int64 test14 = 14;
+ optional int64 test15 = 15;
+ optional int64 test16 = 16;
+ optional int64 test17 = 17;
+}
+