FileAnalysis: unit test tweaks (portability, etc.)

This commit is contained in:
Jon Siwek 2013-03-27 14:51:23 -05:00
parent dce3e6448f
commit 7caa4aa45c
7 changed files with 15 additions and 11 deletions

View file

@ -2,4 +2,5 @@
#
# Default canonifier used with the tests in testing/btest/*.
`dirname $0`/diff-remove-timestamps
`dirname $0`/diff-remove-timestamps \
| `dirname $0`/diff-remove-mime-types

View file

@ -76,13 +76,16 @@ hook FileAnalysis::policy(trig: FileAnalysis::Trigger, info: FileAnalysis::Info)
for ( act in info$actions )
switch ( act$act ) {
case FileAnalysis::ACTION_MD5:
print fmt("MD5: %s", info$actions[act]$md5);
if ( info$actions[act]?$md5 )
print fmt("MD5: %s", info$actions[act]$md5);
break;
case FileAnalysis::ACTION_SHA1:
print fmt("SHA1: %s", info$actions[act]$sha1);
if ( info$actions[act]?$sha1 )
print fmt("SHA1: %s", info$actions[act]$sha1);
break;
case FileAnalysis::ACTION_SHA256:
print fmt("SHA256: %s", info$actions[act]$sha256);
if ( info$actions[act]?$sha256 )
print fmt("SHA256: %s", info$actions[act]$sha256);
break;
}
break;