| 1 |
# Regression test for #494: |
| 2 |
# Using sizeof on anonymous union not allowed in C++, in message_size oneof sizing fallback |
| 3 |
|
| 4 |
Import('env') |
| 5 |
import os, sys |
| 6 |
|
| 7 |
# The build rules here are a bit tricky to make the normal dependency |
| 8 |
# resolution intentionally fail. This causes the generator to use the fallback |
| 9 |
# define which had the problem with C++. |
| 10 |
env.Command("oneof.pb", "oneof.proto", "$PROTOC $PROTOCFLAGS -I$BUILDDIR/regression/issue_494 -o$TARGETS $SOURCES") |
| 11 |
env.Command(["oneof.pb.c", "oneof.pb.h"], "oneof.pb", env['NANOPB_GENERATOR'] + " -D$BUILDDIR/regression/issue_494 $SOURCES") |
| 12 |
env.NanopbProto("submessage.proto") |
| 13 |
env.Depends("oneof.pb", "submessage.proto") |
| 14 |
|
| 15 |
test = env.Program(["oneof_size.cc"]) |
| 16 |
env.Depends(test, "oneof.pb.h") |
| 17 |
env.RunTest(test) |