aboutsummaryrefslogtreecommitdiff
path: root/tests/regression/issue_342/SConscript
blob: e15d022d523ace30b3ffe8ebc995d883734251ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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)