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

Unified Diff: delta_performer_unittest.cc

Issue 5121008: AU: Check the delta magic and fail on mismatch. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/update_engine.git@master
Patch Set: fix comment Created 10 years, 1 month 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 | « delta_performer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: delta_performer_unittest.cc
diff --git a/delta_performer_unittest.cc b/delta_performer_unittest.cc
index 37a0c683da72dc9439cae17437f40393a772e74f..42f237b153a487459f2517190dc6f5095a6123b1 100755
--- a/delta_performer_unittest.cc
+++ b/delta_performer_unittest.cc
@@ -367,6 +367,17 @@ TEST(DeltaPerformerTest, RunAsRootNoopSmallImageTest) {
DoSmallImageTest(false, false, true);
}
+TEST(DeltaPerformerTest, BadDeltaMagicTest) {
+ PrefsMock prefs;
+ DeltaPerformer performer(&prefs);
+ EXPECT_EQ(0, performer.Open("/dev/null", 0, 0));
+ EXPECT_TRUE(performer.OpenKernel("/dev/null"));
+ EXPECT_EQ(4, performer.Write("junk", 4));
+ EXPECT_EQ(8, performer.Write("morejunk", 8));
+ EXPECT_LT(performer.Write("morejunk", 8), 0);
+ EXPECT_LT(performer.Close(), 0);
+}
+
TEST(DeltaPerformerTest, IsIdempotentOperationTest) {
DeltaArchiveManifest_InstallOperation op;
EXPECT_TRUE(DeltaPerformer::IsIdempotentOperation(op));
« no previous file with comments | « delta_performer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698