summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2019-05-04 07:52:37 +0200
committerElliott Hughes <enh@google.com>2019-05-06 19:28:14 +0200
commita86dddbfa593ae1227806af9692fbb6223d4e435 (patch)
tree4d64abfed9a6c77050f8dc50dee534dc9ccfc262 /tests
parentMerge "ConsumePrefix is now in libbase." (diff)
downloadandroid_bootable_recovery-a86dddbfa593ae1227806af9692fbb6223d4e435.tar
android_bootable_recovery-a86dddbfa593ae1227806af9692fbb6223d4e435.tar.gz
android_bootable_recovery-a86dddbfa593ae1227806af9692fbb6223d4e435.tar.bz2
android_bootable_recovery-a86dddbfa593ae1227806af9692fbb6223d4e435.tar.lz
android_bootable_recovery-a86dddbfa593ae1227806af9692fbb6223d4e435.tar.xz
android_bootable_recovery-a86dddbfa593ae1227806af9692fbb6223d4e435.tar.zst
android_bootable_recovery-a86dddbfa593ae1227806af9692fbb6223d4e435.zip
Diffstat (limited to '')
-rw-r--r--tests/unit/install_test.cpp3
-rw-r--r--tests/unit/package_test.cpp5
-rw-r--r--tests/unit/zip_test.cpp3
3 files changed, 4 insertions, 7 deletions
diff --git a/tests/unit/install_test.cpp b/tests/unit/install_test.cpp
index c1d77fb7b..4ec409908 100644
--- a/tests/unit/install_test.cpp
+++ b/tests/unit/install_test.cpp
@@ -271,9 +271,8 @@ static void VerifyAbUpdateCommands(const std::string& serialno, bool success = t
ZipArchiveHandle zip;
ASSERT_EQ(0, OpenArchive(temp_file.path, &zip));
- ZipString payload_name("payload.bin");
ZipEntry payload_entry;
- ASSERT_EQ(0, FindEntry(zip, payload_name, &payload_entry));
+ ASSERT_EQ(0, FindEntry(zip, "payload.bin", &payload_entry));
std::map<std::string, std::string> metadata;
ASSERT_TRUE(ReadMetadataFromPackage(zip, &metadata));
diff --git a/tests/unit/package_test.cpp b/tests/unit/package_test.cpp
index a735a699e..5e31f7fa5 100644
--- a/tests/unit/package_test.cpp
+++ b/tests/unit/package_test.cpp
@@ -105,10 +105,9 @@ TEST_F(PackageTest, GetZipArchiveHandle_extract_entry) {
ASSERT_TRUE(zip);
// Check that we can extract one zip entry.
- std::string entry_name = "dir1/file3.txt";
- ZipString path(entry_name.c_str());
+ std::string_view entry_name = "dir1/file3.txt";
ZipEntry entry;
- ASSERT_EQ(0, FindEntry(zip, path, &entry));
+ ASSERT_EQ(0, FindEntry(zip, entry_name, &entry));
std::vector<uint8_t> extracted(entry_name.size());
ASSERT_EQ(0, ExtractToMemory(zip, &entry, extracted.data(), extracted.size()));
diff --git a/tests/unit/zip_test.cpp b/tests/unit/zip_test.cpp
index dfe617ebe..0753d64e1 100644
--- a/tests/unit/zip_test.cpp
+++ b/tests/unit/zip_test.cpp
@@ -37,10 +37,9 @@ TEST(ZipTest, OpenFromMemory) {
ASSERT_EQ(0, OpenArchiveFromMemory(map.addr, map.length, zip_path.c_str(), &handle));
static constexpr const char* BINARY_PATH = "META-INF/com/google/android/update-binary";
- ZipString binary_path(BINARY_PATH);
ZipEntry binary_entry;
// Make sure the package opens correctly and its entry can be read.
- ASSERT_EQ(0, FindEntry(handle, binary_path, &binary_entry));
+ ASSERT_EQ(0, FindEntry(handle, BINARY_PATH, &binary_entry));
TemporaryFile tmp_binary;
ASSERT_NE(-1, tmp_binary.fd);