diff --git a/fastboot/fastboot_driver.cpp b/fastboot/fastboot_driver.cpp index 6bd61282b7b8f5935eaf07e5921f6e1f6f104953..f9e640ab33a1f184955d7a9f2176f72bae4de9d4 100644 --- a/fastboot/fastboot_driver.cpp +++ b/fastboot/fastboot_driver.cpp @@ -126,7 +126,7 @@ RetCode FastBootDriver::FlashPartition(const std::string& part, sparse_file* s) return RawCommand(Commands::FLASH + part); } -RetCode FastBootDriver::Partitions(std::vector<std::tuple<std::string, uint32_t>>* parts) { +RetCode FastBootDriver::Partitions(std::vector<std::tuple<std::string, uint64_t>>* parts) { std::vector<std::string> all; RetCode ret; if ((ret = GetVarAll(&all))) { @@ -140,7 +140,7 @@ RetCode FastBootDriver::Partitions(std::vector<std::tuple<std::string, uint32_t> if (std::regex_match(s, sm, reg)) { std::string m1(sm[1]); std::string m2(sm[2]); - uint32_t tmp = strtol(m2.c_str(), 0, 16); + uint64_t tmp = strtoll(m2.c_str(), 0, 16); parts->push_back(std::make_tuple(m1, tmp)); } } diff --git a/fastboot/fastboot_driver.h b/fastboot/fastboot_driver.h index 2651690cb982263b9c2d8f001435d4b3bc650ff8..ca9003a0bd02a55c80dca14878120689bcb04af0 100644 --- a/fastboot/fastboot_driver.h +++ b/fastboot/fastboot_driver.h @@ -99,7 +99,7 @@ class FastBootDriver { RetCode FlashPartition(const std::string& part, int fd, uint32_t sz); RetCode FlashPartition(const std::string& part, sparse_file* s); - RetCode Partitions(std::vector<std::tuple<std::string, uint32_t>>* parts); + RetCode Partitions(std::vector<std::tuple<std::string, uint64_t>>* parts); RetCode Require(const std::string& var, const std::vector<std::string>& allowed, bool* reqmet, bool invert = false); diff --git a/fastboot/fuzzy_fastboot/main.cpp b/fastboot/fuzzy_fastboot/main.cpp index 1d30f8bd85b1f567a7cb93adb47a65f4f3a173bd..a7b22c6cf4a44278e36d9c703b197caec192c185 100644 --- a/fastboot/fuzzy_fastboot/main.cpp +++ b/fastboot/fuzzy_fastboot/main.cpp @@ -304,7 +304,7 @@ TEST_F(Conformance, UnlockAbility) { } TEST_F(Conformance, PartitionInfo) { - std::vector<std::tuple<std::string, uint32_t>> parts; + std::vector<std::tuple<std::string, uint64_t>> parts; EXPECT_EQ(fb->Partitions(&parts), SUCCESS) << "getvar:all failed"; EXPECT_GT(parts.size(), 0) << "getvar:all did not report any partition-size: through INFO responses"; @@ -340,7 +340,7 @@ TEST_F(Conformance, Slots) { // Can't run out of alphabet letters... ASSERT_LE(num_slots, 26) << "What?! You can't have more than 26 slots"; - std::vector<std::tuple<std::string, uint32_t>> parts; + std::vector<std::tuple<std::string, uint64_t>> parts; EXPECT_EQ(fb->Partitions(&parts), SUCCESS) << "getvar:all failed"; std::map<std::string, std::set<char>> part_slots; @@ -587,14 +587,14 @@ TEST_F(UnlockPermissions, DownloadFlash) { std::vector<char> buf{'a', 'o', 's', 'p'}; EXPECT_EQ(fb->Download(buf), SUCCESS) << "Download failed in unlocked mode"; ; - std::vector<std::tuple<std::string, uint32_t>> parts; + std::vector<std::tuple<std::string, uint64_t>> parts; EXPECT_EQ(fb->Partitions(&parts), SUCCESS) << "getvar:all failed in unlocked mode"; } TEST_F(LockPermissions, DownloadFlash) { std::vector<char> buf{'a', 'o', 's', 'p'}; EXPECT_EQ(fb->Download(buf), SUCCESS) << "Download failed in locked mode"; - std::vector<std::tuple<std::string, uint32_t>> parts; + std::vector<std::tuple<std::string, uint64_t>> parts; EXPECT_EQ(fb->Partitions(&parts), SUCCESS) << "getvar:all failed in locked mode"; std::string resp; for (const auto tup : parts) { @@ -607,7 +607,7 @@ TEST_F(LockPermissions, DownloadFlash) { } TEST_F(LockPermissions, Erase) { - std::vector<std::tuple<std::string, uint32_t>> parts; + std::vector<std::tuple<std::string, uint64_t>> parts; EXPECT_EQ(fb->Partitions(&parts), SUCCESS) << "getvar:all failed"; std::string resp; for (const auto tup : parts) { @@ -619,7 +619,7 @@ TEST_F(LockPermissions, Erase) { } TEST_F(LockPermissions, SetActive) { - std::vector<std::tuple<std::string, uint32_t>> parts; + std::vector<std::tuple<std::string, uint64_t>> parts; EXPECT_EQ(fb->Partitions(&parts), SUCCESS) << "getvar:all failed"; std::string resp; @@ -916,7 +916,7 @@ INSTANTIATE_TEST_CASE_P(XMLGetVar, ExtensionsGetVarConformance, TEST_P(AnyPartition, ReportedGetVarAll) { // As long as the partition is reported in INFO, it would be tested by generic Conformance - std::vector<std::tuple<std::string, uint32_t>> parts; + std::vector<std::tuple<std::string, uint64_t>> parts; ASSERT_EQ(fb->Partitions(&parts), SUCCESS) << "getvar:all failed"; const std::string name = GetParam().first; if (GetParam().second.slots) {