diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2018-08-15 05:11:19 +0200 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2018-08-15 05:11:19 +0200 |
commit | bc563e6b2b41ede7efb89e5b566f3a83d50e71fd (patch) | |
tree | de86583ed092366d56b5f4f7ba4a6db5b03bb28d /tests | |
parent | Snap for 4951335 from 17f5b296d1c0d4bdd6a67fbe7dfd088187c8686e to qt-release (diff) | |
parent | Merge "Add fastboot mode to recovery" am: 19a5316412 am: b0851cf8c4 (diff) | |
download | android_bootable_recovery-bc563e6b2b41ede7efb89e5b566f3a83d50e71fd.tar android_bootable_recovery-bc563e6b2b41ede7efb89e5b566f3a83d50e71fd.tar.gz android_bootable_recovery-bc563e6b2b41ede7efb89e5b566f3a83d50e71fd.tar.bz2 android_bootable_recovery-bc563e6b2b41ede7efb89e5b566f3a83d50e71fd.tar.lz android_bootable_recovery-bc563e6b2b41ede7efb89e5b566f3a83d50e71fd.tar.xz android_bootable_recovery-bc563e6b2b41ede7efb89e5b566f3a83d50e71fd.tar.zst android_bootable_recovery-bc563e6b2b41ede7efb89e5b566f3a83d50e71fd.zip |
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Android.mk | 23 | ||||
-rw-r--r-- | tests/unit/commands_test.cpp | 20 |
2 files changed, 25 insertions, 18 deletions
diff --git a/tests/Android.mk b/tests/Android.mk index b6f5b451f..b59da8045 100644 --- a/tests/Android.mk +++ b/tests/Android.mk @@ -127,13 +127,11 @@ tune2fs_static_libraries := \ libupdater_static_libraries := \ libupdater \ libapplypatch \ + libbootloader_message \ libbspatch \ libedify \ - libziparchive \ - libotautil \ - libbootloader_message \ - libutils \ libotafault \ + libotautil \ libext4_utils \ libfec \ libfec_rs \ @@ -144,28 +142,18 @@ libupdater_static_libraries := \ libselinux \ libsparse \ libsquashfs_utils \ + libbrotli \ libbz \ + libziparchive \ libz \ libbase \ libcrypto \ libcrypto_utils \ libcutils \ + libutils \ libtune2fs \ - libbrotli \ $(tune2fs_static_libraries) -health_hal_static_libraries := \ - android.hardware.health@2.0-impl \ - android.hardware.health@2.0 \ - android.hardware.health@1.0 \ - android.hardware.health@1.0-convert \ - libhealthstoragedefault \ - libhidltransport \ - libhidlbase \ - libhwbinder_noltopgo \ - libvndksupport \ - libbatterymonitor - librecovery_static_libraries := \ librecovery \ libbootloader_message \ @@ -175,7 +163,6 @@ librecovery_static_libraries := \ libminui \ libverifier \ libotautil \ - $(health_hal_static_libraries) \ libcrypto_utils \ libcrypto \ libext4_utils \ diff --git a/tests/unit/commands_test.cpp b/tests/unit/commands_test.cpp index 9679a9e73..19841d676 100644 --- a/tests/unit/commands_test.cpp +++ b/tests/unit/commands_test.cpp @@ -333,6 +333,25 @@ TEST(CommandsTest, Parse_ZERO) { ASSERT_EQ(PatchInfo(), command.patch()); } +TEST(CommandsTest, Parse_COMPUTE_HASH_TREE) { + const std::string input{ "compute_hash_tree 2,0,1 2,3,4 sha1 unknown-salt unknown-root-hash" }; + std::string err; + Command command = Command::Parse(input, 9, &err); + ASSERT_TRUE(command); + + ASSERT_EQ(Command::Type::COMPUTE_HASH_TREE, command.type()); + ASSERT_EQ(9, command.index()); + ASSERT_EQ(input, command.cmdline()); + + HashTreeInfo expected_info(RangeSet({ { 0, 1 } }), RangeSet({ { 3, 4 } }), "sha1", "unknown-salt", + "unknown-root-hash"); + ASSERT_EQ(expected_info, command.hash_tree_info()); + ASSERT_EQ(TargetInfo(), command.target()); + ASSERT_EQ(SourceInfo(), command.source()); + ASSERT_EQ(StashInfo(), command.stash()); + ASSERT_EQ(PatchInfo(), command.patch()); +} + TEST(CommandsTest, Parse_InvalidNumberOfArgs) { Command::abort_allowed_ = true; @@ -341,6 +360,7 @@ TEST(CommandsTest, Parse_InvalidNumberOfArgs) { std::vector<std::string> inputs{ "abort foo", "bsdiff", + "compute_hash_tree, 2,0,1 2,0,1 unknown-algorithm unknown-salt", "erase", "erase 4,3,5,10,12 hash1", "free", |