]> git.saurik.com Git - apt.git/blobdiff - test/libapt/hashsums_test.cc
* apt-pkg/aptconfiguration.cc:
[apt.git] / test / libapt / hashsums_test.cc
index ff153671860e9bc70e8f4fb17cfbb08a5b75972c..396e4cf6b36304e114731eb189a050f97df40138 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:" + std::string(argv[4]));
+   equals(sha2.VerifyFile(argv[1]), true);
+   }
+
    return 0;
 }