projects
/
privoxy.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
947aeaf
)
Simplify check_header_result() a bit.
author
Fabian Keil
<fk@fabiankeil.de>
Sun, 8 May 2011 13:27:53 +0000
(13:27 +0000)
committer
Fabian Keil
<fk@fabiankeil.de>
Sun, 8 May 2011 13:27:53 +0000
(13:27 +0000)
tools/privoxy-regression-test.pl
patch
|
blob
|
history
diff --git
a/tools/privoxy-regression-test.pl
b/tools/privoxy-regression-test.pl
index
c01bedb
..
828f0af
100755
(executable)
--- a/
tools/privoxy-regression-test.pl
+++ b/
tools/privoxy-regression-test.pl
@@
-7,7
+7,7
@@
# A regression test "framework" for Privoxy. For documentation see:
# perldoc privoxy-regression-test.pl
#
# A regression test "framework" for Privoxy. For documentation see:
# perldoc privoxy-regression-test.pl
#
-# $Id: privoxy-regression-test.pl,v 1.6
5 2011/04/19 13:10:11
fabiankeil Exp $
+# $Id: privoxy-regression-test.pl,v 1.6
6 2011/05/08 13:27:10
fabiankeil Exp $
#
# Wish list:
#
#
# Wish list:
#
@@
-917,12
+917,9
@@
sub check_header_result ($$) {
if ($expect_header eq 'NO CHANGE') {
if ($expect_header eq 'NO CHANGE') {
- if (defined($header) and $header eq $test->{'data'}) {
-
- $success = 1;
-
- } else {
+ $success = (defined($header) and $header eq $test->{'data'});
+ unless ($success) {
$header = "REMOVAL" unless defined $header;
l(LL_VERBOSE_FAILURE,
"Ooops. Got: '" . $header . "' while expecting: '" . $expect_header . "'");
$header = "REMOVAL" unless defined $header;
l(LL_VERBOSE_FAILURE,
"Ooops. Got: '" . $header . "' while expecting: '" . $expect_header . "'");
@@
-930,26
+927,20
@@
sub check_header_result ($$) {
} elsif ($expect_header eq 'REMOVAL') {
} elsif ($expect_header eq 'REMOVAL') {
- if (defined($header) and $header eq $test->{'data'}) {
+ # XXX: Use more reliable check here and make sure
+ # the header has a different name.
+ $success = not (defined($header) and $header eq $test->{'data'});
+ unless ($success) {
l(LL_VERBOSE_FAILURE,
"Ooops. Expected removal but: '" . $header . "' is still there.");
l(LL_VERBOSE_FAILURE,
"Ooops. Expected removal but: '" . $header . "' is still there.");
-
- } else {
-
- # XXX: Use more reliable check here and make sure
- # the header has a different name.
- $success = 1;
}
} elsif ($expect_header eq 'SOME CHANGE') {
}
} elsif ($expect_header eq 'SOME CHANGE') {
- if (defined($header) and not $header eq $test->{'data'}) {
-
- $success = 1;
-
- } else {
+ $success = (defined($header) and $header ne $test->{'data'});
+ unless ($success) {
$header = "REMOVAL" unless defined $header;
l(LL_VERBOSE_FAILURE,
"Ooops. Got: '" . $header . "' while expecting: SOME CHANGE");
$header = "REMOVAL" unless defined $header;
l(LL_VERBOSE_FAILURE,
"Ooops. Got: '" . $header . "' while expecting: SOME CHANGE");
@@
-957,12
+948,9
@@
sub check_header_result ($$) {
} else {
} else {
- if (defined($header) and $header eq $expect_header) {
-
- $success = 1;
-
- } else {
+ $success = (defined($header) and $header eq $expect_header);
+ unless ($success) {
$header = "No matching header" unless defined $header; # XXX: No header detected to be precise
l(LL_VERBOSE_FAILURE,
"Ooops. Got: '" . $header . "' while expecting: '" . $expect_header . "'");
$header = "No matching header" unless defined $header; # XXX: No header detected to be precise
l(LL_VERBOSE_FAILURE,
"Ooops. Got: '" . $header . "' while expecting: '" . $expect_header . "'");