summaryrefslogtreecommitdiff
path: root/test/libapt/hashsums_test.cc
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2014-06-12 08:36:58 +0200
committerMichael Vogt <mvo@debian.org>2014-06-12 08:36:58 +0200
commitcfc7f735774ba30dbee1897248f8dfedf0229a4c (patch)
treeb4e0ac29a6b398045a803e890f5cdabcca189d6a /test/libapt/hashsums_test.cc
parenta0187f0f82a184b850b05b62e5a59b6a2055a506 (diff)
parent7701680af12a2c1a65121533c6ebcd635c013c25 (diff)
Merge tag '1.0.1ubuntu2' into ubuntu/trusty
Conflicts: configure.ac debian/changelog debian/control test/integration/framework
Diffstat (limited to 'test/libapt/hashsums_test.cc')
-rw-r--r--test/libapt/hashsums_test.cc20
1 files changed, 14 insertions, 6 deletions
diff --git a/test/libapt/hashsums_test.cc b/test/libapt/hashsums_test.cc
index 3da89052b..d743faec6 100644
--- a/test/libapt/hashsums_test.cc
+++ b/test/libapt/hashsums_test.cc
@@ -1,12 +1,15 @@
+#include <config.h>
+
#include <apt-pkg/md5.h>
#include <apt-pkg/sha1.h>
#include <apt-pkg/sha2.h>
#include <apt-pkg/strutl.h>
#include <apt-pkg/hashes.h>
#include <apt-pkg/fileutl.h>
-#include <iostream>
-#include <stdio.h>
+#include <iostream>
+#include <stdlib.h>
+#include <string>
#include "assert.h"
@@ -43,24 +46,29 @@ template <class T> void TestMill(const char *Out)
int main(int argc, char** argv)
{
+ if (argc != 6) {
+ std::cout << "Five parameter expected - given " << argc << std::endl;
+ return 100;
+ }
+
// test HashSumValue which doesn't calculate but just stores sums
{
- string md5sum = argv[2];
+ std::string md5sum = argv[2];
MD5SumValue md5(md5sum);
equals(md5.Value(), md5sum);
}
{
- string sha1sum = argv[3];
+ std::string sha1sum = argv[3];
SHA1SumValue sha1(sha1sum);
equals(sha1.Value(), sha1sum);
}
{
- string sha2sum = argv[4];
+ std::string sha2sum = argv[4];
SHA256SumValue sha2(sha2sum);
equals(sha2.Value(), sha2sum);
}
{
- string sha2sum = argv[5];
+ std::string sha2sum = argv[5];
SHA512SumValue sha2(sha2sum);
equals(sha2.Value(), sha2sum);
}