Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Unified Diff: omaha_hash_calculator_unittest.cc

Issue 3521016: AU: Start checkpointing update progress. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/update_engine.git
Patch Set: address review comments Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « omaha_hash_calculator.cc ('k') | omaha_response_handler_action.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: omaha_hash_calculator_unittest.cc
diff --git a/omaha_hash_calculator_unittest.cc b/omaha_hash_calculator_unittest.cc
index 449cb9021e487a728c1a07a5b7e5f72992cb6743..597b21f4d74638b2992d3f21e94a824ad7602250 100644
--- a/omaha_hash_calculator_unittest.cc
+++ b/omaha_hash_calculator_unittest.cc
@@ -51,6 +51,18 @@ TEST(OmahaHashCalculatorTest, MultiUpdateTest) {
EXPECT_TRUE(raw_hash == calc.raw_hash());
}
+TEST(OmahaHashCalculatorTest, ContextTest) {
+ OmahaHashCalculator calc;
+ calc.Update("h", 1);
+ OmahaHashCalculator calc_next;
+ calc_next.SetContext(calc.GetContext());
+ calc_next.Update("i", 1);
+ calc_next.Finalize();
+ // Generated by running this on a linux shell:
+ // $ echo -n hi | openssl dgst -sha256 -binary | openssl base64
+ EXPECT_EQ("j0NDRmSPa5bfid2pAcUXaxCm2Dlh3TwayItZstwyeqQ=", calc_next.hash());
+}
+
TEST(OmahaHashCalculatorTest, BigTest) {
OmahaHashCalculator calc;
« no previous file with comments | « omaha_hash_calculator.cc ('k') | omaha_response_handler_action.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698