THRIFT-5817: [C++] Avoid copy of TUuid
Client: cpp
Patch: Carel Combrink
This closes #3038
diff --git a/test/cpp/src/TestClient.cpp b/test/cpp/src/TestClient.cpp
index 6bda294..64193c6 100644
--- a/test/cpp/src/TestClient.cpp
+++ b/test/cpp/src/TestClient.cpp
@@ -181,7 +181,9 @@
#define UUID_TEST(func, value, expected) \
cout << #func "(" << value << ") = "; \
try { \
- if (!print_eq(expected, testClient.func(value))) \
+ TUuid ret; \
+ testClient.func(ret, value); \
+ if (!print_eq(expected, ret)) \
return_code |= ERR_BASETYPES; \
} catch (TTransportException&) { \
throw; \
diff --git a/test/cpp/src/TestServer.cpp b/test/cpp/src/TestServer.cpp
index dc6e69f..858fffa 100644
--- a/test/cpp/src/TestServer.cpp
+++ b/test/cpp/src/TestServer.cpp
@@ -132,9 +132,9 @@
_return = thing;
}
- TUuid testUuid(const TUuid thing) override {
+ void testUuid(apache::thrift::TUuid& _return, const apache::thrift::TUuid& thing) override {
printf("testUuid(\"{%s}\")\n", to_string(thing).c_str());
- return thing;
+ _return = thing;
}
void testStruct(Xtruct& out, const Xtruct& thing) override {
@@ -447,8 +447,9 @@
cob(res);
}
- void testUuid(::std::function<void(TUuid const& _return)> cob, const TUuid thing) override {
- TUuid res = _delegate->testUuid(thing);
+ void testUuid(::std::function<void(apache::thrift::TUuid const& _return)> cob, const apache::thrift::TUuid& thing) override {
+ TUuid res;
+ _delegate->testUuid(res, thing);
cob(res);
}