SConscript 594 B

123456789101112131415161718192021
  1. # Regression test for issue #547:
  2. # Buffer overflow when encoding bytes with size set to 65535
  3. Import("env")
  4. env.NanopbProto("test.proto")
  5. # Define the compilation options
  6. opts = env.Clone()
  7. opts.Append(CPPDEFINES = {'PB_FIELD_32BIT': 1})
  8. # Build new version of core
  9. strict = opts.Clone()
  10. strict.Append(CFLAGS = strict['CORECFLAGS'])
  11. strict.Object("pb_encode_fields32.o", "$NANOPB/pb_encode.c")
  12. strict.Object("pb_common_fields32.o", "$NANOPB/pb_common.c")
  13. # Build and run test
  14. test = opts.Program(["test.c", "test.pb.c", "pb_encode_fields32.o", "pb_common_fields32.o"])
  15. env.RunTest(test)