File: SConscript

package info (click to toggle)
nanopb 0.4.9.1-1
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,676 kB
  • sloc: ansic: 12,144; python: 2,795; cpp: 190; sh: 163; makefile: 85
file content (22 lines) | stat: -rw-r--r-- 686 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Test decoder callback support inside oneofs.

Import('env')

env.NanopbProto('oneof')

enc = env.Program(['encode_oneof.c',
                'oneof.pb.c',
                '$COMMON/pb_encode.o',
                '$COMMON/pb_common.o'])

dec = env.Program(['decode_oneof.c',
                'oneof.pb.c',
                '$COMMON/pb_decode.o',
                '$COMMON/pb_common.o'])

for i in range(1,7):
    # Encode message, then decode with protoc and test program and compare.
    e = env.RunTest("message%d.pb" % i, enc, ARGS = [str(i)])
    d1 = env.Decode([e, "oneof.proto"], MESSAGE = "OneOfMessage")
    d2 = env.RunTest("message%d.txt" % i, [dec, e])
    env.Compare([d1, d2])