summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/SConstruct2
-rw-r--r--tests/decode_unittests/SConscript2
-rw-r--r--tests/decode_unittests/decode_unittests.c4
-rw-r--r--tests/encode_unittests/SConscript2
-rw-r--r--tests/encode_unittests/encode_unittests.c4
5 files changed, 8 insertions, 6 deletions
diff --git a/tests/SConstruct b/tests/SConstruct
index 3f4d7702..100fb544 100644
--- a/tests/SConstruct
+++ b/tests/SConstruct
@@ -78,6 +78,8 @@ if 'gcc' in env['CC']:
# More strict checks on the nanopb core
env.Append(CORECFLAGS = '-Wextra -Wcast-qual -Wlogical-op -Wconversion')
+ env.Append(CORECFLAGS = ' -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls')
+ env.Append(CORECFLAGS = ' -Wstack-protector')
elif 'clang' in env['CC']:
# CLang
env.Append(CFLAGS = '-ansi -g -O0 -Wall -Werror')
diff --git a/tests/decode_unittests/SConscript b/tests/decode_unittests/SConscript
index 5e0f8407..9a639f7b 100644
--- a/tests/decode_unittests/SConscript
+++ b/tests/decode_unittests/SConscript
@@ -1,4 +1,4 @@
Import('env')
-p = env.Program(["decode_unittests.c", "#common/unittestproto.pb.c", "#common/pb_decode.o"])
+p = env.Program(["decode_unittests.c", "#common/unittestproto.pb.c"])
env.RunTest(p)
diff --git a/tests/decode_unittests/decode_unittests.c b/tests/decode_unittests/decode_unittests.c
index 9c447a57..1be01913 100644
--- a/tests/decode_unittests/decode_unittests.c
+++ b/tests/decode_unittests/decode_unittests.c
@@ -1,8 +1,8 @@
-#define NANOPB_INTERNALS
+/* This includes the whole .c file to get access to static functions. */
+#include "pb_decode.c"
#include <stdio.h>
#include <string.h>
-#include "pb_decode.h"
#include "unittests.h"
#include "unittestproto.pb.h"
diff --git a/tests/encode_unittests/SConscript b/tests/encode_unittests/SConscript
index 6a5ffcff..7509ec03 100644
--- a/tests/encode_unittests/SConscript
+++ b/tests/encode_unittests/SConscript
@@ -1,5 +1,5 @@
# Build and run the stand-alone unit tests for the nanopb encoder part.
Import('env')
-p = env.Program(["encode_unittests.c", "#common/unittestproto.pb.c", "#common/pb_encode.o"])
+p = env.Program(["encode_unittests.c", "#common/unittestproto.pb.c"])
env.RunTest(p)
diff --git a/tests/encode_unittests/encode_unittests.c b/tests/encode_unittests/encode_unittests.c
index fd9a730c..edbc10a9 100644
--- a/tests/encode_unittests/encode_unittests.c
+++ b/tests/encode_unittests/encode_unittests.c
@@ -1,8 +1,8 @@
-#define NANOPB_INTERNALS
+/* This includes the whole .c file to get access to static functions. */
+#include "pb_encode.c"
#include <stdio.h>
#include <string.h>
-#include "pb_encode.h"
#include "unittests.h"
#include "unittestproto.pb.h"