mirror of
https://github.com/qpdf/qpdf.git
synced 2025-01-31 02:48:31 +00:00
make -key not take an argument with a / to appease msys's path translation
git-svn-id: svn+q:///qpdf/trunk@803 71b93d88-0707-0410-a8cf-f5a4172ac649
This commit is contained in:
parent
b2e5c8c93f
commit
351284b5ec
@ -1,7 +1,10 @@
|
||||
Common Setup
|
||||
============
|
||||
|
||||
To be able to run qpdf's test suite, you must have cygwin installed.
|
||||
To be able to build qpdf and run its test suite, you must have either
|
||||
Cygwin or MSYS from MinGW (>= 1.0.11) installed.
|
||||
|
||||
qpdf's test suite, you must have cygwin installed.
|
||||
This is because qpdf's test suite uses qtest, which requires cygwin
|
||||
perl on Windows. (Hopefully a future version of qtest will work with
|
||||
ActiveState Perl.) You must have at least perl and gnu diffutils
|
||||
|
@ -100,7 +100,7 @@ int main(int argc, char* argv[])
|
||||
|
||||
char* fl_in = 0;
|
||||
char* fl_out = 0;
|
||||
char* cur_key = 0;
|
||||
std::string cur_key;
|
||||
|
||||
for (int i = 1; i < argc; ++i)
|
||||
{
|
||||
@ -120,18 +120,22 @@ int main(int argc, char* argv[])
|
||||
{
|
||||
QTC::TC("examples", "pdf-mod-info -key");
|
||||
cur_key = argv[i];
|
||||
if (! ((cur_key.length() > 0) && (cur_key[0] == '/')))
|
||||
{
|
||||
cur_key = "/" + cur_key;
|
||||
}
|
||||
Keys[cur_key] = "";
|
||||
}
|
||||
else if ((! strcmp(argv[i], "-val")) && (++i < argc))
|
||||
{
|
||||
if (cur_key == 0)
|
||||
if (cur_key.empty())
|
||||
{
|
||||
QTC::TC("examples", "pdf-mod-info usage wrong val");
|
||||
usage();
|
||||
}
|
||||
QTC::TC("examples", "pdf-mod-info -val");
|
||||
Keys[cur_key] = argv[i];
|
||||
cur_key = 0;
|
||||
cur_key.clear();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -34,7 +34,7 @@ $td->runtest("usage #3",
|
||||
$td->NORMALIZE_NEWLINES);
|
||||
|
||||
$td->runtest("usage #4",
|
||||
{$td->COMMAND => "$prg -in source1.pdf -key /date -val 01/01/01 -val 12/12/12"},
|
||||
{$td->COMMAND => "$prg -in source1.pdf -key date -val 01/01/01 -val 12/12/12"},
|
||||
{$td->FILE => "usage.out",
|
||||
$td->EXIT_STATUS => 2},
|
||||
$td->NORMALIZE_NEWLINES);
|
||||
@ -57,23 +57,23 @@ $td->runtest("dump #3",
|
||||
$td->EXIT_STATUS => 0});
|
||||
|
||||
run_and_cmp("modify Subject",
|
||||
"$prg -in files/source1.pdf -out out.pdf -key /Subject " .
|
||||
"$prg -in files/source1.pdf -out out.pdf -key Subject " .
|
||||
"-val \"Export Business\"",
|
||||
"", "out.pdf", "files/1.qdf");
|
||||
|
||||
run_and_cmp("add Subject, remove Producer, modify CreationDate",
|
||||
"$prg -in files/source2.pdf -out out.pdf -key /Subject " .
|
||||
"-val \"Tammlin\" -key /Producer -key /CreationDate -val 12/12",
|
||||
"$prg -in files/source2.pdf -out out.pdf -key Subject " .
|
||||
"-val \"Tammlin\" -key Producer -key CreationDate -val 12/12",
|
||||
"", "out.pdf", "files/2.qdf");
|
||||
|
||||
run_and_cmp("add Subject (empty-info file)",
|
||||
"$prg -in files/empty-info.pdf -out out.pdf -key /Subject " .
|
||||
"$prg -in files/empty-info.pdf -out out.pdf -key Subject " .
|
||||
"-val Tammlin",
|
||||
"", "out.pdf", "files/3.qdf");
|
||||
|
||||
copy("files/no-info.pdf", "no-info.pdf") or die "can't copy no-info: $!";
|
||||
run_and_cmp("in-place Producer added (no-info file)",
|
||||
"$prg -in no-info.pdf -key /Producer -val \"Obivan Kinobi\"",
|
||||
"$prg -in no-info.pdf -key Producer -val \"Obivan Kinobi\"",
|
||||
"", "no-info.pdf", "files/4.qdf");
|
||||
|
||||
cleanup();
|
||||
|
Loading…
x
Reference in New Issue
Block a user