diff options
author | Hridya Valsaraju <hridya@google.com> | 2018-10-09 10:03:51 -0700 |
---|---|---|
committer | Hridya Valsaraju <hridya@google.com> | 2018-10-09 12:16:50 -0700 |
commit | 2a377da2f6b2577cd15698e39e1a003b3c632709 (patch) | |
tree | 9429060d4629b2e300602a646c3e82c460f434d1 /fastboot/fuzzy_fastboot/main.cpp | |
parent | f3186de123c742166ec5e61b27b61af3ef929dfb (diff) |
Return partition size in hex format.
This is required to pass fuzzy_fastboot conformance tests.
Also, allow for zero sized partitions in fuzzy_fastboot.
Test: ./fuzzy_fastboot --gtest_filter=Conformance.Slots
Bug: 117220134
Change-Id: Ifb12994a7796b081215084cb68b37674210aaa12
Diffstat (limited to 'fastboot/fuzzy_fastboot/main.cpp')
-rw-r--r-- | fastboot/fuzzy_fastboot/main.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fastboot/fuzzy_fastboot/main.cpp b/fastboot/fuzzy_fastboot/main.cpp index e2076f5bb..c02ab1c0a 100644 --- a/fastboot/fuzzy_fastboot/main.cpp +++ b/fastboot/fuzzy_fastboot/main.cpp @@ -43,6 +43,7 @@ #include <thread> #include <vector> +#include <android-base/parseint.h> #include <android-base/stringprintf.h> #include <gtest/gtest.h> #include <sparse/sparse.h> @@ -331,8 +332,9 @@ TEST_F(Conformance, PartitionInfo) { << cmd + " responded with a string with leading whitespace"; EXPECT_FALSE(resp.compare(0, 2, "0x")) << cmd + "responded with a string that does not start with 0x..."; - int64_t size = strtoll(resp.c_str(), nullptr, 16); - EXPECT_GT(size, 0) << "'" + resp + "' is not a valid response from " + cmd; + uint64_t size; + ASSERT_TRUE(android::base::ParseUint(resp, &size)) + << "'" + resp + "' is not a valid response from " + cmd; } } |