diff options
Diffstat (limited to 'tests/regression/issue_342/SConscript')
-rw-r--r-- | tests/regression/issue_342/SConscript | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/regression/issue_342/SConscript b/tests/regression/issue_342/SConscript new file mode 100644 index 0000000..e15d022 --- /dev/null +++ b/tests/regression/issue_342/SConscript @@ -0,0 +1,21 @@ +# Regression test for #342: +# Possible null-pointer dereference in pb_decode.c + +Import("env") + +# Define the compilation options +opts = env.Clone() +opts.Append(CPPDEFINES = {'PB_OLD_CALLBACK_STYLE': 1}) + +# Build new version of core +strict = opts.Clone() +strict.Append(CFLAGS = strict['CORECFLAGS']) +strict.Object("pb_decode_oldcallback.o", "$NANOPB/pb_decode.c") +strict.Object("pb_encode_oldcallback.o", "$NANOPB/pb_encode.c") +strict.Object("pb_common_oldcallback.o", "$NANOPB/pb_common.c") + +opts.NanopbProto("extensions") +testprog = opts.Program(["test_extensions.c", "extensions.pb.c", "pb_encode_oldcallback.o", "pb_decode_oldcallback.o", "pb_common_oldcallback.o"]) + +opts.RunTest(testprog) + |