Skip to content

Commit

Permalink
Fix a few tests to run in more locales
Browse files Browse the repository at this point in the history
Some tests were missing the explicit setting of the locale that they
need to perform the correct comparison with golden test files. At the
same time, modify only the specific locale category needed for the test,
so help spot locale-dependent changes accidentally added to the code.
This won't work if someone specifies an odd locale with LC_ALL (since
that overrides the more specific variant), but normal systems won't be
doing that.

Add a CI test using a different locale to test this.
  • Loading branch information
dfandrich committed Mar 5, 2024
1 parent 7751469 commit e018a41
Show file tree
Hide file tree
Showing 43 changed files with 75 additions and 42 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,17 @@ jobs:
target: gpscorrelate
install_target: install
valgrind: yes
- name: 'locale tests'
cc: gcc
gtk: 3
install: desktop-file-utils docbook-xsl exiv2 libexiv2-dev libgtk-3-dev xsltproc gettext locales-all
cflags: -Wall -Wextra -Werror -Wno-error=deprecated-declarations -O3 -DENABLE_NLS=1
cxx: g++
target: all
install_target: install install-po install-desktop-file
# Turkish is one of the better locales to test in that it has unusual
# upper/lowercase folding and comma as decimal separator.
locale: tr_TR

steps:
- uses: actions/checkout@v4
Expand All @@ -103,6 +114,23 @@ jobs:
- if: matrix.build.valgrind == 'yes'
name: 'valgrind test'
run: make check CHECK_OPTIONS='-v -m'
- if: matrix.build.locale
name: 'locale test'
env:
LC_ADDRESS: ${{ matrix.build.locale }}
LC_COLLATE: ${{ matrix.build.locale }}
LC_CTYPE: ${{ matrix.build.locale }}
LC_IDENTIFICATION: ${{ matrix.build.locale }}
LC_MEASUREMENT: ${{ matrix.build.locale }}
LC_MESSAGES: ${{ matrix.build.locale }}
LC_MONETARY: ${{ matrix.build.locale }}
LC_NAME: ${{ matrix.build.locale }}
LC_NUMERIC: ${{ matrix.build.locale }}
LC_PAPER: ${{ matrix.build.locale }}
LC_SOURCED: ${{ matrix.build.locale }}
LC_TELEPHONE: ${{ matrix.build.locale }}
LC_TIME: ${{ matrix.build.locale }}
run: make check CHECK_OPTIONS='-v'
- name: 'install test'
run: make prefix= DESTDIR="${PWD}" ${{ matrix.build.install_target }}

