<commit_before>#include <gtest/gtest.h>

#include <dsn/service_api_c.h>
#include <dsn/service_api_cpp.h>

#include "meta_service.h"
#include "server_state.h"
#include "meta_service_test_app.h"

dsn_message_t create_corresponding_receive(dsn_message_t request_msg)
{
    return dsn_msg_copy(request_msg);

    /*dsn::message_ex* rpc_message = reinterpret_cast<dsn::message_ex*>(request_msg);
    std::vector<dsn::blob>& buffers = rpc_message->buffers;

    int total_length = rpc_message->body_size() + sizeof(dsn::message_header);
    std::shared_ptr<char> recv_buffer(new char[total_length], std::default_delete<char[]>() );
    char* ptr = recv_buffer.get();
    int i=0;
    for (dsn::blob& bb: buffers) {
        memcpy(ptr, bb.data(), bb.length());
        i+=bb.length();
        ptr+=bb.length();
    }
    dassert(i==total_length, "");

    dsn::message_ex* result = dsn::message_ex::create_receive_message( dsn::blob(recv_buffer, total_length) );
    return result;*/
}

class fake_receiver_meta_service: public dsn::replication::meta_service
{<commit_msg>add support for copy but change the message send to recv to avoid meta test failure with dsn_msg_copy<commit_after>#include <gtest/gtest.h>

#include <dsn/service_api_c.h>
#include <dsn/service_api_cpp.h>

#include "meta_service.h"
#include "server_state.h"
#include "meta_service_test_app.h"

dsn_message_t create_corresponding_receive(dsn_message_t request_msg)
{
    return dsn_msg_copy(request_msg, true);

    /*dsn::message_ex* rpc_message = reinterpret_cast<dsn::message_ex*>(request_msg);
    std::vector<dsn::blob>& buffers = rpc_message->buffers;

    int total_length = rpc_message->body_size() + sizeof(dsn::message_header);
    std::shared_ptr<char> recv_buffer(new char[total_length], std::default_delete<char[]>() );
    char* ptr = recv_buffer.get();
    int i=0;
    for (dsn::blob& bb: buffers) {
        memcpy(ptr, bb.data(), bb.length());
        i+=bb.length();
        ptr+=bb.length();
    }
    dassert(i==total_length, "");

    dsn::message_ex* result = dsn::message_ex::create_receive_message( dsn::blob(recv_buffer, total_length) );
    return result;*/
}

class fake_receiver_meta_service: public dsn::replication::meta_service
{
{'fraction_non_alphanumeric': 0.14703237410071943, 'fraction_numerical': 0.0008992805755395684, 'mean_word_length': 5.303116147308782, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2361738', 'n_tokens_mistral': 814, 'n_tokens_neox': 795, 'n_words': 132}