2013-09-08 17:52:03 +03:00
|
|
|
# Build and run a basic round-trip test using memory buffer encoding.
|
|
|
|
|
|
|
|
|
|
Import("env")
|
|
|
|
|
|
2013-09-10 17:44:32 +03:00
|
|
|
enc = env.Program(["encode_buffer.c", "#common/person.pb.c", "#common/pb_encode.o"])
|
|
|
|
|
dec = env.Program(["decode_buffer.c", "#common/person.pb.c", "#common/pb_decode.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-09-08 17:52:03 +03:00
|
|
|
env.Decode(["encode_buffer.output", "#common/person.proto"], MESSAGE = "Person")
|
|
|
|
|
env.Compare(["decode_buffer.output", "encode_buffer.decoded"])
|
|
|
|
|
|