Expand Down
2 changes: 1 addition & 1 deletion tests/data/test018.param
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
TITLE='Show GPS data on file'
# Run in C locale to avoid errors when comparing numbers in output
COMMAND='env LC_ALL=C $PROGRAM -s "$STAGINGDIR/withgps.jpg" > "$OUTFILE" 2>&1'
COMMAND='env LC_NUMERIC=C $PROGRAM -s "$STAGINGDIR/withgps.jpg" > "$OUTFILE" 2>&1'
RESULTCODE=0
SEDCOMMAND='s@^.*/@@' # strip path
2 changes: 1 addition & 1 deletion tests/data/test038.param
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ PRECOMMAND='cat "$STAGINGDIR/point2-1.jpg" >"$LOGDIR/test.jpg"'
# This time zone is equivalent to America/Vancouver (at least, in 2012)
# but should be more portable than using the symbolic name.
# Run in C locale to avoid errors when comparing numbers in output
COMMAND='env LC_ALL=C TZ="PST8PDT,M3.2.0,M11.1.0" $PROGRAM -v -g "$STAGINGDIR/track4.gpx" "$LOGDIR/test.jpg" > "$OUTFILE" 2>&1 && exiv2 -pv pr "$LOGDIR/test.jpg" >> "$OUTFILE" 2>&1'
COMMAND='env LC_NUMERIC=C TZ="PST8PDT,M3.2.0,M11.1.0" $PROGRAM -v -g "$STAGINGDIR/track4.gpx" "$LOGDIR/test.jpg" > "$OUTFILE" 2>&1 && exiv2 -pv pr "$LOGDIR/test.jpg" >> "$OUTFILE" 2>&1'
POSTCOMMAND='rm -f "$LOGDIR/test.jpg"'
RESULTCODE=0
SEDCOMMAND='s@^/.*/|.*Copyright.*$@@' # strip path and copyright line
2 changes: 1 addition & 1 deletion tests/data/test039.param
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ PRECOMMAND='cat "$STAGINGDIR/point2-2.jpg" >"$LOGDIR/test.jpg"'
# This time zone is equivalent to America/Vancouver (at least, in 2012)
# but should be more portable than using the symbolic name.
# Run in C locale to avoid errors when comparing numbers in output
COMMAND='env LC_ALL=C TZ="PST8PDT,M3.2.0,M11.1.0" $PROGRAM -v -g "$STAGINGDIR/track4.gpx" "$LOGDIR/test.jpg" > "$OUTFILE" 2>&1 && exiv2 -pv pr "$LOGDIR/test.jpg" >> "$OUTFILE" 2>&1'
COMMAND='env LC_NUMERIC=C TZ="PST8PDT,M3.2.0,M11.1.0" $PROGRAM -v -g "$STAGINGDIR/track4.gpx" "$LOGDIR/test.jpg" > "$OUTFILE" 2>&1 && exiv2 -pv pr "$LOGDIR/test.jpg" >> "$OUTFILE" 2>&1'
POSTCOMMAND='rm -f "$LOGDIR/test.jpg"'
RESULTCODE=0
SEDCOMMAND='s@^/.*/|.*Copyright.*$@@' # strip path and copyright line
2 changes: 1 addition & 1 deletion tests/data/test040.param
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ PRECOMMAND='cat "$STAGINGDIR/point7-1.jpg" >"$LOGDIR/test.jpg"'
# This time zone is equivalent to America/Vancouver (at least, in 2012)
# but should be more portable than using the symbolic name.
# Run in C locale to avoid errors when comparing numbers in output
COMMAND='env LC_ALL=C TZ="PST8PDT,M3.2.0,M11.1.0" $PROGRAM -v -g "$STAGINGDIR/track5.gpx" "$LOGDIR/test.jpg" > "$OUTFILE" 2>&1 && exiv2 -pv pr "$LOGDIR/test.jpg" >> "$OUTFILE" 2>&1'
COMMAND='env LC_NUMERIC=C TZ="PST8PDT,M3.2.0,M11.1.0" $PROGRAM -v -g "$STAGINGDIR/track5.gpx" "$LOGDIR/test.jpg" > "$OUTFILE" 2>&1 && exiv2 -pv pr "$LOGDIR/test.jpg" >> "$OUTFILE" 2>&1'
POSTCOMMAND='rm -f "$LOGDIR/test.jpg"'
RESULTCODE=0
SEDCOMMAND='s@^/.*/|.*Copyright.*$@@' # strip path and copyright line
2 changes: 1 addition & 1 deletion tests/data/test042.param
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
TITLE='Correlate a file with --timeadd west of UTC and aligned on the half hour'
PRECOMMAND='cat "$STAGINGDIR/point3-1.jpg" >"$LOGDIR/test.jpg"'
# Run in C locale to avoid errors when comparing numbers in output
COMMAND='env LC_ALL=C $PROGRAM --timeadd -3:30 -v -g "$STAGINGDIR/track6.gpx" "$LOGDIR/test.jpg" > "$OUTFILE" 2>&1 && exiv2 -pv pr "$LOGDIR/test.jpg" >> "$OUTFILE" 2>&1'
COMMAND='env LC_NUMERIC=C $PROGRAM --timeadd -3:30 -v -g "$STAGINGDIR/track6.gpx" "$LOGDIR/test.jpg" > "$OUTFILE" 2>&1 && exiv2 -pv pr "$LOGDIR/test.jpg" >> "$OUTFILE" 2>&1'
POSTCOMMAND='rm -f "$LOGDIR/test.jpg"'
RESULTCODE=0
SEDCOMMAND='s@^([a-zA-Z]:)?/.*/|.*Copyright.*$@@' # strip path and copyright line
2 changes: 1 addition & 1 deletion tests/data/test043.param
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
TITLE='Correlate a file with --timeadd east of UTC'
PRECOMMAND='cat "$STAGINGDIR/point4-1.jpg" >"$LOGDIR/test.jpg"'
# Run in C locale to avoid errors when comparing numbers in output
COMMAND='env LC_ALL=C $PROGRAM --timeadd 1:00 -v -g "$STAGINGDIR/track2.gpx" "$LOGDIR/test.jpg" > "$OUTFILE" 2>&1 && exiv2 -pv pr "$LOGDIR/test.jpg" >> "$OUTFILE" 2>&1'
COMMAND='env LC_NUMERIC=C $PROGRAM --timeadd 1:00 -v -g "$STAGINGDIR/track2.gpx" "$LOGDIR/test.jpg" > "$OUTFILE" 2>&1 && exiv2 -pv pr "$LOGDIR/test.jpg" >> "$OUTFILE" 2>&1'
POSTCOMMAND='rm -f "$LOGDIR/test.jpg"'
RESULTCODE=0
SEDCOMMAND='s@^([a-zA-Z]:)?/.*/|.*Copyright.*$@@' # strip path and copyright line
2 changes: 1 addition & 1 deletion tests/data/test044.param
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
TITLE='Fix a bad GPS date with --fix-datestamps'
PRECOMMAND='cat "$STAGINGDIR/baddate.jpg" >"$LOGDIR/test.jpg"'
# Run in C locale to avoid errors when comparing days of week in output
COMMAND='env LC_ALL=C $PROGRAM --fix-datestamps -z -7 "$LOGDIR/test.jpg" > "$OUTFILE" 2>&1 && exiv2 -pv pr "$LOGDIR/test.jpg" >> "$OUTFILE" 2>&1 && $PROGRAM --fix-datestamps -z -7 "$LOGDIR/test.jpg" >> "$OUTFILE" 2>&1'
COMMAND='env LC_TIME=C $PROGRAM --fix-datestamps -z -7 "$LOGDIR/test.jpg" > "$OUTFILE" 2>&1 && exiv2 -pv pr "$LOGDIR/test.jpg" >> "$OUTFILE" 2>&1 && $PROGRAM --fix-datestamps -z -7 "$LOGDIR/test.jpg" >> "$OUTFILE" 2>&1'
POSTCOMMAND='rm -f "$LOGDIR/test.jpg"'
RESULTCODE=0
SEDCOMMAND='s@^([a-zA-Z]:)?/.*/@@' # strip path
2 changes: 1 addition & 1 deletion tests/data/test051.param
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
TITLE='Fix a bad GPS date with --fix-datestamps on a read-only file'
PRECOMMAND='cat "$STAGINGDIR/baddate.jpg" >"$LOGDIR/test.jpg" && chmod a-w "$LOGDIR/test.jpg"'
# Run in C locale to avoid errors when comparing days of week in output
COMMAND='env LC_ALL=C $PROGRAM --fix-datestamps -z -7 "$LOGDIR/test.jpg" > "$OUTFILE" 2>&1'
COMMAND='env LC_TIME=C $PROGRAM --fix-datestamps -z -7 "$LOGDIR/test.jpg" > "$OUTFILE" 2>&1'
POSTCOMMAND='rm -f "$LOGDIR/test.jpg"'
RESULTCODE=1
SEDCOMMAND='1s@^.*/@@' # strip path
2 changes: 1 addition & 1 deletion tests/data/test054.param
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
TITLE='Correlate many files, with a write failure'
PRECOMMAND='for f in baddate.jpg noexif.jpg notime.jpg point1-1.jpg point1-2.jpg point2-1.jpg point2-2.jpg point7-1.jpg point3-1.jpg point4-1.jpg withgps.jpg; do cat "$STAGINGDIR/$f" >"$LOGDIR/test-$f"; done && chmod a-w "$LOGDIR/test-point1-2.jpg"'
# Run in C locale to avoid errors when comparing numbers in output
COMMAND='env LC_ALL=C $PROGRAM --verbose -t -z 0 -g "$STAGINGDIR/track3.gpx" "$LOGDIR"/test-baddate.jpg "$LOGDIR"/test-noexif.jpg "$LOGDIR"/test-notime.jpg "$LOGDIR"/test-point1-1.jpg "$LOGDIR"/test-point1-2.jpg "$LOGDIR"/test-point2-1.jpg "$LOGDIR"/test-point2-2.jpg "$LOGDIR"/test-point7-1.jpg "$LOGDIR"/test-point3-1.jpg "$LOGDIR"/test-point4-1.jpg "$LOGDIR"/test-withgps.jpg > "$OUTFILE" 2>&1'
COMMAND='env LC_NUMERIC=C $PROGRAM --verbose -t -z 0 -g "$STAGINGDIR/track3.gpx" "$LOGDIR"/test-baddate.jpg "$LOGDIR"/test-noexif.jpg "$LOGDIR"/test-notime.jpg "$LOGDIR"/test-point1-1.jpg "$LOGDIR"/test-point1-2.jpg "$LOGDIR"/test-point2-1.jpg "$LOGDIR"/test-point2-2.jpg "$LOGDIR"/test-point7-1.jpg "$LOGDIR"/test-point3-1.jpg "$LOGDIR"/test-point4-1.jpg "$LOGDIR"/test-withgps.jpg > "$OUTFILE" 2>&1'
POSTCOMMAND='for f in baddate.jpg noexif.jpg notime.jpg point1-1.jpg point1-2.jpg point2-1.jpg point2-2.jpg point7-1.jpg point3-1.jpg point4-1.jpg withgps.jpg; do rm -f "$LOGDIR/test-$f"; done'
RESULTCODE=1
SEDCOMMAND='s@^([a-zA-Z]:)?/.*/|.*Copyright.*$@@' # strip path and copyright line
2 changes: 1 addition & 1 deletion tests/data/test059.param
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
TITLE='Show GPS data on file with negative elevation'
# Run in C locale to avoid errors when comparing numbers in output
COMMAND='env LC_ALL=C $PROGRAM -s "$STAGINGDIR/point1-3.jpg" > "$OUTFILE" 2>&1'
COMMAND='env LC_NUMERIC=C $PROGRAM -s "$STAGINGDIR/point1-3.jpg" > "$OUTFILE" 2>&1'
RESULTCODE=0
SEDCOMMAND='s@^.*/@@' # strip path
2 changes: 1 addition & 1 deletion tests/data/test060.param
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ TITLE='Test that --no-mtime is implied by --fix-datestamps'
# result, so they should not disrupt operation of the test suite.
PRECOMMAND='cat "$STAGINGDIR/baddate.jpg" >"$LOGDIR/test.jpg" && touch -t 201001020304.05 "$LOGDIR/test.jpg" && touch "$LOGDIR/ztest.jpg"'
# Run in C locale to avoid errors when comparing days of week in output
COMMAND='env LC_ALL=C $PROGRAM --fix-datestamps -z -7 "$LOGDIR/test.jpg" > "$OUTFILE" 2>&1 && ls -t "$LOGDIR/ztest.jpg" "$LOGDIR/test.jpg" >> "$OUTFILE" 2>&1'
COMMAND='env LC_TIME=C $PROGRAM --fix-datestamps -z -7 "$LOGDIR/test.jpg" > "$OUTFILE" 2>&1 && ls -t "$LOGDIR/ztest.jpg" "$LOGDIR/test.jpg" >> "$OUTFILE" 2>&1'
POSTCOMMAND='rm -f "$LOGDIR/test.jpg" "$LOGDIR/ztest.jpg"'
RESULTCODE=0
SEDCOMMAND='s@([a-zA-Z]:)?/[^ ].*/@@' # strip paths
2 changes: 1 addition & 1 deletion tests/data/test063.param
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ TITLE='Show GPS data on file in southern hemisphere'
# Synthesize an appropriate file on which the run the real test
PRECOMMAND='cat "$STAGINGDIR/point5-1.jpg" >"$LOGDIR/test.jpg" && $PROGRAM -z -14:00 -g "$STAGINGDIR/track7.gpx" "$LOGDIR/test.jpg" 2>"$OUTFILE" > /dev/null'
# Run in C locale to avoid errors when comparing numbers in output
COMMAND='env LC_ALL=C $PROGRAM -s "$LOGDIR/test.jpg" >> "$OUTFILE" 2>&1'
COMMAND='env LC_NUMERIC=C $PROGRAM -s "$LOGDIR/test.jpg" >> "$OUTFILE" 2>&1'
POSTCOMMAND='rm -f "$LOGDIR/test.jpg"'
RESULTCODE=0
SEDCOMMAND='s@^.*/@@' # strip path
2 changes: 1 addition & 1 deletion tests/data/test079.param
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
TITLE='Test --fix-datestamps with --no-write'
PRECOMMAND='cat "$STAGINGDIR/baddate.jpg" >"$LOGDIR/test.jpg"'
# Run in C locale to avoid errors when comparing days of week in output
COMMAND='env LC_ALL=C $PROGRAM --no-write --fix-datestamps -z -7 "$LOGDIR/test.jpg" > "$OUTFILE" 2>&1 && exiv2 -pv pr "$LOGDIR/test.jpg" >> "$OUTFILE" 2>&1'
COMMAND='env LC_TIME=C $PROGRAM --no-write --fix-datestamps -z -7 "$LOGDIR/test.jpg" > "$OUTFILE" 2>&1 && exiv2 -pv pr "$LOGDIR/test.jpg" >> "$OUTFILE" 2>&1'
POSTCOMMAND='rm -f "$LOGDIR/test.jpg"'
RESULTCODE=0
SEDCOMMAND='1s@^.*/@@' # strip path
2 changes: 1 addition & 1 deletion tests/data/test082.param
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
TITLE='Fix bad date with --fix-datestamps with corrupt lat/long'
PRECOMMAND='cat "$STAGINGDIR/baddate2.jpg" >"$LOGDIR/test.jpg"'
# Run in C locale to avoid errors when comparing days of week in output
COMMAND='env LC_ALL=C $PROGRAM --fix-datestamps -z -7 "$LOGDIR/test.jpg" > "$OUTFILE" 2>&1 && exiv2 -pv pr "$LOGDIR/test.jpg" >> "$OUTFILE" 2>&1'
COMMAND='env LC_TIME=C $PROGRAM --fix-datestamps -z -7 "$LOGDIR/test.jpg" > "$OUTFILE" 2>&1 && exiv2 -pv pr "$LOGDIR/test.jpg" >> "$OUTFILE" 2>&1'
POSTCOMMAND='rm -f "$LOGDIR/test.jpg"'
RESULTCODE=0
SEDCOMMAND='1s@^.*/@@' # strip path
2 changes: 1 addition & 1 deletion tests/data/test083.param
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
TITLE='Show GPS data on file with corrupt lat/long'
# Run in C locale to avoid errors when comparing numbers in output
COMMAND='env LC_ALL=C $PROGRAM -s "$STAGINGDIR/baddate2.jpg" > "$OUTFILE" 2>&1'
COMMAND='env LC_NUMERIC=C $PROGRAM -s "$STAGINGDIR/baddate2.jpg" > "$OUTFILE" 2>&1'
RESULTCODE=0
SEDCOMMAND='s@^.*/@@' # strip path
2 changes: 1 addition & 1 deletion tests/data/test098.param
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
TITLE='Geotag a file from a specified latitude/longitude/elevation'
PRECOMMAND='cat "$STAGINGDIR/point1-1.jpg" >"$LOGDIR/test.jpg"'
# Run in C locale to correctly parse these decimal numbers
COMMAND='env LC_ALL=C $PROGRAM -z+1 -l 12.34567,123.456,78.9 "$LOGDIR/test.jpg" > "$OUTFILE" 2>&1 && exiv2 -pv pr "$LOGDIR/test.jpg" >> "$OUTFILE" 2>&1'
COMMAND='env LC_NUMERIC=C $PROGRAM -z+1 -l 12.34567,123.456,78.9 "$LOGDIR/test.jpg" > "$OUTFILE" 2>&1 && exiv2 -pv pr "$LOGDIR/test.jpg" >> "$OUTFILE" 2>&1'
POSTCOMMAND='rm -f "$LOGDIR/test.jpg"'
RESULTCODE=0
2 changes: 1 addition & 1 deletion tests/data/test099.param
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
TITLE='Geotag a file from a specified latitude/longitude w/o elevation'
PRECOMMAND='cat "$STAGINGDIR/point1-1.jpg" >"$LOGDIR/test.jpg"'
# Run in C locale to correctly parse these decimal numbers
COMMAND='env LC_ALL=C $PROGRAM -z+1 -l -89.000001,179.9 "$LOGDIR/test.jpg" > "$OUTFILE" 2>&1 && exiv2 -pv pr "$LOGDIR/test.jpg" >> "$OUTFILE" 2>&1'
COMMAND='env LC_NUMERIC=C $PROGRAM -z+1 -l -89.000001,179.9 "$LOGDIR/test.jpg" > "$OUTFILE" 2>&1 && exiv2 -pv pr "$LOGDIR/test.jpg" >> "$OUTFILE" 2>&1'
POSTCOMMAND='rm -f "$LOGDIR/test.jpg"'
RESULTCODE=0
3 changes: 2 additions & 1 deletion tests/data/test100.param
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ PRECOMMAND='cat "$STAGINGDIR/point1-1.jpg" >"$LOGDIR/test.jpg"'
# present when the UTF-8 degrees symbol is being used, as it is here.
# As can be seen, it's tricky to pass a single quote character into the test
# suite.
COMMAND='env LC_CTYPE=UTF-8 $PROGRAM -z+1 -l -34d56m08.9s,-90°0'"\\'"'59.11111\" "$LOGDIR/test.jpg" > "$OUTFILE" 2>&1 && exiv2 -pv pr "$LOGDIR/test.jpg" >> "$OUTFILE" 2>&1'
# Run in C locale to avoid errors when comparing numbers in output
COMMAND='env LC_CTYPE=UTF-8 LC_NUMERIC=C $PROGRAM -z+1 -l -34d56m08.9s,-90°0'"\\'"'59.11111\" "$LOGDIR/test.jpg" > "$OUTFILE" 2>&1 && exiv2 -pv pr "$LOGDIR/test.jpg" >> "$OUTFILE" 2>&1'
POSTCOMMAND='rm -f "$LOGDIR/test.jpg"'
RESULTCODE=0
2 changes: 1 addition & 1 deletion tests/data/test101.param
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
TITLE='Geotag a file from a specified latitude/longitude/elevation, space separated'
PRECOMMAND='cat "$STAGINGDIR/point1-1.jpg" >"$LOGDIR/test.jpg"'
# Run in C locale to correctly parse these decimal numbers
COMMAND='env LC_ALL=C $PROGRAM -z+1 -l 89.9999999\ 179.999\ 99999.999 "$LOGDIR/test.jpg" > "$OUTFILE" 2>&1 && exiv2 -pv pr "$LOGDIR/test.jpg" >> "$OUTFILE" 2>&1'
COMMAND='env LC_NUMERIC=C $PROGRAM -z+1 -l 89.9999999\ 179.999\ 99999.999 "$LOGDIR/test.jpg" > "$OUTFILE" 2>&1 && exiv2 -pv pr "$LOGDIR/test.jpg" >> "$OUTFILE" 2>&1'
POSTCOMMAND='rm -f "$LOGDIR/test.jpg"'
RESULTCODE=0
2 changes: 1 addition & 1 deletion tests/data/test102.param
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
TITLE='Geotag a file from a specified latitude/longitude/elevation, tab separated'
PRECOMMAND='cat "$STAGINGDIR/point1-1.jpg" >"$LOGDIR/test.jpg"'
# Run in C locale to correctly parse these decimal numbers
COMMAND='env LC_ALL=C $PROGRAM -z+1 -l "-89.9999999 -179.999 -9999.999" "$LOGDIR/test.jpg" > "$OUTFILE" 2>&1 && exiv2 -pv pr "$LOGDIR/test.jpg" >> "$OUTFILE" 2>&1'
COMMAND='env LC_NUMERIC=C $PROGRAM -z+1 -l "-89.9999999 -179.999 -9999.999" "$LOGDIR/test.jpg" > "$OUTFILE" 2>&1 && exiv2 -pv pr "$LOGDIR/test.jpg" >> "$OUTFILE" 2>&1'
POSTCOMMAND='rm -f "$LOGDIR/test.jpg"'
RESULTCODE=0
2 changes: 1 addition & 1 deletion tests/data/test103.param
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
TITLE='Geotag a file from a specified latitude/longitude, tab separated (dms forms)'
PRECOMMAND='cat "$STAGINGDIR/point1-1.jpg" >"$LOGDIR/test.jpg"'
# Run in C locale to correctly parse these decimal numbers
COMMAND='env LC_ALL=C $PROGRAM -z+1 -l "-89d59m59.9999s -179d59m059.999s" "$LOGDIR/test.jpg" > "$OUTFILE" 2>&1 && exiv2 -pv pr "$LOGDIR/test.jpg" >> "$OUTFILE" 2>&1'
COMMAND='env LC_NUMERIC=C $PROGRAM -z+1 -l "-89d59m59.9999s -179d59m059.999s" "$LOGDIR/test.jpg" > "$OUTFILE" 2>&1 && exiv2 -pv pr "$LOGDIR/test.jpg" >> "$OUTFILE" 2>&1'
POSTCOMMAND='rm -f "$LOGDIR/test.jpg"'
RESULTCODE=0
2 changes: 1 addition & 1 deletion tests/data/test104.param
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
TITLE='Geotag a file from a specified latitude/longitude, space separated (dms forms)'
PRECOMMAND='cat "$STAGINGDIR/point1-1.jpg" >"$LOGDIR/test.jpg"'
# Run in C locale to correctly parse these decimal numbers
COMMAND='env LC_ALL=C $PROGRAM -z+1 -l "+89d00m59.0000s +0179d059m059.000s" "$LOGDIR/test.jpg" > "$OUTFILE" 2>&1 && exiv2 -pv pr "$LOGDIR/test.jpg" >> "$OUTFILE" 2>&1'
COMMAND='env LC_NUMERIC=C $PROGRAM -z+1 -l "+89d00m59.0000s +0179d059m059.000s" "$LOGDIR/test.jpg" > "$OUTFILE" 2>&1 && exiv2 -pv pr "$LOGDIR/test.jpg" >> "$OUTFILE" 2>&1'
POSTCOMMAND='rm -f "$LOGDIR/test.jpg"'
RESULTCODE=0
2 changes: 1 addition & 1 deletion tests/data/test105.param
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
TITLE='Specify out-of-range latitude'
PRECOMMAND='cat "$STAGINGDIR/point1-1.jpg" >"$LOGDIR/test.jpg"'
# Run in C locale to correctly parse these decimal numbers
COMMAND='env LC_ALL=C $PROGRAM -l 92.34567,123.456,78.9 "$LOGDIR/test.jpg" > "$OUTFILE" 2>&1'
COMMAND='env LC_NUMERIC=C $PROGRAM -l 92.34567,123.456,78.9 "$LOGDIR/test.jpg" > "$OUTFILE" 2>&1'
POSTCOMMAND='rm -f "$LOGDIR/test.jpg"'
RESULTCODE=1
2 changes: 1 addition & 1 deletion tests/data/test107.param
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
TITLE='Specify out-of-range longitude'
PRECOMMAND='cat "$STAGINGDIR/point1-1.jpg" >"$LOGDIR/test.jpg"'
# Run in C locale to correctly parse these decimal numbers
COMMAND='env LC_ALL=C $PROGRAM -l 92.34567,180.456 "$LOGDIR/test.jpg" > "$OUTFILE" 2>&1'
COMMAND='env LC_NUMERIC=C $PROGRAM -l 92.34567,180.456 "$LOGDIR/test.jpg" > "$OUTFILE" 2>&1'
POSTCOMMAND='rm -f "$LOGDIR/test.jpg"'
RESULTCODE=1
3 changes: 2 additions & 1 deletion tests/data/test111.param
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ PRECOMMAND='cat "$STAGINGDIR/point1-1.jpg" >"$LOGDIR/test.jpg"'
# present when the UTF-8 degrees symbol is being used, as it is here.
# As can be seen, it's tricky to pass a single quote character into the test
# suite.
COMMAND='env LC_CTYPE=UTF-8 $PROGRAM -z+1 -l "-34d 56m 8.9s, -90° 0m 59.11111s 123.4" "$LOGDIR/test.jpg" > "$OUTFILE" 2>&1 && exiv2 -pv pr "$LOGDIR/test.jpg" >> "$OUTFILE" 2>&1'
# Run in C locale to avoid errors when comparing numbers in output
COMMAND='env LC_CTYPE=UTF-8 LC_NUMERIC=C $PROGRAM -z+1 -l "-34d 56m 8.9s, -90° 0m 59.11111s 123.4" "$LOGDIR/test.jpg" > "$OUTFILE" 2>&1 && exiv2 -pv pr "$LOGDIR/test.jpg" >> "$OUTFILE" 2>&1'
POSTCOMMAND='rm -f "$LOGDIR/test.jpg"'
RESULTCODE=0
3 changes: 2 additions & 1 deletion tests/data/test112.param
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ PRECOMMAND='cat "$STAGINGDIR/point1-1.jpg" >"$LOGDIR/test.jpg"'
# present when the UTF-8 degrees symbol is being used, as it is here.
# As can be seen, it's tricky to pass a single quote character into the test
# suite.
COMMAND='env LC_CTYPE=UTF-8 $PROGRAM -z+1 -l "-34d 56 08.9 -90° 0m 59.11111\" -123.4 " "$LOGDIR/test.jpg" > "$OUTFILE" 2>&1 && exiv2 -pv pr "$LOGDIR/test.jpg" >> "$OUTFILE" 2>&1'
# Run in C locale to avoid errors when comparing numbers in output
COMMAND='env LC_CTYPE=UTF-8 LC_NUMERIC=C $PROGRAM -z+1 -l "-34d 56 08.9 -90° 0m 59.11111\" -123.4 " "$LOGDIR/test.jpg" > "$OUTFILE" 2>&1 && exiv2 -pv pr "$LOGDIR/test.jpg" >> "$OUTFILE" 2>&1'
POSTCOMMAND='rm -f "$LOGDIR/test.jpg"'
RESULTCODE=0
3 changes: 2 additions & 1 deletion tests/data/test113.param
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ TITLE='Geotag a file from a specified latitude/longitude (dms form with ISO 8859
PRECOMMAND='cat "$STAGINGDIR/point1-1.jpg" >"$LOGDIR/test.jpg"'
# The degree symbol is in ISO 8859/1 but since it's hard-coded in the program,
# it's unnecessary to actually be running in an ISO 8859/1 locale to work.
COMMAND='$PROGRAM -z+1 -l -34d56m08.9s,-90�0'"\\'"'59.11111\" "$LOGDIR/test.jpg" > "$OUTFILE" 2>&1 && exiv2 -pv pr "$LOGDIR/test.jpg" >> "$OUTFILE" 2>&1'
# Run in C locale to avoid errors when comparing numbers in output
COMMAND='env LC_NUMERIC=C $PROGRAM -z+1 -l -34d56m08.9s,-90�0'"\\'"'59.11111\" "$LOGDIR/test.jpg" > "$OUTFILE" 2>&1 && exiv2 -pv pr "$LOGDIR/test.jpg" >> "$OUTFILE" 2>&1'
POSTCOMMAND='rm -f "$LOGDIR/test.jpg"'
RESULTCODE=0
2 changes: 1 addition & 1 deletion tests/data/test117.param
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
TITLE='Show GPS data with existing and nonexistent files'
# Run in C locale to avoid errors when comparing numbers in output
COMMAND='env LC_ALL=C $PROGRAM -s "$STAGINGDIR/withgps.jpg" does-not-exist "$STAGINGDIR/withgps.jpg" > "$OUTFILE" 2>&1'
COMMAND='env LC_NUMERIC=C $PROGRAM -s "$STAGINGDIR/withgps.jpg" does-not-exist "$STAGINGDIR/withgps.jpg" > "$OUTFILE" 2>&1'
RESULTCODE=1
SEDCOMMAND='s@([a-zA-Z]:)?/.*/@@' # strip path
2 changes: 1 addition & 1 deletion tests/data/test126.param
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
TITLE='Show GPS data on file with no elevation'
# Run in C locale to avoid errors when comparing numbers in output
COMMAND='env LC_ALL=C $PROGRAM -s "$STAGINGDIR/noelev.jpg" > "$OUTFILE" 2>&1'
COMMAND='env LC_NUMERIC=C $PROGRAM -s "$STAGINGDIR/noelev.jpg" > "$OUTFILE" 2>&1'
RESULTCODE=0
SEDCOMMAND='s@^.*/@@' # strip path
2 changes: 1 addition & 1 deletion tests/data/test127.param
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
TITLE='Show GPS data on file with no elevation with --machine'
# Run in C locale to avoid errors when comparing numbers in output
COMMAND='env LC_ALL=C $PROGRAM -o "$STAGINGDIR/noelev.jpg" > "$OUTFILE" 2>&1'
COMMAND='env LC_NUMERIC=C $PROGRAM -o "$STAGINGDIR/noelev.jpg" > "$OUTFILE" 2>&1'
RESULTCODE=0
SEDCOMMAND='s@([a-zA-Z]:)?/.*/@@' # strip path
Loading

0 comments on commit e018a41

Please sign in to comment.