~vcs-imports/libtasn1/trunk

« back to all changes in this revision

Viewing changes to tests/coding

  • Committer: Nikos Mavrogiannopoulos
  • Date: 2018-01-21 09:50:55 UTC
  • Revision ID: git-v1:73fa8255ac65985b2a7b5596191892b6027e0c4d
development moved to gitlab

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh
2
 
 
3
 
# Copyright (C) 2017 Free Software Foundation, Inc.
4
 
#
5
 
# This program is free software: you can redistribute it and/or modify
6
 
# it under the terms of the GNU General Public License as published by
7
 
# the Free Software Foundation, either version 3 of the License, or
8
 
# (at your option) any later version.
9
 
#
10
 
# This program is distributed in the hope that it will be useful,
11
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 
# GNU General Public License for more details.
14
 
#
15
 
# You should have received a copy of the GNU General Public License
16
 
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
 
 
18
 
srcdir="${srcdir:-.}"
19
 
 
20
 
ASAN_OPTIONS="detect_leaks=0:exitcode=6"
21
 
export ASAN_OPTIONS
22
 
 
23
 
if ! test -z "${VALGRIND}";then
24
 
VALGRIND="${LIBTOOL:-libtool} --mode=execute ${VALGRIND} --error-exitcode=7 --leak-check=no"
25
 
fi
26
 
 
27
 
ASN1CODING="${ASN1CODING:-../src/asn1Coding$EXEEXT}"
28
 
ASN1PKIX="${ASN1PKIX:-pkix.asn}"
29
 
TMPFILE="asn1.$$.tmp"
30
 
 
31
 
cat <<EOF >$TMPFILE
32
 
PKIX1 { }
33
 
 
34
 
DEFINITIONS IMPLICIT TAGS ::=
35
 
 
36
 
BEGIN
37
 
 
38
 
Dss-Sig-Value ::= SEQUENCE {
39
 
     r       INTEGER,
40
 
     s       INTEGER
41
 
}
42
 
 
43
 
END
44
 
EOF
45
 
 
46
 
$VALGRIND $ASN1CODING -c $TMPFILE ${srcdir}/invalid-assignments1.txt
47
 
if test $? != 1;then
48
 
        echo "Encoding failed (1)"
49
 
        exit 1
50
 
fi
51
 
 
52
 
$VALGRIND $ASN1CODING -c $TMPFILE ${srcdir}/invalid-assignments2.txt
53
 
if test $? != 1;then
54
 
        echo "Encoding failed (2)"
55
 
        exit 1
56
 
fi
57
 
 
58
 
rm -f $TMPFILE
59
 
 
60
 
exit 0