summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>2012-10-29 18:55:49 +0200
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>2012-10-29 18:55:49 +0200
commitdb1eefc24bd9d1181dee35683c5fe12329f7d969 (patch)
treecc38ed9ba2fe8ca9b63b1ca9c9077bd9658a0245 /tests
parent0ee4bb96b1e53d16a29869864eff87c8934894ae (diff)
Add option to use short names for enum values.
Update issue 38 Status: FixedInGit
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile6
-rw-r--r--tests/options.expected8
-rw-r--r--tests/options.proto6
3 files changed, 13 insertions, 7 deletions
diff --git a/tests/Makefile b/tests/Makefile
index 434819c3..99e27ffd 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -83,9 +83,9 @@ run_unittests: decode_unittests encode_unittests test_cxxcompile test_encode1 te
./test_missing_fields
test_options: options.pb.h options.expected
- for p in $$(grep . options.expected); do \
- if ! grep -qF "$$p" $<; then \
- echo Expected: $$p; \
+ cat options.expected | while read -r p; do \
+ if ! grep -q "$$p" $<; then \
+ echo Expected: "$$p"; \
exit 1; \
fi \
done
diff --git a/tests/options.expected b/tests/options.expected
index ef74a00d..960daeee 100644
--- a/tests/options.expected
+++ b/tests/options.expected
@@ -1,5 +1,5 @@
-char filesize[20];
-char msgsize[30];
-char fieldsize[40];
+char filesize\[20\];
+char msgsize\[30\];
+char fieldsize\[40\];
pb_callback_t int32_callback;
-
+[^_]EnumValue1 = 1
diff --git a/tests/options.proto b/tests/options.proto
index 6ba7c070..e296bcd1 100644
--- a/tests/options.proto
+++ b/tests/options.proto
@@ -31,3 +31,9 @@ message Message4
required int32 int32_callback = 1 [(nanopb).type = FT_CALLBACK];
}
+// Short enum names
+enum Enum1
+{
+ option (nanopb_enumopt).long_names = false;
+ EnumValue1 = 1;
+}