SConscript 686 B

12345678910111213141516171819202122
  1. # Test decoder callback support inside oneofs.
  2. Import('env')
  3. env.NanopbProto('oneof')
  4. enc = env.Program(['encode_oneof.c',
  5. 'oneof.pb.c',
  6. '$COMMON/pb_encode.o',
  7. '$COMMON/pb_common.o'])
  8. dec = env.Program(['decode_oneof.c',
  9. 'oneof.pb.c',
  10. '$COMMON/pb_decode.o',
  11. '$COMMON/pb_common.o'])
  12. for i in range(1,7):
  13. # Encode message, then decode with protoc and test program and compare.
  14. e = env.RunTest("message%d.pb" % i, enc, ARGS = [str(i)])
  15. d1 = env.Decode([e, "oneof.proto"], MESSAGE = "OneOfMessage")
  16. d2 = env.RunTest("message%d.txt" % i, [dec, e])
  17. env.Compare([d1, d2])