File: check_charset.sh

package info (click to toggle)
libcddb 1.3.2-6
  • links: PTS
  • area: main
  • in suites: bullseye, buster
  • size: 2,276 kB
  • sloc: sh: 10,946; ansic: 4,721; makefile: 44
file content (43 lines) | stat: -rwxr-xr-x 931 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/sh
#
# $Id: check_charset.sh,v 1.1 2004/10/16 07:56:21 airborne Exp $

. ./settings.sh

# Test parsing of some locally cached entries.  These entries are
# designed to test the parsing of all supported fields.  Mutli-line
# fields are also tested in every possible way.

DEF_ENC='UTF8'
ALT_ENC='ISO8859-1'

DISCID='12340000'

NO_ICONV_REASON='no iconv support'

#
# Check default encoding
#
start_test 'Check charset conversion (default = '$DEF_ENC')'
if test $WITH_ICONV -eq 1; then
    cddb_query -c only -D $CDDB_CACHE read misc $DISCID
    check_read $? $DISCID.$DEF_ENC
else
    skip $NO_ICONV_REASON
fi

#
# Check alternate encoding
#
start_test 'Check charset conversion (alternate = '$ALT_ENC')'
if test $WITH_ICONV -eq 1; then
    cddb_query -c only -D $CDDB_CACHE -e $ALT_ENC read misc $DISCID
    check_read $? $DISCID.$ALT_ENC
else
    skip $NO_ICONV_REASON
fi

#
# Print results and exit accordingly
#
finalize