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>2022-04-13 12:04:20 +0300
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>2022-04-13 12:04:20 +0300
commitb574ac5aedbc72e3b47030e67d88e28b56ad79e0 (patch)
treed180c9c4cbc93436744a11bdb79c214ec8a1a193 /tests
parent3125f8d438c4459937374e95e1c6a03079b1b53c (diff)
Cleanup comments, add test for default behavior (#772, #773)
Diffstat (limited to 'tests')
-rw-r--r--tests/fallback_type/SConscript6
-rw-r--r--tests/fallback_type/fallback_type.expected1
-rw-r--r--tests/fallback_type/fallback_type.options2
-rw-r--r--tests/fallback_type/fallback_type.proto1
4 files changed, 4 insertions, 6 deletions
diff --git a/tests/fallback_type/SConscript b/tests/fallback_type/SConscript
index 22a7b1e..98dfd74 100644
--- a/tests/fallback_type/SConscript
+++ b/tests/fallback_type/SConscript
@@ -1,11 +1,7 @@
-# Test fallback type
+# Test fallback_type option
Import("env")
-# the scons version on ubuntu honours this env - debians version does not
-# env['NANOPB_GENERATOR'] = env['NANOPB_GENERATOR'] + "-sfallback_type:FT_POINTER"
-# env.SetDefault(PROTOCFLAGS = "--plugin=protoc-gen-nanopb=foo")
-# so we also use an options file:
env.NanopbProto(["fallback_type","fallback_type.options"])
env.Object("fallback_type.pb.c")
env.Match(['fallback_type.pb.h', 'fallback_type.expected'])
diff --git a/tests/fallback_type/fallback_type.expected b/tests/fallback_type/fallback_type.expected
index 3eff62b..05d72d0 100644
--- a/tests/fallback_type/fallback_type.expected
+++ b/tests/fallback_type/fallback_type.expected
@@ -1,2 +1,3 @@
int32_t member1;
char \*member2
+pb_callback_t member3
diff --git a/tests/fallback_type/fallback_type.options b/tests/fallback_type/fallback_type.options
index 29eddfa..8db3189 100644
--- a/tests/fallback_type/fallback_type.options
+++ b/tests/fallback_type/fallback_type.options
@@ -1 +1 @@
-fallback_type.proto fallback_type:FT_POINTER \ No newline at end of file
+Message1.member2 fallback_type:FT_POINTER
diff --git a/tests/fallback_type/fallback_type.proto b/tests/fallback_type/fallback_type.proto
index 97d069b..2e1dc0a 100644
--- a/tests/fallback_type/fallback_type.proto
+++ b/tests/fallback_type/fallback_type.proto
@@ -4,5 +4,6 @@ message Message1
{
required int32 member1 = 1; // must remain as int
required string member2 = 2; // must become a pointer
+ required string member3 = 3; // must become pb_callback_t
}