summaryrefslogtreecommitdiffstats
path: root/tests/unit
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2018-08-31 20:25:05 +0200
committerTao Bao <tbao@google.com>2018-08-31 23:31:19 +0200
commit09e84938615cacb14f39882d3c4b717b54749ed7 (patch)
treef859a69c790588fc50252c7776d2a9cea046ac4f /tests/unit
parentMerge "applypatch: Refactor applypatch()." (diff)
downloadandroid_bootable_recovery-09e84938615cacb14f39882d3c4b717b54749ed7.tar
android_bootable_recovery-09e84938615cacb14f39882d3c4b717b54749ed7.tar.gz
android_bootable_recovery-09e84938615cacb14f39882d3c4b717b54749ed7.tar.bz2
android_bootable_recovery-09e84938615cacb14f39882d3c4b717b54749ed7.tar.lz
android_bootable_recovery-09e84938615cacb14f39882d3c4b717b54749ed7.tar.xz
android_bootable_recovery-09e84938615cacb14f39882d3c4b717b54749ed7.tar.zst
android_bootable_recovery-09e84938615cacb14f39882d3c4b717b54749ed7.zip
Diffstat (limited to 'tests/unit')
-rw-r--r--tests/unit/applypatch_test.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/unit/applypatch_test.cpp b/tests/unit/applypatch_test.cpp
index 4204074e7..066f981b4 100644
--- a/tests/unit/applypatch_test.cpp
+++ b/tests/unit/applypatch_test.cpp
@@ -49,13 +49,13 @@ class ApplyPatchTest : public ::testing::Test {
void SetUp() override {
source_file = from_testdata_base("boot.img");
FileContents boot_fc;
- ASSERT_EQ(0, LoadFileContents(source_file, &boot_fc));
+ ASSERT_TRUE(LoadFileContents(source_file, &boot_fc));
source_size = boot_fc.data.size();
source_sha1 = print_sha1(boot_fc.sha1);
target_file = from_testdata_base("recovery.img");
FileContents recovery_fc;
- ASSERT_EQ(0, LoadFileContents(target_file, &recovery_fc));
+ ASSERT_TRUE(LoadFileContents(target_file, &recovery_fc));
target_size = recovery_fc.data.size();
target_sha1 = print_sha1(recovery_fc.sha1);
@@ -135,11 +135,11 @@ TEST_F(ApplyPatchTest, PatchPartitionCheck_UseBackup_BothCorrupted) {
TEST_F(ApplyPatchTest, PatchPartition) {
FileContents patch_fc;
- ASSERT_EQ(0, LoadFileContents(from_testdata_base("recovery-from-boot.p"), &patch_fc));
+ ASSERT_TRUE(LoadFileContents(from_testdata_base("recovery-from-boot.p"), &patch_fc));
Value patch(Value::Type::BLOB, std::string(patch_fc.data.cbegin(), patch_fc.data.cend()));
FileContents bonus_fc;
- ASSERT_EQ(0, LoadFileContents(from_testdata_base("bonus.file"), &bonus_fc));
+ ASSERT_TRUE(LoadFileContents(from_testdata_base("bonus.file"), &bonus_fc));
Value bonus(Value::Type::BLOB, std::string(bonus_fc.data.cbegin(), bonus_fc.data.cend()));
ASSERT_TRUE(PatchPartition(target_partition, source_partition, patch, &bonus));
@@ -149,7 +149,7 @@ TEST_F(ApplyPatchTest, PatchPartition) {
// everything).
TEST_F(ApplyPatchTest, PatchPartitionWithoutBonusFile) {
FileContents patch_fc;
- ASSERT_EQ(0, LoadFileContents(from_testdata_base("recovery-from-boot-with-bonus.p"), &patch_fc));
+ ASSERT_TRUE(LoadFileContents(from_testdata_base("recovery-from-boot-with-bonus.p"), &patch_fc));
Value patch(Value::Type::BLOB, std::string(patch_fc.data.cbegin(), patch_fc.data.cend()));
ASSERT_TRUE(PatchPartition(target_partition, source_partition, patch, nullptr));