aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>2012-07-05 20:02:06 +0300
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>2012-07-05 20:02:06 +0300
commitd8bddabb8372d1c684d7cd7cf4bb04131acb9ff1 (patch)
treea9c1c36d7f3c2c64db109d7c07ca247ea4102aff /tests
parent01a155689828574047a8377d595a0ad038c48917 (diff)
Fix bug with .proto without messages (again), and add a test case for it.
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile3
-rw-r--r--tests/no_messages.proto7
2 files changed, 9 insertions, 1 deletions
diff --git a/tests/Makefile b/tests/Makefile
index 24e9ba62..8c063f30 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -1,7 +1,7 @@
CFLAGS=-ansi -Wall -Werror -I .. -g -O0 --coverage
LDFLAGS=--coverage
DEPS=../pb_decode.h ../pb_encode.h ../pb.h person.pb.h callbacks.pb.h unittests.h unittestproto.pb.h alltypes.pb.h missing_fields.pb.h
-TESTS=test_decode1 test_encode1 decode_unittests encode_unittests
+TESTS=test_decode1 test_encode1 decode_unittests encode_unittests test_no_messages
all: breakpoints $(TESTS) run_unittests
@@ -28,6 +28,7 @@ test_encode_callbacks: test_encode_callbacks.o pb_encode.o callbacks.pb.o
test_missing_fields: test_missing_fields.o pb_encode.o pb_decode.o missing_fields.pb.o
decode_unittests: decode_unittests.o pb_decode.o unittestproto.pb.o
encode_unittests: encode_unittests.o pb_encode.o unittestproto.pb.o
+test_no_messages: no_messages.pb.h no_messages.pb.c no_messages.pb.o
%.pb: %.proto
protoc -I. -I../generator -I/usr/include -o$@ $<
diff --git a/tests/no_messages.proto b/tests/no_messages.proto
new file mode 100644
index 00000000..279216b0
--- /dev/null
+++ b/tests/no_messages.proto
@@ -0,0 +1,7 @@
+/* Test that a file without any messages works. */
+
+enum Test {
+ First = 1;
+}
+
+