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)); |