Tests (DES): i didn't realize last commit included all the changes that it did

not all of them were ready to go out. i just meant for it to include a one-line change.

meh.
This commit is contained in:
terrafrost 2014-12-13 15:10:47 -06:00
parent c8281dd4a3
commit 8f27aaa323

View File

@ -22,9 +22,7 @@ class Unit_Crypt_DES_TestCase extends PhpseclibTestCase
$result = pack('H*', '3e7613642049af1e'); $result = pack('H*', '3e7613642049af1e');
$internal = $des->encrypt('d'); $internal = $des->encrypt('d');
if (!$this->assertEquals($result, $internal)) {
$this->assertEquals($result, $internal, 'Failed asserting that the internal engine produced the correct result'); $this->assertEquals($result, $internal, 'Failed asserting that the internal engine produced the correct result');
}
$des->setPreferredEngine(CRYPT_ENGINE_MCRYPT); $des->setPreferredEngine(CRYPT_ENGINE_MCRYPT);
if ($des->getEngine() == CRYPT_ENGINE_MCRYPT) { if ($des->getEngine() == CRYPT_ENGINE_MCRYPT) {
@ -57,10 +55,13 @@ class Unit_Crypt_DES_TestCase extends PhpseclibTestCase
$des->setPreferredEngine(CRYPT_ENGINE_INTERNAL); $des->setPreferredEngine(CRYPT_ENGINE_INTERNAL);
$internal = $des->decrypt('d'); $internal = $des->decrypt('d');
$result = pack('H*', '36a86ebd0f9e048f');
$this->assertEquals($result, $internal, 'Failed asserting that the internal engine produced the correct result');
$des->setPreferredEngine(CRYPT_ENGINE_MCRYPT); $des->setPreferredEngine(CRYPT_ENGINE_MCRYPT);
if ($des->getEngine() == CRYPT_ENGINE_MCRYPT) { if ($des->getEngine() == CRYPT_ENGINE_MCRYPT) {
$mcrypt = $des->decrypt('d'); $mcrypt = $des->decrypt('d');
$this->assertEquals($internal, $mcrypt, 'Failed asserting that the internal and mcrypt engines produce identical results'); $this->assertEquals($result, $mcrypt, 'Failed asserting that the mcrypt engine produced the correct result');
} else { } else {
self::markTestSkipped('Unable to initialize mcrypt engine'); self::markTestSkipped('Unable to initialize mcrypt engine');
} }
@ -68,7 +69,7 @@ class Unit_Crypt_DES_TestCase extends PhpseclibTestCase
$des->setPreferredEngine(CRYPT_ENGINE_OPENSSL); $des->setPreferredEngine(CRYPT_ENGINE_OPENSSL);
if ($des->getEngine() == CRYPT_ENGINE_OPENSSL) { if ($des->getEngine() == CRYPT_ENGINE_OPENSSL) {
$openssl = $des->decrypt('d'); $openssl = $des->decrypt('d');
$this->assertEquals($internal, $openssl, 'Failed asserting that the internal and OpenSSL engines produce identical results'); $this->assertEquals($result, $openssl, 'Failed asserting that the OpenSSL engine produced the correct result');
} else { } else {
self::markTestSkipped('Unable to initialize OpenSSL engine'); self::markTestSkipped('Unable to initialize OpenSSL engine');
} }