зеркало из https://github.com/mozilla/gecko-dev.git
Add DigestTest to all.pl.
Make DigestTest and SigTest return nonzero error code on failure.
This commit is contained in:
Родитель
8089606cff
Коммит
5e1bcfd6d2
|
@ -79,7 +79,7 @@ public class DigestTest {
|
|||
if( MessageDigest.isEqual(nsdigestOut, sundigestOut) ) {
|
||||
System.out.println("Sun and Mozilla give same SHA-1 hash");
|
||||
} else {
|
||||
System.out.println("ERROR: Sun and Mozilla give different"+
|
||||
throw new Exception("ERROR: Sun and Mozilla give different"+
|
||||
" SHA-1 hashes");
|
||||
}
|
||||
|
||||
|
@ -95,7 +95,7 @@ public class DigestTest {
|
|||
if( MessageDigest.isEqual(nsdigestOut, sundigestOut) ) {
|
||||
System.out.println("Sun and Mozilla give same MD5 hash");
|
||||
} else {
|
||||
System.out.println("ERROR: Sun and Mozilla give different"+
|
||||
throw new Exception("ERROR: Sun and Mozilla give different"+
|
||||
" MD5 hashes");
|
||||
}
|
||||
|
||||
|
@ -121,13 +121,15 @@ public class DigestTest {
|
|||
if( digestOut.length == digest.getOutputSize() ) {
|
||||
System.out.println("digest output size is " + digestOut.length);
|
||||
} else {
|
||||
System.out.println("ERROR: digest output size is "+
|
||||
throw new Exception("ERROR: digest output size is "+
|
||||
digestOut.length + ", should be "+digest.getOutputSize() );
|
||||
}
|
||||
System.exit(0);
|
||||
|
||||
|
||||
} catch( Exception e ) {
|
||||
e.printStackTrace();
|
||||
System.exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -120,7 +120,7 @@ public class SigTest {
|
|||
if( signer.verify(signature) ) {
|
||||
System.out.println("Signature Verified Successfully!");
|
||||
} else {
|
||||
System.out.println("ERROR: Signature failed to verify.");
|
||||
throw new Exception("ERROR: Signature failed to verify.");
|
||||
}
|
||||
|
||||
System.out.println("SigTest passed.");
|
||||
|
|
|
@ -173,6 +173,13 @@ $result = system("$java org.mozilla.jss.tests.TestKeyGen $testdir $pwfile");
|
|||
$result >>=8;
|
||||
$result and die "TestKeyGen returned $result";
|
||||
|
||||
# test digesting
|
||||
#
|
||||
print STDERR "============= test digesting\n";
|
||||
$result = system("$java org.mozilla.jss.tests.DigestTest $testdir $pwfile");
|
||||
$result >>=8;
|
||||
$result and die "DigestTest returned $result";
|
||||
|
||||
# test signing
|
||||
#
|
||||
print STDERR "============= test signing\n";
|
||||
|
|
Загрузка…
Ссылка в новой задаче