Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 74479e7a authored by Haibo Huang's avatar Haibo Huang Committed by android-build-merger
Browse files

Merge "Be compatible with new google test" am: f4d63fe4

am: 6cf44788

Change-Id: I1d3f9c74e61d6199b28f58ce1898cf390b87b9a3
parents a9631050 6cf44788
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -74,7 +74,7 @@ class WriteOnFdAction : public ActionInterface<WriteOnFdFunction> {
    explicit WriteOnFdAction(const std::string& output) : output_(output) {
    }
    virtual Result Perform(const ArgumentTuple& args) {
        int fd = ::std::tr1::get<0>(args);
        int fd = ::testing::get<0>(args);
        android::base::WriteStringToFd(output_, fd);
    }

+7 −5
Original line number Diff line number Diff line
@@ -51,22 +51,24 @@ MATCHER_P2(IoVecMatcher, ptr, size, "") {
//             method(IoVecMatcher(IoVecArray{{ptr1, size1}, {ptr2, size2}})));
using IoVecArray = std::vector<iovec>;
MATCHER_P(IoVecMatcher, iovec_array, "") {
  auto local_arg = arg;
  for (const iovec& item : iovec_array) {
    if (arg->iov_base != item.iov_base || arg->iov_len != item.iov_len)
    if (local_arg->iov_base != item.iov_base || local_arg->iov_len != item.iov_len)
      return false;
    arg++;
    local_arg++;
  }
  return true;
}

using IoVecData = std::vector<std::string>;
MATCHER_P(IoVecDataMatcher, iovec_data, "") {
  auto local_arg = arg;
  for (const std::string& item : iovec_data) {
    std::string data{reinterpret_cast<const char*>(arg->iov_base),
                     arg->iov_len};
    std::string data{reinterpret_cast<const char*>(local_arg->iov_base),
                     local_arg->iov_len};
    if (data != item)
      return false;
    arg++;
    local_arg++;
  }
  return true;
}