summaryrefslogtreecommitdiffstats
path: root/libtests/qtest/rc4.test
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2008-04-29 14:55:25 +0200
committerJay Berkenbilt <ejb@ql.org>2008-04-29 14:55:25 +0200
commit9a0b88bf7777c153dc46ace22db74ef24d51583a (patch)
treef567ac1cf2bf5071a611eb49323a935b6ac938ff /libtests/qtest/rc4.test
downloadqpdf-9a0b88bf7777c153dc46ace22db74ef24d51583a.tar.zst
update release date to actual daterelease-qpdf-2.0
git-svn-id: svn+q:///qpdf/trunk@599 71b93d88-0707-0410-a8cf-f5a4172ac649
Diffstat (limited to 'libtests/qtest/rc4.test')
-rw-r--r--libtests/qtest/rc4.test45
1 files changed, 45 insertions, 0 deletions
diff --git a/libtests/qtest/rc4.test b/libtests/qtest/rc4.test
new file mode 100644
index 00000000..0207317c
--- /dev/null
+++ b/libtests/qtest/rc4.test
@@ -0,0 +1,45 @@
+#!/usr/bin/env perl
+require 5.008;
+BEGIN { $^W = 1; }
+use strict;
+
+chdir("rc4") or die "chdir testdir failed: $!\n";
+
+require TestDriver;
+
+my $td = new TestDriver('RC4');
+
+cleanup();
+
+my @tests = ('0123456789abcdef',
+ '0123456789abcdef',
+ '0000000000000000',
+ 'ef012345',
+ '0123456789abcdef');
+
+my $n = 0;
+foreach my $key (@tests)
+{
+ ++$n;
+ $td->runtest("test $n",
+ {$td->COMMAND => "rc4 $key test$n.in tmp1-$n.out"},
+ {$td->STRING => "", $td->EXIT_STATUS => 0});
+ $td->runtest("check output",
+ {$td->FILE => "tmp1-$n.out"},
+ {$td->FILE => "test$n.out"});
+ $td->runtest("test $n reverse",
+ {$td->COMMAND => "rc4 $key test$n.out tmp2-$n.out"},
+ {$td->STRING => "", $td->EXIT_STATUS => 0});
+ $td->runtest("check output",
+ {$td->FILE => "tmp2-$n.out"},
+ {$td->FILE => "test$n.in"});
+}
+
+cleanup();
+
+$td->report(4 * scalar(@tests));
+
+sub cleanup
+{
+ system("rm -f tmp*-*");
+}