summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/ExecutionEngine/Orc/RPCUtilsTest.cpp
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2016-04-25 21:21:20 +0000
committerLang Hames <lhames@gmail.com>2016-04-25 21:21:20 +0000
commit1fa0e0e0068f9ec4b3252a158fb49c07c3438544 (patch)
tree8bff770bcedd94bee0858d66eefb0dede1d19a37 /llvm/unittests/ExecutionEngine/Orc/RPCUtilsTest.cpp
parent47bf50577511f3a5c8a1efb4142cc3a3082b62b3 (diff)
downloadbcm5719-llvm-1fa0e0e0068f9ec4b3252a158fb49c07c3438544.tar.gz
bcm5719-llvm-1fa0e0e0068f9ec4b3252a158fb49c07c3438544.zip
[ORC] clang-format code that was touched in r267457. NFC.
Commit r267457 made a lot of type-substitutions threw off code formatting and alignment. This patch should tidy those changes up. llvm-svn: 267475
Diffstat (limited to 'llvm/unittests/ExecutionEngine/Orc/RPCUtilsTest.cpp')
-rw-r--r--llvm/unittests/ExecutionEngine/Orc/RPCUtilsTest.cpp113
1 files changed, 39 insertions, 74 deletions
diff --git a/llvm/unittests/ExecutionEngine/Orc/RPCUtilsTest.cpp b/llvm/unittests/ExecutionEngine/Orc/RPCUtilsTest.cpp
index b2680aa7d8a..7d55641e4ce 100644
--- a/llvm/unittests/ExecutionEngine/Orc/RPCUtilsTest.cpp
+++ b/llvm/unittests/ExecutionEngine/Orc/RPCUtilsTest.cpp
@@ -19,7 +19,8 @@ using namespace llvm::orc::remote;
class Queue : public std::queue<char> {
public:
- std::mutex& getLock() { return Lock; }
+ std::mutex &getLock() { return Lock; }
+
private:
std::mutex Lock;
};
@@ -27,7 +28,7 @@ private:
class QueueChannel : public RPCChannel {
public:
QueueChannel(Queue &InQueue, Queue &OutQueue)
- : InQueue(InQueue), OutQueue(OutQueue) {}
+ : InQueue(InQueue), OutQueue(OutQueue) {}
Error readBytes(char *Dst, unsigned Size) override {
while (Size != 0) {
@@ -60,10 +61,8 @@ private:
Queue &OutQueue;
};
-class DummyRPC : public testing::Test,
- public RPC<QueueChannel> {
+class DummyRPC : public testing::Test, public RPC<QueueChannel> {
public:
-
enum FuncId : uint32_t {
VoidBoolId = RPCFunctionIdTraits<FuncId>::FirstValidId,
IntIntId,
@@ -72,14 +71,12 @@ public:
typedef Function<VoidBoolId, void(bool)> VoidBool;
typedef Function<IntIntId, int32_t(int32_t)> IntInt;
- typedef Function<AllTheTypesId, void(int8_t, uint8_t, int16_t, uint16_t,
- int32_t, uint32_t, int64_t, uint64_t,
- bool, std::string, std::vector<int>)>
- AllTheTypes;
-
+ typedef Function<AllTheTypesId,
+ void(int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t,
+ int64_t, uint64_t, bool, std::string, std::vector<int>)>
+ AllTheTypes;
};
-
TEST_F(DummyRPC, TestAsyncVoidBool) {
Queue Q1, Q2;
QueueChannel C1(Q1, Q2);
@@ -91,12 +88,10 @@ TEST_F(DummyRPC, TestAsyncVoidBool) {
{
// Expect a call to Proc1.
- auto EC = expect<VoidBool>(C2,
- [&](bool &B) {
- EXPECT_EQ(B, true)
- << "Bool serialization broken";
- return Error::success();
- });
+ auto EC = expect<VoidBool>(C2, [&](bool &B) {
+ EXPECT_EQ(B, true) << "Bool serialization broken";
+ return Error::success();
+ });
EXPECT_FALSE(EC) << "Simple expect over queue failed";
}
@@ -122,12 +117,10 @@ TEST_F(DummyRPC, TestAsyncIntInt) {
{
// Expect a call to Proc1.
- auto EC = expect<IntInt>(C2,
- [&](int32_t I) -> Expected<int32_t> {
- EXPECT_EQ(I, 21)
- << "Bool serialization broken";
- return 2 * I;
- });
+ auto EC = expect<IntInt>(C2, [&](int32_t I) -> Expected<int32_t> {
+ EXPECT_EQ(I, 21) << "Bool serialization broken";
+ return 2 * I;
+ });
EXPECT_FALSE(EC) << "Simple expect over queue failed";
}
@@ -150,60 +143,32 @@ TEST_F(DummyRPC, TestSerialization) {
// Make a call to Proc1.
std::vector<int> v({42, 7});
- auto ResOrErr = callAsyncWithSeq<AllTheTypes>(C1,
- -101,
- 250,
- -10000,
- 10000,
- -1000000000,
- 1000000000,
- -10000000000,
- 10000000000,
- true,
- "foo",
- v);
- EXPECT_TRUE(!!ResOrErr)
- << "Big (serialization test) call over queue failed";
+ auto ResOrErr = callAsyncWithSeq<AllTheTypes>(
+ C1, -101, 250, -10000, 10000, -1000000000, 1000000000, -10000000000,
+ 10000000000, true, "foo", v);
+ EXPECT_TRUE(!!ResOrErr) << "Big (serialization test) call over queue failed";
{
// Expect a call to Proc1.
- auto EC = expect<AllTheTypes>(C2,
- [&](int8_t &s8,
- uint8_t &u8,
- int16_t &s16,
- uint16_t &u16,
- int32_t &s32,
- uint32_t &u32,
- int64_t &s64,
- uint64_t &u64,
- bool &b,
- std::string &s,
- std::vector<int> &v) {
-
- EXPECT_EQ(s8, -101)
- << "int8_t serialization broken";
- EXPECT_EQ(u8, 250)
- << "uint8_t serialization broken";
- EXPECT_EQ(s16, -10000)
- << "int16_t serialization broken";
- EXPECT_EQ(u16, 10000)
- << "uint16_t serialization broken";
- EXPECT_EQ(s32, -1000000000)
- << "int32_t serialization broken";
- EXPECT_EQ(u32, 1000000000ULL)
- << "uint32_t serialization broken";
- EXPECT_EQ(s64, -10000000000)
- << "int64_t serialization broken";
- EXPECT_EQ(u64, 10000000000ULL)
- << "uint64_t serialization broken";
- EXPECT_EQ(b, true)
- << "bool serialization broken";
- EXPECT_EQ(s, "foo")
- << "std::string serialization broken";
- EXPECT_EQ(v, std::vector<int>({42, 7}))
- << "std::vector serialization broken";
- return Error::success();
- });
+ auto EC = expect<AllTheTypes>(
+ C2, [&](int8_t &s8, uint8_t &u8, int16_t &s16, uint16_t &u16,
+ int32_t &s32, uint32_t &u32, int64_t &s64, uint64_t &u64,
+ bool &b, std::string &s, std::vector<int> &v) {
+
+ EXPECT_EQ(s8, -101) << "int8_t serialization broken";
+ EXPECT_EQ(u8, 250) << "uint8_t serialization broken";
+ EXPECT_EQ(s16, -10000) << "int16_t serialization broken";
+ EXPECT_EQ(u16, 10000) << "uint16_t serialization broken";
+ EXPECT_EQ(s32, -1000000000) << "int32_t serialization broken";
+ EXPECT_EQ(u32, 1000000000ULL) << "uint32_t serialization broken";
+ EXPECT_EQ(s64, -10000000000) << "int64_t serialization broken";
+ EXPECT_EQ(u64, 10000000000ULL) << "uint64_t serialization broken";
+ EXPECT_EQ(b, true) << "bool serialization broken";
+ EXPECT_EQ(s, "foo") << "std::string serialization broken";
+ EXPECT_EQ(v, std::vector<int>({42, 7}))
+ << "std::vector serialization broken";
+ return Error::success();
+ });
EXPECT_FALSE(EC) << "Big (serialization test) call over queue failed";
}
OpenPOWER on IntegriCloud