blob: 91d67c6e3009432092ca4cccf150c2d26ef56c13 [file] [log] [blame]
Lev Walkin294aebc2017-10-10 00:29:18 -07001ASN_PROGRAM = tap3dump
2CFLAGS += -DASN_CONVERTER_TITLE="GSM TAP3 (Transferred Account Procedure, Version 3) decoder" -DHAVE_CONFIG_H -DJUNKTEST -D_DEFAULT_SOURCE
3begin: DataInterChange.c maybe-wip-pause all
Lev Walkin3f12bc02005-03-10 15:09:02 +00004
Jon Ringle3016fd52017-11-15 02:06:47 -05005-include converter-example.mk
Lev Walkin3f12bc02005-03-10 15:09:02 +00006
Lev Walkinc33a59e2006-09-18 20:04:14 +00007DataInterChange.c: ../sample.makefile.regen ../tap3.asn1
Lev Walkincc7c94e2006-09-17 04:01:29 +00008 make regen-makefile
9 @touch DataInterChange.c
10 make
11
12regen-makefile:
Lev Walkin5aef2c52007-06-29 12:46:06 +000013 TITLE="GSM TAP3 (Transferred Account Procedure, Version 3) decoder" \
Lev Walkin40b8a7a2017-10-08 22:36:29 -070014 ASN_CMDOPTS="" \
15 ASN_MODULES="../tap3.asn1" \
16 ASN_PDU=DataInterChange \
17 ASN_PROGRAM=tap3dump \
Lev Walkin2fd86de2006-09-13 02:10:23 +000018 ../sample.makefile.regen
Lev Walkin3f12bc02005-03-10 15:09:02 +000019
Lev Walkin294aebc2017-10-10 00:29:18 -070020check: ${ASN_PROGRAM} check-ber check-xer check-oer check-per
Lev Walkin1f12da42006-09-24 19:47:07 +000021 @echo ================
22 @echo All tests passed
23 @echo ================
24
25check-ber:
Lev Walkin13afe532006-09-18 21:30:04 +000026 @if test -f sample-DataInterChange-1.[db]er ; then \
Lev Walkinad775912017-09-26 22:55:22 -070027 for f in sample-*-*.[db]er; do \
28 pdu=`echo $$f | sed -E -e "s/sample-([A-Za-z0-9-]+)-[0-9].*/\1/"`; \
Lev Walkin13afe532006-09-18 21:30:04 +000029 for b in 1 17 33 980 8192; do \
Lev Walkinad775912017-09-26 22:55:22 -070030 echo "Recoding $$f ($$pdu) into XER and back ($$b)..."; \
Lev Walkin294aebc2017-10-10 00:29:18 -070031 ./${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; \
Lev Walkin46a6bd22007-06-26 08:36:39 +000033 diff ./.tmp.1.$$$$ ./.tmp.2.$$$$ || exit 4; \
Lev Walkinc33a59e2006-09-18 20:04:14 +000034 rm -f ./.tmp.[12].$$$$; \
Lev Walkin1f12da42006-09-24 19:47:07 +000035 echo "Test junking $$f (please wait)..."; \
Lev Walkin294aebc2017-10-10 00:29:18 -070036 ./${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; \
Lev Walkin13afe532006-09-18 21:30:04 +000038 done; done; fi
Lev Walkin1f12da42006-09-24 19:47:07 +000039
40check-xer:
Lev Walkin13afe532006-09-18 21:30:04 +000041 @if test -f sample-DataInterChange-1.xer ; then \
Lev Walkinad775912017-09-26 22:55:22 -070042 for f in sample-*-*.xer; do \
43 pdu=`echo $$f | sed -E -e "s/sample-([A-Za-z0-9-]+)-[0-9].*/\1/"`; \
Lev Walkin13afe532006-09-18 21:30:04 +000044 for b in 1 17 33 980 8192; do \
Lev Walkinad775912017-09-26 22:55:22 -070045 echo "Recoding $$f ($$pdu) into DER and back ($$b)..."; \
Lev Walkin294aebc2017-10-10 00:29:18 -070046 ./${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; \
Lev Walkin46a6bd22007-06-26 08:36:39 +000048 diff $$f ./.tmp.2.$$$$ || exit 4; \
Lev Walkinc33a59e2006-09-18 20:04:14 +000049 rm -f ./.tmp.[12].$$$$; \
Lev Walkin1f12da42006-09-24 19:47:07 +000050 echo "Test junking $$f (please wait)..."; \
Lev Walkin294aebc2017-10-10 00:29:18 -070051 ./${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; \
Lev Walkinad775912017-09-26 22:55:22 -070053 done; done; fi
54
55check-oer:
56 @if test -f sample-DataInterChange-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)..."; \
Lev Walkin294aebc2017-10-10 00:29:18 -070061 ./${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; \
Lev Walkinad775912017-09-26 22:55:22 -070063 diff $$f ./.tmp.2.$$$$ || exit 4; \
64 rm -f ./.tmp.[12].$$$$; \
65 echo "Test junking $$f (please wait) ($$b) ..."; \
Lev Walkin294aebc2017-10-10 00:29:18 -070066 ./${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; \
Lev Walkin13afe532006-09-18 21:30:04 +000068 done; done; fi
Lev Walkin1f12da42006-09-24 19:47:07 +000069
70check-per:
Lev Walkin46a6bd22007-06-26 08:36:39 +000071 @if test -f sample-DataInterChange-1-nopad.per ; then \
Lev Walkinad775912017-09-26 22:55:22 -070072 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/"`; \
Lev Walkin13afe532006-09-18 21:30:04 +000074 for b in 1 17 33 980 8192; do \
Lev Walkinad775912017-09-26 22:55:22 -070075 echo "Recoding non-padded $$f ($$pdu) into DER into XER and back ($$b)..."; \
Lev Walkin294aebc2017-10-10 00:29:18 -070076 ./${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; \
Lev Walkin46a6bd22007-06-26 08:36:39 +000079 diff ./.tmp.1.$$$$ ./.tmp.3.$$$$ || exit 5; \
Lev Walkin13afe532006-09-18 21:30:04 +000080 rm -f ./.tmp.[123].$$$$; \
Lev Walkin1f12da42006-09-24 19:47:07 +000081 echo "Test junking $$f (please wait)..."; \
Lev Walkin294aebc2017-10-10 00:29:18 -070082 ./${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; \
Lev Walkin13afe532006-09-18 21:30:04 +000084 done; done; fi
Lev Walkin46a6bd22007-06-26 08:36:39 +000085 @if test -f sample-DataInterChange-1.per ; then \
86 for f in sample-*-[1-9].per; do \
Lev Walkinad775912017-09-26 22:55:22 -070087 pdu=`echo $$f | sed -E -e "s/sample-([A-Za-z0-9-]+)-[0-9].*/\1/"`; \
Lev Walkin13afe532006-09-18 21:30:04 +000088 for b in 1 17 33 980 8192; do \
Lev Walkinad775912017-09-26 22:55:22 -070089 echo "Recoding $$f ($$pdu) into DER into XER and back ($$b)..."; \
Lev Walkin294aebc2017-10-10 00:29:18 -070090 ./${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; \
Lev Walkin46a6bd22007-06-26 08:36:39 +000093 diff $$f ./.tmp.1.$$$$ || exit 6; \
Lev Walkin13afe532006-09-18 21:30:04 +000094 rm -f ./.tmp.[12].$$$$; \
Lev Walkin1f12da42006-09-24 19:47:07 +000095 echo "Test junking $$f (please wait)..."; \
Lev Walkin294aebc2017-10-10 00:29:18 -070096 ./${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; \
Lev Walkin13afe532006-09-18 21:30:04 +000098 done; done; fi
Lev Walkinafda1a52006-09-15 18:37:21 +000099
Lev Walkinad775912017-09-26 22:55:22 -0700100maybe-wip-pause:
101 @if [ -f WIP ]; then cat WIP; sleep 2; fi
102
Lev Walkin3f12bc02005-03-10 15:09:02 +0000103distclean: clean
Jon Ringle7871abf2017-11-13 21:29:40 -0500104 rm -f $(ASN_MODULE_SRCS)
105 rm -f $(ASN_MODULE_HDRS)
106 rm -f $(ASN_PROGRAM_SRCS) $(ASN_PROGRAM_HDRS)
Jon Ringle3016fd52017-11-15 02:06:47 -0500107 rm -f converter-example.mk