/*
 * Copyright (C) 2020 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include <binder/Parcel.h>
#include <binder/Status.h>
#include <gtest/gtest.h>

using android::Parcel;
using android::binder::Status;

TEST(Status, WriteOverParcel) {
    Status status = Status::fromExceptionCode(Status::EX_NULL_POINTER);

    Parcel indirect;
    indirect.writeInt32(64);
    status.writeOverParcel(&indirect);

    Parcel direct;
    status.writeToParcel(&direct);

    EXPECT_EQ(0, indirect.compareData(direct));
}
