From c3409a6069b7d4b5fa9b56c0836c9fcfcdbb86b0 Mon Sep 17 00:00:00 2001 From: Robin Mills Date: Sat, 3 Apr 2021 13:16:24 +0100 Subject: [PATCH 1/2] Add test script. --- tests/bugfixes/github/test_issue_1504.py | 28 ++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 tests/bugfixes/github/test_issue_1504.py diff --git a/tests/bugfixes/github/test_issue_1504.py b/tests/bugfixes/github/test_issue_1504.py new file mode 100644 index 00000000..11cb7136 --- /dev/null +++ b/tests/bugfixes/github/test_issue_1504.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- + +import system_tests +class issue_1504_metacopy(metaclass=system_tests.CaseMeta): + url = "https://github.com/Exiv2/exiv2/pull/1504" + commands = ["$metacopy" + ,"$metacopy -h" + ] + retval = [ 1,2] + stderr = [ """metacopy: Read and write files must be specified +""",""] + stdout = [""" +Reads and writes raw metadata. Use -h option for help. +Usage: metacopy [-iecaph] readfile writefile +""",""" +Reads and writes raw metadata. Use -h option for help. +Usage: metacopy [-iecaph] readfile writefile + +Options: + -i Read Iptc data from readfile and write to writefile. + -e Read Exif data from readfile and write to writefile. + -c Read Jpeg comment from readfile and write to writefile. + -x Read XMP data from readfile and write to writefile. + -a Read all metadata from readfile and write to writefile. + -p Preserve existing metadata in writefile if not replaced. + -h Display this help and exit. + +"""] From b472b07cc47ca3a4d15f3858980dbf54596ecfb7 Mon Sep 17 00:00:00 2001 From: Robin Mills Date: Sat, 3 Apr 2021 13:16:41 +0100 Subject: [PATCH 2/2] fix_1504_metacopy_optstring --- README-SAMPLES.md | 2 +- tests/bugfixes/github/test_issue_1504.py | 4 ++-- tests/suite.conf | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README-SAMPLES.md b/README-SAMPLES.md index d755537d..eea883f3 100644 --- a/README-SAMPLES.md +++ b/README-SAMPLES.md @@ -256,7 +256,7 @@ Demonstrates Exiv2 library APIs to print Iptc data. _Code: [iptcprint.cpp](sampl #### metacopy ``` -Usage: metacopy [-iecaph] readfile writefile +Usage: metacopy [-iecxaph] readfile writefile Reads and writes raw metadata. Use -h option for help. ``` diff --git a/tests/bugfixes/github/test_issue_1504.py b/tests/bugfixes/github/test_issue_1504.py index 11cb7136..c58edf42 100644 --- a/tests/bugfixes/github/test_issue_1504.py +++ b/tests/bugfixes/github/test_issue_1504.py @@ -11,10 +11,10 @@ class issue_1504_metacopy(metaclass=system_tests.CaseMeta): """,""] stdout = [""" Reads and writes raw metadata. Use -h option for help. -Usage: metacopy [-iecaph] readfile writefile +Usage: metacopy [-iecxaph] readfile writefile """,""" Reads and writes raw metadata. Use -h option for help. -Usage: metacopy [-iecaph] readfile writefile +Usage: metacopy [-iecxaph] readfile writefile Options: -i Read Iptc data from readfile and write to writefile. diff --git a/tests/suite.conf b/tests/suite.conf index 2ca37435..ac3c7a0c 100644 --- a/tests/suite.conf +++ b/tests/suite.conf @@ -26,6 +26,7 @@ valgrind: exiv2: ${ENV:exiv2_path}/exiv2 unit_tests: ${ENV:exiv2_path}/unit_tests exiv2json: ${ENV:exiv2_path}/exiv2json +metacopy: ${ENV:exiv2_path}/metacopy data_path: ../test/data tmp_path: ../test/tmp tiff_test: ${ENV:exiv2_path}/tiff-test