diff options
| author | 2022-08-24 01:23:29 +0000 | |
|---|---|---|
| committer | 2022-08-24 01:23:29 +0000 | |
| commit | b5a537a739837eb1551874258c373ede1d0f852c (patch) | |
| tree | 5d546af47fd94e8d58df2a9a83014318b862816d | |
| parent | 5e9adf8ce2c0796d8acf81b4f35b09043d3b0c29 (diff) | |
| parent | 5737e1d532f4b4737f749c61a6344c4fcc1384c7 (diff) | |
Merge "libbinder_random_parcel: more failures logs" am: 5737e1d532
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2188382
Change-Id: Ie2830306694a78af207e26fdd40160135de34293
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| -rw-r--r-- | libs/binder/tests/parcel_fuzzer/random_fd.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libs/binder/tests/parcel_fuzzer/random_fd.cpp b/libs/binder/tests/parcel_fuzzer/random_fd.cpp index 3fcf104e81..e4dbb2d955 100644 --- a/libs/binder/tests/parcel_fuzzer/random_fd.cpp +++ b/libs/binder/tests/parcel_fuzzer/random_fd.cpp @@ -26,9 +26,12 @@ namespace android { using base::unique_fd; std::vector<unique_fd> getRandomFds(FuzzedDataProvider* provider) { + const char* fdType; + std::vector<unique_fd> fds = provider->PickValueInArray< std::function<std::vector<unique_fd>()>>({ [&]() { + fdType = "ashmem"; std::vector<unique_fd> ret; ret.push_back(unique_fd( ashmem_create_region("binder test region", @@ -36,18 +39,21 @@ std::vector<unique_fd> getRandomFds(FuzzedDataProvider* provider) { return ret; }, [&]() { + fdType = "/dev/null"; std::vector<unique_fd> ret; ret.push_back(unique_fd(open("/dev/null", O_RDWR))); return ret; }, [&]() { + fdType = "pipefd"; + int pipefds[2]; int flags = O_CLOEXEC; if (provider->ConsumeBool()) flags |= O_DIRECT; if (provider->ConsumeBool()) flags |= O_NONBLOCK; - CHECK_EQ(0, pipe2(pipefds, flags)); + CHECK_EQ(0, pipe2(pipefds, flags)) << flags; if (provider->ConsumeBool()) std::swap(pipefds[0], pipefds[1]); @@ -58,7 +64,7 @@ std::vector<unique_fd> getRandomFds(FuzzedDataProvider* provider) { }, })(); - for (const auto& fd : fds) CHECK(fd.ok()) << fd.get(); + for (const auto& fd : fds) CHECK(fd.ok()) << fd.get() << " " << fdType; return fds; } |