summaryrefslogtreecommitdiff
path: root/test/libapt/hashsums_test.cc
diff options
context:
space:
mode:
authorMichael Vogt <egon@debian-devbox>2012-05-11 16:21:05 +0200
committerMichael Vogt <egon@debian-devbox>2012-05-11 16:21:05 +0200
commit3f81d67e1b732c1fdc8c17990249eda0fc2e09d6 (patch)
tree038dbe61e80ac809de33bb8fc3c74e24f7fb8be6 /test/libapt/hashsums_test.cc
parent99b4fefe0f303cf5ae5e8b9116404fc0fcc96e47 (diff)
parenta00a9b44a1e0abf944d88c36ceaac8afdd207dcb (diff)
merged from david
Diffstat (limited to 'test/libapt/hashsums_test.cc')
-rw-r--r--test/libapt/hashsums_test.cc22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/libapt/hashsums_test.cc b/test/libapt/hashsums_test.cc
index 396e4cf6b..e2d0aec5b 100644
--- a/test/libapt/hashsums_test.cc
+++ b/test/libapt/hashsums_test.cc
@@ -42,6 +42,28 @@ template <class T> void TestMill(const char *Out)
int main(int argc, char** argv)
{
+ // test HashSumValue which doesn't calculate but just stores sums
+ {
+ string md5sum = argv[2];
+ MD5SumValue md5(md5sum);
+ equals(md5.Value(), md5sum);
+ }
+ {
+ string sha1sum = argv[3];
+ SHA1SumValue sha1(sha1sum);
+ equals(sha1.Value(), sha1sum);
+ }
+ {
+ string sha2sum = argv[4];
+ SHA256SumValue sha2(sha2sum);
+ equals(sha2.Value(), sha2sum);
+ }
+ {
+ string sha2sum = argv[5];
+ SHA512SumValue sha2(sha2sum);
+ equals(sha2.Value(), sha2sum);
+ }
+
// From FIPS PUB 180-1
Test<SHA1Summation>("","da39a3ee5e6b4b0d3255bfef95601890afd80709");
Test<SHA1Summation>("abc","a9993e364706816aba3e25717850c26c9cd0d89d");