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

Commit e8f1eed4 authored by Steven Moreland's avatar Steven Moreland Committed by Automerger Merge Worker
Browse files

Merge "binderRpcWireProtocolTest: include Status" am: 20f5a270

Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1817612

Change-Id: I91bd1d77409f59b7b3bfeba834d8d7998ca7b1d7
parents 0b50accc 20f5a270
Loading
Loading
Loading
Loading
+6 −1
Original line number Original line Diff line number Diff line
@@ -21,6 +21,7 @@
#include <android-base/strings.h>
#include <android-base/strings.h>
#include <binder/Parcel.h>
#include <binder/Parcel.h>
#include <binder/RpcSession.h>
#include <binder/RpcSession.h>
#include <binder/Status.h>
#include <gtest/gtest.h>
#include <gtest/gtest.h>


#include "../Debug.h"
#include "../Debug.h"
@@ -154,6 +155,9 @@ static const std::vector<std::function<void(Parcel* p)>> kFillFuns {
    [](Parcel* p) { ASSERT_EQ(OK, p->writeVectorSize(std::optional<std::vector<int32_t>>(std::nullopt))); },
    [](Parcel* p) { ASSERT_EQ(OK, p->writeVectorSize(std::optional<std::vector<int32_t>>(std::nullopt))); },
    [](Parcel* p) { ASSERT_EQ(OK, p->writeVectorSize(std::optional<std::vector<int32_t>>({0, 1, 17}))); },
    [](Parcel* p) { ASSERT_EQ(OK, p->writeVectorSize(std::optional<std::vector<int32_t>>({0, 1, 17}))); },
    [](Parcel* p) { ASSERT_EQ(OK, p->writeNoException()); },
    [](Parcel* p) { ASSERT_EQ(OK, p->writeNoException()); },
    [](Parcel* p) { ASSERT_EQ(OK, binder::Status::ok().writeToParcel(p)); },
    [](Parcel* p) { ASSERT_EQ(OK, binder::Status::fromExceptionCode(7, ":D").writeToParcel(p)); },
    [](Parcel* p) { ASSERT_EQ(OK, binder::Status::fromServiceSpecificError(8, ":/").writeToParcel(p)); },
};
};
// clang-format on
// clang-format on


@@ -226,7 +230,8 @@ const std::string kCurrentRepr =
        "020000000000000001000000|020000000000000001000000|ffffffff|"
        "020000000000000001000000|020000000000000001000000|ffffffff|"
        "0200000000000000000000000100000000000000|0200000000000000000000000100000000000000|"
        "0200000000000000000000000100000000000000|0200000000000000000000000100000000000000|"
        "ffffffff|010000000100000025000000|010000000100000025000000|00000000|0100000025000000|"
        "ffffffff|010000000100000025000000|010000000100000025000000|00000000|0100000025000000|"
        "0100000025000000|03000000|00000000|ffffffff|03000000|00000000";
        "0100000025000000|03000000|00000000|ffffffff|03000000|00000000|00000000|"
        "07000000020000003a0044000000000000000000|f8ffffff020000003a002f00000000000000000008000000";


TEST(RpcWire, CurrentVersion) {
TEST(RpcWire, CurrentVersion) {
    checkRepr(kCurrentRepr, RPC_WIRE_PROTOCOL_VERSION);
    checkRepr(kCurrentRepr, RPC_WIRE_PROTOCOL_VERSION);