Improve the person_with_extra_field test.
[apps/agl-service-can-low-level.git] / tests / Makefile
index 3810c95..7656175 100644 (file)
@@ -4,13 +4,16 @@ DEPS=../pb_decode.h ../pb_encode.h ../pb.h person.pb.h callbacks.pb.h unittests.
 TESTS=test_decode1 test_encode1 decode_unittests encode_unittests test_no_messages
 
 # More strict checks for the core part of nanopb
-CFLAGS_CORE=-pedantic -Wextra -Wcast-qual -Wlogical-op
+CFLAGS_CORE=-pedantic -Wextra -Wcast-qual -Wlogical-op -Wconversion
 
 all: breakpoints $(TESTS) run_unittests
 
 clean:
        rm -f $(TESTS) person.pb* alltypes.pb* *.o *.gcda *.gcno
 
+%.pb.o: %.pb.c %.pb.h
+       $(CC) $(CFLAGS) $(CFLAGS_CORE) -c -o $@ $<
+
 %.o: %.c
 %.o: %.c $(DEPS)
        $(CC) $(CFLAGS) -c -o $@ $<
@@ -67,6 +70,9 @@ run_unittests: decode_unittests encode_unittests test_cxxcompile test_encode1 te
        [ "`./test_encode2 | ./test_decode2`" = \
        "`./test_encode2 | protoc --decode=Person -I. -I../generator -I/usr/include person.proto`" ]
        
+       [ "`./test_decode2 < person_with_extra_field.pb`" = \
+       "`./test_encode2 | ./test_decode2`" ]
+       
        [ "`./test_encode_callbacks | ./test_decode_callbacks`" = \
        "`./test_encode_callbacks | protoc --decode=TestMessage callbacks.proto`" ]