HCoop
/
ntk
/
apt.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6f33ec4
)
test/libapt/hashsums_test.cc: add a test for HashString and VerifyFile
author
Michael Vogt
<michael.vogt@ubuntu.com>
Fri, 29 Jul 2011 14:33:20 +0000
(16:33 +0200)
committer
Michael Vogt
<michael.vogt@ubuntu.com>
Fri, 29 Jul 2011 14:33:20 +0000
(16:33 +0200)
test/libapt/hashsums_test.cc
patch
|
blob
|
blame
|
history
diff --git
a/test/libapt/hashsums_test.cc
b/test/libapt/hashsums_test.cc
index
ff15367
..
2cb71cc
100644
(file)
--- a/
test/libapt/hashsums_test.cc
+++ b/
test/libapt/hashsums_test.cc
@@
-135,6
+135,21
@@
int main(int argc, char** argv)
equals(argv[5], sha2.Result().Value());
}
fclose(fd);
+
+ // test HashString code
+ {
+ HashString sha2("SHA256", argv[4]);
+ equals(sha2.VerifyFile(argv[1]), true);
+ }
+ {
+ HashString sha2("SHA512", argv[5]);
+ equals(sha2.VerifyFile(argv[1]), true);
+ }
+ {
+ HashString sha2("SHA256:"+string(argv[4]));
+ equals(sha2.VerifyFile(argv[1]), true);
+ }
+
return 0;
}