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

Commit e37e6e21 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "libbinder_ndk: ScopedAStatus ostream<<" am: 7e95846b

parents 7001d777 7e95846b
Loading
Loading
Loading
Loading
+7 −2
Original line number Original line Diff line number Diff line
@@ -30,11 +30,11 @@
#include <android/binder_internal_logging.h>
#include <android/binder_internal_logging.h>
#include <android/binder_parcel.h>
#include <android/binder_parcel.h>
#include <android/binder_status.h>
#include <android/binder_status.h>

#include <assert.h>
#include <assert.h>

#include <unistd.h>
#include <unistd.h>

#include <cstddef>
#include <cstddef>
#include <iostream>
#include <string>
#include <string>


namespace ndk {
namespace ndk {
@@ -315,6 +315,11 @@ class ScopedAStatus : public impl::ScopedAResource<AStatus*, AStatus_delete, nul
    }
    }
};
};


static inline std::ostream& operator<<(std::ostream& os, const ScopedAStatus& status) {
    return os << status.getDescription();
    return os;
}

/**
/**
 * Convenience wrapper. See AIBinder_DeathRecipient.
 * Convenience wrapper. See AIBinder_DeathRecipient.
 */
 */
+1 −1
Original line number Original line Diff line number Diff line
@@ -106,7 +106,7 @@ TEST(DoubleBinder, CallIntoNdk) {
        std::string outString;
        std::string outString;
        ScopedAStatus status = server->RepeatString("foo", &outString);
        ScopedAStatus status = server->RepeatString("foo", &outString);
        EXPECT_EQ(STATUS_OK, AStatus_getExceptionCode(status.get()))
        EXPECT_EQ(STATUS_OK, AStatus_getExceptionCode(status.get()))
                << serviceName << " " << status.getDescription();
                << serviceName << " " << status;
        EXPECT_EQ("foo", outString) << serviceName;
        EXPECT_EQ("foo", outString) << serviceName;
    }
    }
}
}