]> The Tcpdump Group git mirrors - tcpdump/commitdiff
TESTrun: add definitions of true and false.
authorGuy Harris <[email protected]>
Mon, 15 Jun 2020 00:49:44 +0000 (17:49 -0700)
committerGuy Harris <[email protected]>
Mon, 15 Jun 2020 00:49:44 +0000 (17:49 -0700)
If we don't give them definitions, in some contents they are interpreted
as strings, and 'false', being a non-empty string, is interpreted as
being true.  See, for example:

https://stackoverflow.com/questions/6936194/is-there-a-built-in-true-false-boolean-value-in-perl

tests/TESTrun

index cb46a50552823735ed8e1f31509e31c14e1fdfd3..842a2dfdb307efaaccb9cbbf76a8413e5b47685b 100755 (executable)
@@ -18,6 +18,11 @@ if (!($TCPDUMP = $ENV{TCPDUMP_BIN})) {
     }
 }
 
+#
+# Make true and false work as Booleans.
+#
+use constant { true => 1, false => 0 };
+
 use File::Basename;
 use POSIX qw( WEXITSTATUS WIFEXITED);
 use Cwd qw(abs_path getcwd);