diff --git a/test/ClientPerfTest.cpp b/test/ClientPerfTest.cpp index 46b1719f0..6494ab841 100644 --- a/test/ClientPerfTest.cpp +++ b/test/ClientPerfTest.cpp @@ -29,9 +29,9 @@ * SUCH DAMAGE. */ #include "Utils/Helpers.hpp" -#include "Utils/TupleReader.hpp" -#include "Utils/System.hpp" #include "Utils/PerfTimer.hpp" +#include "Utils/System.hpp" +#include "Utils/UserTuple.hpp" #include "../src/Client/Connector.hpp" #include "../src/Client/LibevNetProvider.hpp" @@ -54,6 +54,8 @@ constexpr size_t NUM_TEST = 500; constexpr size_t TOTAL_REQ = NUM_REQ * NUM_TEST; constexpr size_t NUM_CONN = 1; +using Buf_t = tnt::Buffer<16 * 1024>; + struct RequestResult { double rps; size_t server_rps; diff --git a/test/ClientTest.cpp b/test/ClientTest.cpp index fea8d1268..6ebccab0b 100644 --- a/test/ClientTest.cpp +++ b/test/ClientTest.cpp @@ -29,8 +29,8 @@ * SUCH DAMAGE. */ #include "Utils/Helpers.hpp" -#include "Utils/TupleReader.hpp" #include "Utils/System.hpp" +#include "Utils/UserTuple.hpp" #include "../src/Client/LibevNetProvider.hpp" #include "../src/Client/Connector.hpp" @@ -41,6 +41,8 @@ int dummy_server_port = 3302; const char *unixsocket = "./tnt.sock"; int WAIT_TIMEOUT = 1000; //milliseconds +using Buf_t = tnt::Buffer<16 * 1024>; + #ifdef TNTCXX_ENABLE_SSL constexpr bool enable_ssl = true; constexpr StreamTransport transport = STREAM_SSL; diff --git a/test/Utils/TupleReader.hpp b/test/Utils/UserTuple.hpp similarity index 85% rename from test/Utils/TupleReader.hpp rename to test/Utils/UserTuple.hpp index a66365517..20d77c6c6 100644 --- a/test/Utils/TupleReader.hpp +++ b/test/Utils/UserTuple.hpp @@ -30,9 +30,8 @@ * SUCH DAMAGE. */ #include "../src/Buffer/Buffer.hpp" -#include "../src/mpp/mpp.hpp" -#include "../src/mpp/Dec.hpp" #include "../src/Client/ResponseDecoder.hpp" +#include "../src/mpp/mpp.hpp" /** Corresponds to data stored in _space[512]. */ struct UserTuple { @@ -46,24 +45,11 @@ struct UserTuple { &UserTuple::field4); }; -std::ostream& -operator<<(std::ostream& strm, const UserTuple &t) +std::ostream & +operator<<(std::ostream &strm, const UserTuple &t) { return strm << "Tuple: field1=" << t.field1 << " field2=" << t.field2 << " field3=" << t.field3 << " field4.first=" << t.field4.first << " field4.second=" << t.field4.second; } - -using Buf_t = tnt::Buffer<16 * 1024>; - -template -std::vector -decodeUserTuple(Data &data) -{ - std::vector result; - bool ok = data.decode(result); - if (!ok) - return std::vector(); - return result; -}