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