1 ASN_PROGRAM = megaco-dump
2 CFLAGS += -DHAVE_CONFIG_H -DJUNKTEST -D_DEFAULT_SOURCE
3 begin: MegacoMessage.c maybe-wip-pause all
5 -include converter-example.mk
7 MegacoMessage.c: ../sample.makefile.regen ../rfc3525-MEDIA-GATEWAY-CONTROL.asn1
13 ASN_CMDOPTS="-fcompound-names" \
14 ASN_MODULES="../rfc3525-MEDIA-GATEWAY-CONTROL.asn1" \
15 ASN_PDU=MegacoMessage \
16 ASN_PROGRAM=megaco-dump \
17 ../sample.makefile.regen
19 check: ${ASN_PROGRAM} check-ber check-xer check-oer check-per
20 @echo ================
21 @echo All tests passed
22 @echo ================
25 @if test -f sample-MegacoMessage-1.[db]er ; then \
26 for f in sample-*-*.[db]er; do \
27 pdu=`echo $$f | sed -E -e "s/sample-([A-Za-z0-9-]+)-[0-9].*/\1/"`; \
28 for b in 1 17 33 980 8192; do \
29 echo "Recoding $$f ($$pdu) into XER and back ($$b)..."; \
30 ./${ASN_PROGRAM} -p $$pdu -b $$b -iber -oxer $$f > ./.tmp.1.$$$$ || exit 2; \
31 ./${ASN_PROGRAM} -p $$pdu -b $$b -ixer -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 3; \
32 diff ./.tmp.1.$$$$ ./.tmp.2.$$$$ || exit 4; \
33 rm -f ./.tmp.[12].$$$$; \
34 echo "Test junking $$f (please wait)..."; \
35 ./${ASN_PROGRAM} -J0.0001 -n 1000 -p $$pdu -b $$b -iber -onull $$f || exit 5; \
36 ./${ASN_PROGRAM} -J0.001 -n 1000 -p $$pdu -b $$b -iber -onull $$f || exit 6; \
40 @if test -f sample-MegacoMessage-1.xer ; then \
41 for f in sample-*-*.xer; do \
42 pdu=`echo $$f | sed -E -e "s/sample-([A-Za-z0-9-]+)-[0-9].*/\1/"`; \
43 for b in 1 17 33 980 8192; do \
44 echo "Recoding $$f ($$pdu) into DER and back ($$b)..."; \
45 ./${ASN_PROGRAM} -p $$pdu -b $$b -ixer -oder $$f > ./.tmp.1.$$$$ || exit 2; \
46 ./${ASN_PROGRAM} -p $$pdu -b $$b -iber -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 3; \
47 diff $$f ./.tmp.2.$$$$ || exit 4; \
48 rm -f ./.tmp.[12].$$$$; \
49 echo "Test junking $$f (please wait)..."; \
50 ./${ASN_PROGRAM} -J0.0001 -n 1000 -p $$pdu -b $$b -ixer -onull $$f || exit 5; \
51 ./${ASN_PROGRAM} -J0.001 -n 1000 -p $$pdu -b $$b -ixer -onull $$f || exit 6; \
55 @if test -f sample-MegacoMessage-1.*oer ; then \
56 for f in sample-*-*.*oer; do \
57 pdu=`echo $$f | sed -E -e "s/sample-([A-Za-z0-9-]+)-[0-9].*/\1/"`; \
58 for b in 1 17 33 980 8192; do \
59 echo "Recoding $$f ($$pdu) into XER and back ($$b)..."; \
60 ./${ASN_PROGRAM} -p $$pdu -b $$b -ioer -oxer $$f > ./.tmp.1.$$$$ || exit 2; \
61 ./${ASN_PROGRAM} -p $$pdu -b $$b -ixer -ooer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 3; \
62 diff $$f ./.tmp.2.$$$$ || exit 4; \
63 rm -f ./.tmp.[12].$$$$; \
64 echo "Test junking $$f (please wait) ($$b) ..."; \
65 ./${ASN_PROGRAM} -J0.0001 -n 1000 -p $$pdu -b $$b -ioer -onull $$f || exit 5; \
66 ./${ASN_PROGRAM} -J0.001 -n 1000 -p $$pdu -b $$b -ioer -onull $$f || exit 6; \
70 @if test -f sample-MegacoMessage-1-nopad.per ; then \
71 for f in sample-*-[1-9]-nopad.per; do \
72 pdu=`echo $$f | sed -E -e "s/sample-([A-Za-z0-9-]+)-[0-9].*/\1/"`; \
73 for b in 1 17 33 980 8192; do \
74 echo "Recoding non-padded $$f ($$pdu) into DER into XER and back ($$b)..."; \
75 ./${ASN_PROGRAM} -p $$pdu -b $$b -per-nopad -iper -oder $$f > ./.tmp.1.$$$$ || exit 2; \
76 ./${ASN_PROGRAM} -p $$pdu -b $$b -iber -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 3; \
77 ./${ASN_PROGRAM} -p $$pdu -b $$b -ixer -oder ./.tmp.2.$$$$ > ./.tmp.3.$$$$ || exit 4; \
78 diff ./.tmp.1.$$$$ ./.tmp.3.$$$$ || exit 5; \
79 rm -f ./.tmp.[123].$$$$; \
80 echo "Test junking $$f (please wait)..."; \
81 ./${ASN_PROGRAM} -J0.0001 -n 1000 -p $$pdu -b $$b -per-nopad -iper -onull $$f || exit 6; \
82 ./${ASN_PROGRAM} -J0.001 -n 1000 -p $$pdu -b $$b -per-nopad -iper -onull $$f || exit 7; \
84 @if test -f sample-MegacoMessage-1.per ; then \
85 for f in sample-*-[1-9].per; do \
86 pdu=`echo $$f | sed -E -e "s/sample-([A-Za-z0-9-]+)-[0-9].*/\1/"`; \
87 for b in 1 17 33 980 8192; do \
88 echo "Recoding $$f ($$pdu) into DER into XER and back ($$b)..."; \
89 ./${ASN_PROGRAM} -p $$pdu -b $$b -iper -oder $$f > ./.tmp.1.$$$$ || exit 3; \
90 ./${ASN_PROGRAM} -p $$pdu -b $$b -iber -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 4; \
91 ./${ASN_PROGRAM} -p $$pdu -b $$b -ixer -oper ./.tmp.2.$$$$ > ./.tmp.1.$$$$ || exit 5; \
92 diff $$f ./.tmp.1.$$$$ || exit 6; \
93 rm -f ./.tmp.[12].$$$$; \
94 echo "Test junking $$f (please wait)..."; \
95 ./${ASN_PROGRAM} -J0.0001 -n 1000 -p $$pdu -b $$b -iper -onull $$f || exit 7; \
96 ./${ASN_PROGRAM} -J0.001 -n 1000 -p $$pdu -b $$b -iper -onull $$f || exit 8; \
100 @if [ -f WIP ]; then cat WIP; sleep 2; fi
103 rm -f $(ASN_MODULE_SRCS)
104 rm -f $(ASN_MODULE_HDRS)
105 rm -f $(ASN_PROGRAM_SRCS) $(ASN_PROGRAM_HDRS)
106 rm -f converter-example.mk