From a5fd5abe80ea5650bc0b638fc693884df5eaaa89 Mon Sep 17 00:00:00 2001 From: Tianjie Xu Date: Tue, 18 Oct 2016 15:18:22 -0700 Subject: Add a unit test for applypatch_check If no sha1 is specified, applypatch_check should pass as long as the file content loads successfully. Add a unit case acccordingly. Test: Unit tests passed Bug: 32243751 Change-Id: I8c013be67c197d2935e11cf6acc59fb9b943cfd9 --- tests/component/applypatch_test.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/component/applypatch_test.cpp b/tests/component/applypatch_test.cpp index 75f2e1014..908a9f5f5 100644 --- a/tests/component/applypatch_test.cpp +++ b/tests/component/applypatch_test.cpp @@ -200,6 +200,11 @@ std::vector ApplyPatchFullTest::patches; TemporaryFile* ApplyPatchFullTest::output_f; std::string ApplyPatchFullTest::output_loc; +TEST_F(ApplyPatchTest, CheckModeSkip) { + std::vector sha1s; + ASSERT_EQ(0, applypatch_check(&old_file[0], sha1s)); +} + TEST_F(ApplyPatchTest, CheckModeSingle) { std::vector sha1s = { old_sha1 }; ASSERT_EQ(0, applypatch_check(&old_file[0], sha1s)); -- cgit v1.2.3