1# Check that callback fields inside malloc()ed messages 2# are correctly initialized. 3 4Import('env', 'malloc_env') 5 6env.NanopbProto('callback_pointer') 7 8p = malloc_env.Program(["callback_pointer.c", 9 "callback_pointer.pb.c", 10 "$COMMON/pb_decode_with_malloc.o", 11 "$COMMON/pb_common_with_malloc.o", 12 "$COMMON/malloc_wrappers.o"]) 13 14# Run test under valgrind if available 15valgrind = env.WhereIs('valgrind') 16kwargs = {} 17if valgrind: 18 kwargs['COMMAND'] = valgrind 19 kwargs['ARGS'] = ["-q", "--error-exitcode=99", p[0].abspath] 20 21env.RunTest(p, **kwargs) 22 23