Skip to content

Commit 2fdba53

Browse files
drewdzzzalyapunov
authored andcommitted
test: drop decodeUserTuple helper
The helper is not used since it is trivial to decode data with new decoder, so let's drop it. Along the way, alias Buf_t is moved from TupleReader.hpp since it has nothing in common with tuple definition. Also, the header is renamed to UserTuple.hpp since it contains only tuple definition now. And, while we are here, headers in Client tests and UserTuple.hpp are sorted, linter warning are fixed.
1 parent e932806 commit 2fdba53

File tree

3 files changed

+10
-20
lines changed

3 files changed

+10
-20
lines changed

test/ClientPerfTest.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
* SUCH DAMAGE.
3030
*/
3131
#include "Utils/Helpers.hpp"
32-
#include "Utils/TupleReader.hpp"
33-
#include "Utils/System.hpp"
3432
#include "Utils/PerfTimer.hpp"
33+
#include "Utils/System.hpp"
34+
#include "Utils/UserTuple.hpp"
3535

3636
#include "../src/Client/Connector.hpp"
3737
#include "../src/Client/LibevNetProvider.hpp"
@@ -54,6 +54,8 @@ constexpr size_t NUM_TEST = 500;
5454
constexpr size_t TOTAL_REQ = NUM_REQ * NUM_TEST;
5555
constexpr size_t NUM_CONN = 1;
5656

57+
using Buf_t = tnt::Buffer<16 * 1024>;
58+
5759
struct RequestResult {
5860
double rps;
5961
size_t server_rps;

test/ClientTest.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
* SUCH DAMAGE.
3030
*/
3131
#include "Utils/Helpers.hpp"
32-
#include "Utils/TupleReader.hpp"
3332
#include "Utils/System.hpp"
33+
#include "Utils/UserTuple.hpp"
3434

3535
#include "../src/Client/LibevNetProvider.hpp"
3636
#include "../src/Client/Connector.hpp"
@@ -41,6 +41,8 @@ int dummy_server_port = 3302;
4141
const char *unixsocket = "./tnt.sock";
4242
int WAIT_TIMEOUT = 1000; //milliseconds
4343

44+
using Buf_t = tnt::Buffer<16 * 1024>;
45+
4446
#ifdef TNTCXX_ENABLE_SSL
4547
constexpr bool enable_ssl = true;
4648
constexpr StreamTransport transport = STREAM_SSL;
Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,8 @@
3030
* SUCH DAMAGE.
3131
*/
3232
#include "../src/Buffer/Buffer.hpp"
33-
#include "../src/mpp/mpp.hpp"
34-
#include "../src/mpp/Dec.hpp"
3533
#include "../src/Client/ResponseDecoder.hpp"
34+
#include "../src/mpp/mpp.hpp"
3635

3736
/** Corresponds to data stored in _space[512]. */
3837
struct UserTuple {
@@ -46,24 +45,11 @@ struct UserTuple {
4645
&UserTuple::field4);
4746
};
4847

49-
std::ostream&
50-
operator<<(std::ostream& strm, const UserTuple &t)
48+
std::ostream &
49+
operator<<(std::ostream &strm, const UserTuple &t)
5150
{
5251
return strm << "Tuple: field1=" << t.field1 << " field2=" << t.field2 <<
5352
" field3=" << t.field3 <<
5453
" field4.first=" << t.field4.first <<
5554
" field4.second=" << t.field4.second;
5655
}
57-
58-
using Buf_t = tnt::Buffer<16 * 1024>;
59-
60-
template <class BUFFER>
61-
std::vector<UserTuple>
62-
decodeUserTuple(Data<BUFFER> &data)
63-
{
64-
std::vector<UserTuple> result;
65-
bool ok = data.decode(result);
66-
if (!ok)
67-
return std::vector<UserTuple>();
68-
return result;
69-
}

0 commit comments

Comments
 (0)