summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>2012-11-14 00:20:44 +0200
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>2012-11-14 00:36:16 +0200
commit02ecee2de89f3225a6cd4bf87b0e4285bb1d06eb (patch)
tree47bef1d3142a2035500cb2ea74aab5218a1885f9 /tests
parent332a9ee95c38db4537d0a33e58fef617d3e1d589 (diff)
Fix naming of enums when long_names=false.
Modify test case to check that options.pb.o compiles. Update issue 42 Status: FixedInGit Update issue 43 Status: FixedInGit
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile2
-rw-r--r--tests/options.expected2
-rw-r--r--tests/options.proto6
3 files changed, 8 insertions, 2 deletions
diff --git a/tests/Makefile b/tests/Makefile
index 99e27ffd..1f2be716 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -82,7 +82,7 @@ run_unittests: decode_unittests encode_unittests test_cxxcompile test_encode1 te
./test_missing_fields
-test_options: options.pb.h options.expected
+test_options: options.pb.h options.expected options.pb.o
cat options.expected | while read -r p; do \
if ! grep -q "$$p" $<; then \
echo Expected: "$$p"; \
diff --git a/tests/options.expected b/tests/options.expected
index 960daeee..61d9805e 100644
--- a/tests/options.expected
+++ b/tests/options.expected
@@ -2,4 +2,4 @@ char filesize\[20\];
char msgsize\[30\];
char fieldsize\[40\];
pb_callback_t int32_callback;
-[^_]EnumValue1 = 1
+\sEnumValue1 = 1
diff --git a/tests/options.proto b/tests/options.proto
index e296bcd1..7eb2eb30 100644
--- a/tests/options.proto
+++ b/tests/options.proto
@@ -36,4 +36,10 @@ enum Enum1
{
option (nanopb_enumopt).long_names = false;
EnumValue1 = 1;
+ EnumValue2 = 2;
+}
+
+message EnumTest
+{
+ required Enum1 field = 1 [default = EnumValue2];
}