summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/hash.cc26
-rwxr-xr-xtest/integration/test-bug-611729-mark-as-manual6
2 files changed, 25 insertions, 7 deletions
diff --git a/test/hash.cc b/test/hash.cc
index cfdb4ea9d..88f09fca0 100644
--- a/test/hash.cc
+++ b/test/hash.cc
@@ -1,6 +1,6 @@
#include <apt-pkg/md5.h>
#include <apt-pkg/sha1.h>
-#include <apt-pkg/sha256.h>
+#include <apt-pkg/sha2.h>
#include <apt-pkg/strutl.h>
#include <iostream>
@@ -10,9 +10,17 @@ template <class T> void Test(const char *In,const char *Out)
{
T Sum;
Sum.Add(In);
- cout << Sum.Result().Value() << endl;
- if (stringcasecmp(Sum.Result().Value(),Out) != 0)
+
+ cout << "expected: '" << Out << "'" << endl;
+ cout << "got : '" << Sum.Result().Value() << "'" << endl;
+ cout << "got : '" << Sum.Result().Value() << "'" << endl;
+ cout << "got : '" << Sum.Result().Value() << "'" << endl;
+ if (stringcasecmp(Sum.Result().Value(), Out) != 0) {
+ cout << "FAIL" << endl << endl;
abort();
+ } else {
+ cout << "PASS" << endl << endl;
+ }
}
template <class T> void TestMill(const char *Out)
@@ -34,9 +42,8 @@ template <class T> void TestMill(const char *Out)
Count = 0;
}
}
-
- cout << Sum.Result().Value() << endl;
- if (stringcasecmp(Sum.Result().Value(),Out) != 0)
+
+ if (stringcasecmp(Sum.Result().Value(), Out) != 0)
abort();
}
@@ -62,8 +69,13 @@ int main()
// SHA-256, From FIPS 180-2
Test<SHA256Summation>("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
"248d6a61d20638b8e5c026930c3e6039a33ce45964ff2167f6ecedd419db06c1");
-
+ // SHA-512, From
+ Test<SHA512Summation>(
+ "abc",
+ "ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a"
+ "2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f");
+
return 0;
}
diff --git a/test/integration/test-bug-611729-mark-as-manual b/test/integration/test-bug-611729-mark-as-manual
index 4e3e2fa0b..9cf01610c 100755
--- a/test/integration/test-bug-611729-mark-as-manual
+++ b/test/integration/test-bug-611729-mark-as-manual
@@ -48,11 +48,17 @@ b is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget install b -d
testmarkedauto 'b'
+rm rootdir/var/log/apt/history.log
+
aptget install b --reinstall -y -qq 2>&1 > /dev/null
testdpkgnotinstalled a
testdpkginstalled b c
testmarkedauto 'b'
+sed -i rootdir/var/log/apt/history.log -e '/^Commandline: / d' -e '/^Start-Date: / d' -e '/^End-Date: / d'
+testfileequal 'rootdir/var/log/apt/history.log' '
+Reinstall: b:i386 (1.0)'
+
testequal 'Reading package lists...
Building dependency tree...
Reading state information...