]> git.saurik.com Git - apt.git/blobdiff - test/libapt/hashsums_test.cc
merged from the debian-experimental2 branch
[apt.git] / test / libapt / hashsums_test.cc
index ff153671860e9bc70e8f4fb17cfbb08a5b75972c..2cb71cc38fb0a839780b0d2a76c5405d0d9cf21c 100644 (file)
@@ -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;
 }