From c33a59efca1ee1fcb92aef30b49d22b832494401 Mon Sep 17 00:00:00 2001 From: Lev Walkin <vlm@lionet.info> Date: Mon, 18 Sep 2006 20:04:14 +0000 Subject: [PATCH] more testing --- examples/sample.makefile.regen | 33 ++++++++-- examples/sample.source.LDAP3/Makefile | 61 +++++++++++++----- examples/sample.source.MHEG5/Makefile | 37 ++++++++++- examples/sample.source.PKIX1/Makefile | 61 +++++++++++++----- examples/sample.source.RRC/Makefile | 31 +++++++-- .../sample-DL-DCCH-Message-1-padded.per | Bin 0 -> 14 bytes .../sample-DL-DCCH-Message-1.per | Bin 0 -> 12 bytes examples/sample.source.TAP3/Makefile | 61 +++++++++++++----- 8 files changed, 225 insertions(+), 59 deletions(-) create mode 100644 examples/sample.source.RRC/sample-DL-DCCH-Message-1-padded.per create mode 100644 examples/sample.source.RRC/sample-DL-DCCH-Message-1.per diff --git a/examples/sample.makefile.regen b/examples/sample.makefile.regen index 1b8f8c4a..b3b0e0d8 100755 --- a/examples/sample.makefile.regen +++ b/examples/sample.makefile.regen @@ -44,7 +44,7 @@ cat Makefile.am.sample \ > Makefile.$$ ( echo - echo "${ASN1PDU}.c: $0" + echo "${ASN1PDU}.c: $0 ${ASN1MODULES}" echo " make regen-makefile" echo " @touch ${ASN1PDU}.c" echo " make" @@ -82,17 +82,36 @@ cat Makefile.am.sample \ echo ' rm -f ./.tmp.[12].$$$$; \' echo ' done; fi' echo " @if test -f ./sample-${ASN1PDU}-1.per ; then \\" - echo " for f in ./sample-${ASN1PDU}-*.per; do \\" + echo " for f in ./sample-${ASN1PDU}-[1-9].per; do \\" echo ' echo "Recoding $$f into DER into XER and back..."; \' - echo ' ./${TARGET} -iper -oder -b 1 $$f > ./.tmp.1.$$$$ || exit 2; \' - echo ' ./${TARGET} -iper -oder -b 17 $$f > ./.tmp.1.$$$$ || exit 2; \' - echo ' ./${TARGET} -iper -oder -b 33 $$f > ./.tmp.1.$$$$ || exit 2; \' - echo ' ./${TARGET} -iper -oder -b 980 $$f > ./.tmp.1.$$$$ || exit 2; \' + echo ' ./${TARGET} -iper -oxer -b 1 $$f > ./.tmp.1.$$$$ || exit 2; \' + echo ' ./${TARGET} -iper -oxer -b 17 $$f > ./.tmp.2.$$$$ || exit 2; \' + echo ' ./${TARGET} -iper -oxer -b 33 $$f > ./.tmp.3.$$$$ || exit 2; \' + echo ' ./${TARGET} -iper -oxer -b 980 $$f > ./.tmp.4.$$$$ || exit 2; \' + echo ' diff ./.tmp.1.$$$$ ./.tmp.2.$$$$ || exit 2; \' + echo ' diff ./.tmp.2.$$$$ ./.tmp.3.$$$$ || exit 2; \' + echo ' diff ./.tmp.3.$$$$ ./.tmp.4.$$$$ || exit 2; \' echo ' ./${TARGET} -iper -oder $$f > ./.tmp.1.$$$$ || exit 2; \' echo ' ./${TARGET} -iber -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 2; \' + echo ' ./${TARGET} -ixer -oder ./.tmp.2.$$$$ > ./.tmp.3.$$$$ || exit 2; \' + echo ' diff ./.tmp.1.$$$$ ./.tmp.3.$$$$ || exit 2; \' + echo ' rm -f ./.tmp.[1234].$$$$; \' + echo ' done; fi' + echo " @if test -f ./sample-${ASN1PDU}-1-padded.per ; then \\" + echo " for f in ./sample-${ASN1PDU}-[1-9]-padded.per; do \\" + echo ' echo "Recoding byte-padded $$f into DER into XER and back..."; \' + echo ' ./${TARGET} -per-padded -iper -oxer -b 1 $$f > ./.tmp.1.$$$$ || exit 2; \' + echo ' ./${TARGET} -per-padded -iper -oxer -b 17 $$f > ./.tmp.2.$$$$ || exit 2; \' + echo ' ./${TARGET} -per-padded -iper -oxer -b 33 $$f > ./.tmp.3.$$$$ || exit 2; \' + echo ' ./${TARGET} -per-padded -iper -oxer -b 980 $$f > ./.tmp.4.$$$$ || exit 2; \' + echo ' diff ./.tmp.1.$$$$ ./.tmp.2.$$$$ || exit 2; \' + echo ' diff ./.tmp.2.$$$$ ./.tmp.3.$$$$ || exit 2; \' + echo ' diff ./.tmp.3.$$$$ ./.tmp.4.$$$$ || exit 2; \' + echo ' ./${TARGET} -per-padded -iper -oder $$f > ./.tmp.1.$$$$ || exit 2; \' + echo ' ./${TARGET} -iber -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 2; \' echo ' ./${TARGET} -ixer -oper ./.tmp.2.$$$$ > ./.tmp.1.$$$$ || exit 2; \' echo ' diff $$f ./.tmp.1.$$$$ || exit 2; \' - echo ' rm -f ./.tmp.[12].$$$$; \' + echo ' rm -f ./.tmp.[1234].$$$$; \' echo ' done; fi' echo ' @echo ================' echo ' @echo All tests passed' diff --git a/examples/sample.source.LDAP3/Makefile b/examples/sample.source.LDAP3/Makefile index 1c4ff234..6de7245e 100644 --- a/examples/sample.source.LDAP3/Makefile +++ b/examples/sample.source.LDAP3/Makefile @@ -187,7 +187,7 @@ regenerate-from-asn1-source: ../../asn1c/asn1c -S ../../skeletons -fcompound-names ../rfc4511-Lightweight-Directory-Access-Protocol-V3.asn1 -LDAPMessage.c: ../sample.makefile.regen +LDAPMessage.c: ../sample.makefile.regen ../rfc4511-Lightweight-Directory-Access-Protocol-V3.asn1 make regen-makefile @touch LDAPMessage.c make @@ -203,27 +203,58 @@ check: ${TARGET} @if test -f ./sample-LDAPMessage-1.[db]er ; then \ for f in ./sample-LDAPMessage-*.[db]er; do \ echo "Recoding $$f into XER and back..."; \ - ./${TARGET} -iber -oxer $$f > ./.tmp.1.$$ || exit 2; \ - ./${TARGET} -ixer -oxer ./.tmp.1.$$ > ./.tmp.2.$$ || exit 2; \ - diff ./.tmp.1.$$ ./.tmp.2.$$ || exit 2; \ - rm -f ./.tmp.[12].$$; \ + ./${TARGET} -iber -oxer -b 1 $$f > ./.tmp.1.$$$$ || exit 2; \ + ./${TARGET} -iber -oxer -b 17 $$f > ./.tmp.1.$$$$ || exit 2; \ + ./${TARGET} -iber -oxer -b 33 $$f > ./.tmp.1.$$$$ || exit 2; \ + ./${TARGET} -iber -oxer -b 980 $$f > ./.tmp.1.$$$$ || exit 2; \ + ./${TARGET} -iber -oxer $$f > ./.tmp.1.$$$$ || exit 2; \ + ./${TARGET} -ixer -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 2; \ + diff ./.tmp.1.$$$$ ./.tmp.2.$$$$ || exit 2; \ + rm -f ./.tmp.[12].$$$$; \ done; fi @if test -f ./sample-LDAPMessage-1.xer ; then \ for f in ./sample-LDAPMessage-*.xer; do \ echo "Recoding $$f into DER and back..."; \ - ./${TARGET} -ixer -oder $$f > ./.tmp.1.$$ || exit 2; \ - ./${TARGET} -iber -oxer ./.tmp.1.$$ > ./.tmp.2.$$ || exit 2; \ - diff $$f ./.tmp.2.$$ || exit 2; \ - rm -f ./.tmp.[12].$$; \ + ./${TARGET} -ixer -oder -b 1 $$f > ./.tmp.1.$$$$ || exit 2; \ + ./${TARGET} -ixer -oder -b 17 $$f > ./.tmp.1.$$$$ || exit 2; \ + ./${TARGET} -ixer -oder -b 33 $$f > ./.tmp.1.$$$$ || exit 2; \ + ./${TARGET} -ixer -oder -b 980 $$f > ./.tmp.1.$$$$ || exit 2; \ + ./${TARGET} -ixer -oder $$f > ./.tmp.1.$$$$ || exit 2; \ + ./${TARGET} -iber -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 2; \ + diff $$f ./.tmp.2.$$$$ || exit 2; \ + rm -f ./.tmp.[12].$$$$; \ done; fi @if test -f ./sample-LDAPMessage-1.per ; then \ - for f in ./sample-LDAPMessage-*.per; do \ + for f in ./sample-LDAPMessage-[1-9].per; do \ echo "Recoding $$f into DER into XER and back..."; \ - ./${TARGET} -iper -oder $$f > ./.tmp.1.$$ || exit 2; \ - ./${TARGET} -ider -oxer ./.tmp.1.$$ > ./.tmp.2.$$ || exit 2; \ - ./${TARGET} -ixer -oper ./.tmp.2.$$ > ./.tmp.1.$$ || exit 2; \ - diff $$f ./.tmp.1.$$ || exit 2; \ - rm -f ./.tmp.[12].$$; \ + ./${TARGET} -iper -oxer -b 1 $$f > ./.tmp.1.$$$$ || exit 2; \ + ./${TARGET} -iper -oxer -b 17 $$f > ./.tmp.2.$$$$ || exit 2; \ + ./${TARGET} -iper -oxer -b 33 $$f > ./.tmp.3.$$$$ || exit 2; \ + ./${TARGET} -iper -oxer -b 980 $$f > ./.tmp.4.$$$$ || exit 2; \ + diff ./.tmp.1.$$$$ ./.tmp.2.$$$$ || exit 2; \ + diff ./.tmp.2.$$$$ ./.tmp.3.$$$$ || exit 2; \ + diff ./.tmp.3.$$$$ ./.tmp.4.$$$$ || exit 2; \ + ./${TARGET} -iper -oder $$f > ./.tmp.1.$$$$ || exit 2; \ + ./${TARGET} -iber -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 2; \ + ./${TARGET} -ixer -oder ./.tmp.2.$$$$ > ./.tmp.3.$$$$ || exit 2; \ + diff ./.tmp.1.$$$$ ./.tmp.3.$$$$ || exit 2; \ + rm -f ./.tmp.[1234].$$$$; \ + done; fi + @if test -f ./sample-LDAPMessage-1-padded.per ; then \ + for f in ./sample-LDAPMessage-[1-9]-padded.per; do \ + echo "Recoding byte-padded $$f into DER into XER and back..."; \ + ./${TARGET} -per-padded -iper -oxer -b 1 $$f > ./.tmp.1.$$$$ || exit 2; \ + ./${TARGET} -per-padded -iper -oxer -b 17 $$f > ./.tmp.2.$$$$ || exit 2; \ + ./${TARGET} -per-padded -iper -oxer -b 33 $$f > ./.tmp.3.$$$$ || exit 2; \ + ./${TARGET} -per-padded -iper -oxer -b 980 $$f > ./.tmp.4.$$$$ || exit 2; \ + diff ./.tmp.1.$$$$ ./.tmp.2.$$$$ || exit 2; \ + diff ./.tmp.2.$$$$ ./.tmp.3.$$$$ || exit 2; \ + diff ./.tmp.3.$$$$ ./.tmp.4.$$$$ || exit 2; \ + ./${TARGET} -per-padded -iper -oder $$f > ./.tmp.1.$$$$ || exit 2; \ + ./${TARGET} -iber -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 2; \ + ./${TARGET} -ixer -oper ./.tmp.2.$$$$ > ./.tmp.1.$$$$ || exit 2; \ + diff $$f ./.tmp.1.$$$$ || exit 2; \ + rm -f ./.tmp.[1234].$$$$; \ done; fi @echo ================ @echo All tests passed diff --git a/examples/sample.source.MHEG5/Makefile b/examples/sample.source.MHEG5/Makefile index db9e1950..53490efd 100644 --- a/examples/sample.source.MHEG5/Makefile +++ b/examples/sample.source.MHEG5/Makefile @@ -477,7 +477,7 @@ regenerate-from-asn1-source: ../../asn1c/asn1c -S ../../skeletons -fcompound-names ../ISO13522-MHEG-5.asn -InterchangedObject.c: ../sample.makefile.regen +InterchangedObject.c: ../sample.makefile.regen ../ISO13522-MHEG-5.asn make regen-makefile @touch InterchangedObject.c make @@ -493,6 +493,10 @@ check: ${TARGET} @if test -f ./sample-InterchangedObject-1.[db]er ; then \ for f in ./sample-InterchangedObject-*.[db]er; do \ echo "Recoding $$f into XER and back..."; \ + ./${TARGET} -iber -oxer -b 1 $$f > ./.tmp.1.$$$$ || exit 2; \ + ./${TARGET} -iber -oxer -b 17 $$f > ./.tmp.1.$$$$ || exit 2; \ + ./${TARGET} -iber -oxer -b 33 $$f > ./.tmp.1.$$$$ || exit 2; \ + ./${TARGET} -iber -oxer -b 980 $$f > ./.tmp.1.$$$$ || exit 2; \ ./${TARGET} -iber -oxer $$f > ./.tmp.1.$$$$ || exit 2; \ ./${TARGET} -ixer -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 2; \ diff ./.tmp.1.$$$$ ./.tmp.2.$$$$ || exit 2; \ @@ -501,19 +505,46 @@ check: ${TARGET} @if test -f ./sample-InterchangedObject-1.xer ; then \ for f in ./sample-InterchangedObject-*.xer; do \ echo "Recoding $$f into DER and back..."; \ + ./${TARGET} -ixer -oder -b 1 $$f > ./.tmp.1.$$$$ || exit 2; \ + ./${TARGET} -ixer -oder -b 17 $$f > ./.tmp.1.$$$$ || exit 2; \ + ./${TARGET} -ixer -oder -b 33 $$f > ./.tmp.1.$$$$ || exit 2; \ + ./${TARGET} -ixer -oder -b 980 $$f > ./.tmp.1.$$$$ || exit 2; \ ./${TARGET} -ixer -oder $$f > ./.tmp.1.$$$$ || exit 2; \ ./${TARGET} -iber -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 2; \ diff $$f ./.tmp.2.$$$$ || exit 2; \ rm -f ./.tmp.[12].$$$$; \ done; fi @if test -f ./sample-InterchangedObject-1.per ; then \ - for f in ./sample-InterchangedObject-*.per; do \ + for f in ./sample-InterchangedObject-[1-9].per; do \ echo "Recoding $$f into DER into XER and back..."; \ + ./${TARGET} -iper -oxer -b 1 $$f > ./.tmp.1.$$$$ || exit 2; \ + ./${TARGET} -iper -oxer -b 17 $$f > ./.tmp.2.$$$$ || exit 2; \ + ./${TARGET} -iper -oxer -b 33 $$f > ./.tmp.3.$$$$ || exit 2; \ + ./${TARGET} -iper -oxer -b 980 $$f > ./.tmp.4.$$$$ || exit 2; \ + diff ./.tmp.1.$$$$ ./.tmp.2.$$$$ || exit 2; \ + diff ./.tmp.2.$$$$ ./.tmp.3.$$$$ || exit 2; \ + diff ./.tmp.3.$$$$ ./.tmp.4.$$$$ || exit 2; \ ./${TARGET} -iper -oder $$f > ./.tmp.1.$$$$ || exit 2; \ ./${TARGET} -iber -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 2; \ + ./${TARGET} -ixer -oder ./.tmp.2.$$$$ > ./.tmp.3.$$$$ || exit 2; \ + diff ./.tmp.1.$$$$ ./.tmp.3.$$$$ || exit 2; \ + rm -f ./.tmp.[1234].$$$$; \ + done; fi + @if test -f ./sample-InterchangedObject-1-padded.per ; then \ + for f in ./sample-InterchangedObject-[1-9]-padded.per; do \ + echo "Recoding byte-padded $$f into DER into XER and back..."; \ + ./${TARGET} -per-padded -iper -oxer -b 1 $$f > ./.tmp.1.$$$$ || exit 2; \ + ./${TARGET} -per-padded -iper -oxer -b 17 $$f > ./.tmp.2.$$$$ || exit 2; \ + ./${TARGET} -per-padded -iper -oxer -b 33 $$f > ./.tmp.3.$$$$ || exit 2; \ + ./${TARGET} -per-padded -iper -oxer -b 980 $$f > ./.tmp.4.$$$$ || exit 2; \ + diff ./.tmp.1.$$$$ ./.tmp.2.$$$$ || exit 2; \ + diff ./.tmp.2.$$$$ ./.tmp.3.$$$$ || exit 2; \ + diff ./.tmp.3.$$$$ ./.tmp.4.$$$$ || exit 2; \ + ./${TARGET} -per-padded -iper -oder $$f > ./.tmp.1.$$$$ || exit 2; \ + ./${TARGET} -iber -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 2; \ ./${TARGET} -ixer -oper ./.tmp.2.$$$$ > ./.tmp.1.$$$$ || exit 2; \ diff $$f ./.tmp.1.$$$$ || exit 2; \ - rm -f ./.tmp.[12].$$$$; \ + rm -f ./.tmp.[1234].$$$$; \ done; fi @echo ================ @echo All tests passed diff --git a/examples/sample.source.PKIX1/Makefile b/examples/sample.source.PKIX1/Makefile index de54195c..b0fde7f7 100644 --- a/examples/sample.source.PKIX1/Makefile +++ b/examples/sample.source.PKIX1/Makefile @@ -369,7 +369,7 @@ regenerate-from-asn1-source: ../../asn1c/asn1c -S ../../skeletons ../rfc3280-PKIX1Explicit88.asn1 ../rfc3280-PKIX1Implicit88.asn1 -Certificate.c: ../sample.makefile.regen +Certificate.c: ../sample.makefile.regen ../rfc3280-*.asn1 make regen-makefile @touch Certificate.c make @@ -385,27 +385,58 @@ check: ${TARGET} @if test -f ./sample-Certificate-1.[db]er ; then \ for f in ./sample-Certificate-*.[db]er; do \ echo "Recoding $$f into XER and back..."; \ - ./${TARGET} -iber -oxer $$f > ./.tmp.1.$$ || exit 2; \ - ./${TARGET} -ixer -oxer ./.tmp.1.$$ > ./.tmp.2.$$ || exit 2; \ - diff ./.tmp.1.$$ ./.tmp.2.$$ || exit 2; \ - rm -f ./.tmp.[12].$$; \ + ./${TARGET} -iber -oxer -b 1 $$f > ./.tmp.1.$$$$ || exit 2; \ + ./${TARGET} -iber -oxer -b 17 $$f > ./.tmp.1.$$$$ || exit 2; \ + ./${TARGET} -iber -oxer -b 33 $$f > ./.tmp.1.$$$$ || exit 2; \ + ./${TARGET} -iber -oxer -b 980 $$f > ./.tmp.1.$$$$ || exit 2; \ + ./${TARGET} -iber -oxer $$f > ./.tmp.1.$$$$ || exit 2; \ + ./${TARGET} -ixer -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 2; \ + diff ./.tmp.1.$$$$ ./.tmp.2.$$$$ || exit 2; \ + rm -f ./.tmp.[12].$$$$; \ done; fi @if test -f ./sample-Certificate-1.xer ; then \ for f in ./sample-Certificate-*.xer; do \ echo "Recoding $$f into DER and back..."; \ - ./${TARGET} -ixer -oder $$f > ./.tmp.1.$$ || exit 2; \ - ./${TARGET} -iber -oxer ./.tmp.1.$$ > ./.tmp.2.$$ || exit 2; \ - diff $$f ./.tmp.2.$$ || exit 2; \ - rm -f ./.tmp.[12].$$; \ + ./${TARGET} -ixer -oder -b 1 $$f > ./.tmp.1.$$$$ || exit 2; \ + ./${TARGET} -ixer -oder -b 17 $$f > ./.tmp.1.$$$$ || exit 2; \ + ./${TARGET} -ixer -oder -b 33 $$f > ./.tmp.1.$$$$ || exit 2; \ + ./${TARGET} -ixer -oder -b 980 $$f > ./.tmp.1.$$$$ || exit 2; \ + ./${TARGET} -ixer -oder $$f > ./.tmp.1.$$$$ || exit 2; \ + ./${TARGET} -iber -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 2; \ + diff $$f ./.tmp.2.$$$$ || exit 2; \ + rm -f ./.tmp.[12].$$$$; \ done; fi @if test -f ./sample-Certificate-1.per ; then \ - for f in ./sample-Certificate-*.per; do \ + for f in ./sample-Certificate-[1-9].per; do \ echo "Recoding $$f into DER into XER and back..."; \ - ./${TARGET} -iper -oder $$f > ./.tmp.1.$$ || exit 2; \ - ./${TARGET} -ider -oxer ./.tmp.1.$$ > ./.tmp.2.$$ || exit 2; \ - ./${TARGET} -ixer -oper ./.tmp.2.$$ > ./.tmp.1.$$ || exit 2; \ - diff $$f ./.tmp.1.$$ || exit 2; \ - rm -f ./.tmp.[12].$$; \ + ./${TARGET} -iper -oxer -b 1 $$f > ./.tmp.1.$$$$ || exit 2; \ + ./${TARGET} -iper -oxer -b 17 $$f > ./.tmp.2.$$$$ || exit 2; \ + ./${TARGET} -iper -oxer -b 33 $$f > ./.tmp.3.$$$$ || exit 2; \ + ./${TARGET} -iper -oxer -b 980 $$f > ./.tmp.4.$$$$ || exit 2; \ + diff ./.tmp.1.$$$$ ./.tmp.2.$$$$ || exit 2; \ + diff ./.tmp.2.$$$$ ./.tmp.3.$$$$ || exit 2; \ + diff ./.tmp.3.$$$$ ./.tmp.4.$$$$ || exit 2; \ + ./${TARGET} -iper -oder $$f > ./.tmp.1.$$$$ || exit 2; \ + ./${TARGET} -iber -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 2; \ + ./${TARGET} -ixer -oder ./.tmp.2.$$$$ > ./.tmp.3.$$$$ || exit 2; \ + diff ./.tmp.1.$$$$ ./.tmp.3.$$$$ || exit 2; \ + rm -f ./.tmp.[1234].$$$$; \ + done; fi + @if test -f ./sample-Certificate-1-padded.per ; then \ + for f in ./sample-Certificate-[1-9]-padded.per; do \ + echo "Recoding byte-padded $$f into DER into XER and back..."; \ + ./${TARGET} -per-padded -iper -oxer -b 1 $$f > ./.tmp.1.$$$$ || exit 2; \ + ./${TARGET} -per-padded -iper -oxer -b 17 $$f > ./.tmp.2.$$$$ || exit 2; \ + ./${TARGET} -per-padded -iper -oxer -b 33 $$f > ./.tmp.3.$$$$ || exit 2; \ + ./${TARGET} -per-padded -iper -oxer -b 980 $$f > ./.tmp.4.$$$$ || exit 2; \ + diff ./.tmp.1.$$$$ ./.tmp.2.$$$$ || exit 2; \ + diff ./.tmp.2.$$$$ ./.tmp.3.$$$$ || exit 2; \ + diff ./.tmp.3.$$$$ ./.tmp.4.$$$$ || exit 2; \ + ./${TARGET} -per-padded -iper -oder $$f > ./.tmp.1.$$$$ || exit 2; \ + ./${TARGET} -iber -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 2; \ + ./${TARGET} -ixer -oper ./.tmp.2.$$$$ > ./.tmp.1.$$$$ || exit 2; \ + diff $$f ./.tmp.1.$$$$ || exit 2; \ + rm -f ./.tmp.[1234].$$$$; \ done; fi @echo ================ @echo All tests passed diff --git a/examples/sample.source.RRC/Makefile b/examples/sample.source.RRC/Makefile index f694fc43..6e623894 100644 --- a/examples/sample.source.RRC/Makefile +++ b/examples/sample.source.RRC/Makefile @@ -4764,7 +4764,7 @@ regenerate-from-asn1-source: ../../asn1c/asn1c -S ../../skeletons -fcompound-names -pdu=auto -gen-PER ../rrc.asn1 -DL-DCCH-Message.c: ../sample.makefile.regen +DL-DCCH-Message.c: ../sample.makefile.regen ../rrc.asn1 make regen-makefile @touch DL-DCCH-Message.c make @@ -4802,13 +4802,36 @@ check: ${TARGET} rm -f ./.tmp.[12].$$$$; \ done; fi @if test -f ./sample-DL-DCCH-Message-1.per ; then \ - for f in ./sample-DL-DCCH-Message-*.per; do \ + for f in ./sample-DL-DCCH-Message-[1-9].per; do \ echo "Recoding $$f into DER into XER and back..."; \ + ./${TARGET} -iper -oxer -b 1 $$f > ./.tmp.1.$$$$ || exit 2; \ + ./${TARGET} -iper -oxer -b 17 $$f > ./.tmp.2.$$$$ || exit 2; \ + ./${TARGET} -iper -oxer -b 33 $$f > ./.tmp.3.$$$$ || exit 2; \ + ./${TARGET} -iper -oxer -b 980 $$f > ./.tmp.4.$$$$ || exit 2; \ + diff ./.tmp.1.$$$$ ./.tmp.2.$$$$ || exit 2; \ + diff ./.tmp.2.$$$$ ./.tmp.3.$$$$ || exit 2; \ + diff ./.tmp.3.$$$$ ./.tmp.4.$$$$ || exit 2; \ ./${TARGET} -iper -oder $$f > ./.tmp.1.$$$$ || exit 2; \ ./${TARGET} -iber -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 2; \ + ./${TARGET} -ixer -oder ./.tmp.2.$$$$ > ./.tmp.3.$$$$ || exit 2; \ + diff ./.tmp.1.$$$$ ./.tmp.3.$$$$ || exit 2; \ + rm -f ./.tmp.[1234].$$$$; \ + done; fi + @if test -f ./sample-DL-DCCH-Message-1-padded.per ; then \ + for f in ./sample-DL-DCCH-Message-[1-9]-padded.per; do \ + echo "Recoding byte-padded $$f into DER into XER and back..."; \ + ./${TARGET} -per-padded -iper -oxer -b 1 $$f > ./.tmp.1.$$$$ || exit 2; \ + ./${TARGET} -per-padded -iper -oxer -b 17 $$f > ./.tmp.2.$$$$ || exit 2; \ + ./${TARGET} -per-padded -iper -oxer -b 33 $$f > ./.tmp.3.$$$$ || exit 2; \ + ./${TARGET} -per-padded -iper -oxer -b 980 $$f > ./.tmp.4.$$$$ || exit 2; \ + diff ./.tmp.1.$$$$ ./.tmp.2.$$$$ || exit 1; \ + diff ./.tmp.2.$$$$ ./.tmp.3.$$$$ || exit 2; \ + diff ./.tmp.3.$$$$ ./.tmp.4.$$$$ || exit 3; \ + ./${TARGET} -per-padded -iper -oder $$f > ./.tmp.1.$$$$ || exit 2; \ + ./${TARGET} -iber -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 2; \ ./${TARGET} -ixer -oper ./.tmp.2.$$$$ > ./.tmp.1.$$$$ || exit 2; \ - diff $$f ./.tmp.1.$$$$ || exit 2; \ - rm -f ./.tmp.[12].$$$$; \ + diff $$f ./.tmp.1.$$$$ || exit 4; \ + rm -f ./.tmp.[1234].$$$$; \ done; fi @echo ================ @echo All tests passed diff --git a/examples/sample.source.RRC/sample-DL-DCCH-Message-1-padded.per b/examples/sample.source.RRC/sample-DL-DCCH-Message-1-padded.per new file mode 100644 index 0000000000000000000000000000000000000000..2ae327a3267067d41705ec950daf6d7190ab5bbd GIT binary patch literal 14 UcmWe_U|?W4&~Shu-T}w}02+@2H2?qr literal 0 HcmV?d00001 diff --git a/examples/sample.source.RRC/sample-DL-DCCH-Message-1.per b/examples/sample.source.RRC/sample-DL-DCCH-Message-1.per new file mode 100644 index 0000000000000000000000000000000000000000..584e85be7de0ad0c0e00e72eb17eefea9e6c65da GIT binary patch literal 12 TcmWe_U|>jaNMO)kz`y_i5F`R+ literal 0 HcmV?d00001 diff --git a/examples/sample.source.TAP3/Makefile b/examples/sample.source.TAP3/Makefile index 4dd100ca..e3826163 100644 --- a/examples/sample.source.TAP3/Makefile +++ b/examples/sample.source.TAP3/Makefile @@ -703,7 +703,7 @@ regenerate-from-asn1-source: ../../asn1c/asn1c -S ../../skeletons ../tap3.asn1 -DataInterChange.c: ../sample.makefile.regen +DataInterChange.c: ../sample.makefile.regen ../tap3.asn1 make regen-makefile @touch DataInterChange.c make @@ -719,27 +719,58 @@ check: ${TARGET} @if test -f ./sample-DataInterChange-1.[db]er ; then \ for f in ./sample-DataInterChange-*.[db]er; do \ echo "Recoding $$f into XER and back..."; \ - ./${TARGET} -iber -oxer $$f > ./.tmp.1.$$ || exit 2; \ - ./${TARGET} -ixer -oxer ./.tmp.1.$$ > ./.tmp.2.$$ || exit 2; \ - diff ./.tmp.1.$$ ./.tmp.2.$$ || exit 2; \ - rm -f ./.tmp.[12].$$; \ + ./${TARGET} -iber -oxer -b 1 $$f > ./.tmp.1.$$$$ || exit 2; \ + ./${TARGET} -iber -oxer -b 17 $$f > ./.tmp.1.$$$$ || exit 2; \ + ./${TARGET} -iber -oxer -b 33 $$f > ./.tmp.1.$$$$ || exit 2; \ + ./${TARGET} -iber -oxer -b 980 $$f > ./.tmp.1.$$$$ || exit 2; \ + ./${TARGET} -iber -oxer $$f > ./.tmp.1.$$$$ || exit 2; \ + ./${TARGET} -ixer -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 2; \ + diff ./.tmp.1.$$$$ ./.tmp.2.$$$$ || exit 2; \ + rm -f ./.tmp.[12].$$$$; \ done; fi @if test -f ./sample-DataInterChange-1.xer ; then \ for f in ./sample-DataInterChange-*.xer; do \ echo "Recoding $$f into DER and back..."; \ - ./${TARGET} -ixer -oder $$f > ./.tmp.1.$$ || exit 2; \ - ./${TARGET} -iber -oxer ./.tmp.1.$$ > ./.tmp.2.$$ || exit 2; \ - diff $$f ./.tmp.2.$$ || exit 2; \ - rm -f ./.tmp.[12].$$; \ + ./${TARGET} -ixer -oder -b 1 $$f > ./.tmp.1.$$$$ || exit 2; \ + ./${TARGET} -ixer -oder -b 17 $$f > ./.tmp.1.$$$$ || exit 2; \ + ./${TARGET} -ixer -oder -b 33 $$f > ./.tmp.1.$$$$ || exit 2; \ + ./${TARGET} -ixer -oder -b 980 $$f > ./.tmp.1.$$$$ || exit 2; \ + ./${TARGET} -ixer -oder $$f > ./.tmp.1.$$$$ || exit 2; \ + ./${TARGET} -iber -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 2; \ + diff $$f ./.tmp.2.$$$$ || exit 2; \ + rm -f ./.tmp.[12].$$$$; \ done; fi @if test -f ./sample-DataInterChange-1.per ; then \ - for f in ./sample-DataInterChange-*.per; do \ + for f in ./sample-DataInterChange-[1-9].per; do \ echo "Recoding $$f into DER into XER and back..."; \ - ./${TARGET} -iper -oder $$f > ./.tmp.1.$$ || exit 2; \ - ./${TARGET} -ider -oxer ./.tmp.1.$$ > ./.tmp.2.$$ || exit 2; \ - ./${TARGET} -ixer -oper ./.tmp.2.$$ > ./.tmp.1.$$ || exit 2; \ - diff $$f ./.tmp.1.$$ || exit 2; \ - rm -f ./.tmp.[12].$$; \ + ./${TARGET} -iper -oxer -b 1 $$f > ./.tmp.1.$$$$ || exit 2; \ + ./${TARGET} -iper -oxer -b 17 $$f > ./.tmp.2.$$$$ || exit 2; \ + ./${TARGET} -iper -oxer -b 33 $$f > ./.tmp.3.$$$$ || exit 2; \ + ./${TARGET} -iper -oxer -b 980 $$f > ./.tmp.4.$$$$ || exit 2; \ + diff ./.tmp.1.$$$$ ./.tmp.2.$$$$ || exit 2; \ + diff ./.tmp.2.$$$$ ./.tmp.3.$$$$ || exit 2; \ + diff ./.tmp.3.$$$$ ./.tmp.4.$$$$ || exit 2; \ + ./${TARGET} -iper -oder $$f > ./.tmp.1.$$$$ || exit 2; \ + ./${TARGET} -iber -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 2; \ + ./${TARGET} -ixer -oder ./.tmp.2.$$$$ > ./.tmp.3.$$$$ || exit 2; \ + diff ./.tmp.1.$$$$ ./.tmp.3.$$$$ || exit 2; \ + rm -f ./.tmp.[1234].$$$$; \ + done; fi + @if test -f ./sample-DataInterChange-1-padded.per ; then \ + for f in ./sample-DataInterChange-[1-9]-padded.per; do \ + echo "Recoding byte-padded $$f into DER into XER and back..."; \ + ./${TARGET} -per-padded -iper -oxer -b 1 $$f > ./.tmp.1.$$$$ || exit 2; \ + ./${TARGET} -per-padded -iper -oxer -b 17 $$f > ./.tmp.2.$$$$ || exit 2; \ + ./${TARGET} -per-padded -iper -oxer -b 33 $$f > ./.tmp.3.$$$$ || exit 2; \ + ./${TARGET} -per-padded -iper -oxer -b 980 $$f > ./.tmp.4.$$$$ || exit 2; \ + diff ./.tmp.1.$$$$ ./.tmp.2.$$$$ || exit 2; \ + diff ./.tmp.2.$$$$ ./.tmp.3.$$$$ || exit 2; \ + diff ./.tmp.3.$$$$ ./.tmp.4.$$$$ || exit 2; \ + ./${TARGET} -per-padded -iper -oder $$f > ./.tmp.1.$$$$ || exit 2; \ + ./${TARGET} -iber -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 2; \ + ./${TARGET} -ixer -oper ./.tmp.2.$$$$ > ./.tmp.1.$$$$ || exit 2; \ + diff $$f ./.tmp.1.$$$$ || exit 2; \ + rm -f ./.tmp.[1234].$$$$; \ done; fi @echo ================ @echo All tests passed -- GitLab