2013-09-08 17:52:03 +03:00
|
|
|
# Build and run a basic round-trip test using memory buffer encoding.
|
|
|
|
|
|
|
|
|
|
Import("env")
|
|
|
|
|
|
2014-08-10 12:42:01 +03:00
|
|
|
enc = env.Program(["encode_buffer.c", "$COMMON/person.pb.c", "$COMMON/pb_encode.o", "$COMMON/pb_common.o"])
|
|
|
|
|
dec = env.Program(["decode_buffer.c", "$COMMON/person.pb.c", "$COMMON/pb_decode.o", "$COMMON/pb_common.o"])
|
2013-09-08 17:52:03 +03:00
|
|
|
|
2013-09-10 17:44:32 +03:00
|
|
|
env.RunTest(enc)
|
|
|
|
|
env.RunTest([dec, "encode_buffer.output"])
|
2013-11-13 22:10:42 +02:00
|
|
|
env.Decode(["encode_buffer.output", "$COMMON/person.proto"], MESSAGE = "Person")
|
2013-09-08 17:52:03 +03:00
|
|
|
env.Compare(["decode_buffer.output", "encode_buffer.decoded"])
|
|
|
|
|
|