diff options
| author | 2018-07-10 19:48:18 -0700 | |
|---|---|---|
| committer | 2018-07-11 04:59:29 +0000 | |
| commit | 21f3655ee03d376b4acb68d80568a94dce4829b4 (patch) | |
| tree | 673470c2380b6d218a34bc5ed0b6de3b5bfe2f91 | |
| parent | d760eb86623e011ea2fec592f164c07170de6d70 (diff) | |
Be compatible with new google test
1. Remove the use of ::std::tr1
2. arg in matcher become const.
Test: compile
Change-Id: Iba7cdc568b55f436b695e3fb39c1b0975d983ae8
| -rw-r--r-- | cmds/dumpsys/tests/dumpsys_test.cpp | 2 | ||||
| -rw-r--r-- | libs/vr/libpdx/service_tests.cpp | 12 |
2 files changed, 8 insertions, 6 deletions
diff --git a/cmds/dumpsys/tests/dumpsys_test.cpp b/cmds/dumpsys/tests/dumpsys_test.cpp index 16fefe64ba..221572d095 100644 --- a/cmds/dumpsys/tests/dumpsys_test.cpp +++ b/cmds/dumpsys/tests/dumpsys_test.cpp @@ -73,7 +73,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); } diff --git a/libs/vr/libpdx/service_tests.cpp b/libs/vr/libpdx/service_tests.cpp index e623abf6eb..938d73774e 100644 --- a/libs/vr/libpdx/service_tests.cpp +++ b/libs/vr/libpdx/service_tests.cpp @@ -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; } |