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

#include "ThreadSafeMessaging.h"

using namespace std;

class TestMessenger : public ThreadSafeMessaging
{
public:
	TestMessenger()
	{
		m_messaging = NULL;
	}

	TestMessenger( ThreadSafeMessaging* p_messaging )
	{
		m_messaging = p_messaging;
	}

	~TestMessenger()
	{
	}

	void sendMessage( string p_message )
	{
		m_messaging->putMessage( new ProcessMessage(
			MessageType::TEXT, m_messaging, p_message ) );
	}

private:
	ThreadSafeMessaging* m_messaging;


};

TEST(ThreadSafeMessaging, PutMessage)
{
	ThreadSafeMessaging* A = new TestMessenger();

	TestMessenger* B = new TestMessenger(A);
	string hej = "hej";
	B->sendMessage( hej );

}<commit_msg>Written one test for ThreadSafeMessaging and it passes.<commit_after>#include <gtest/gtest.h>
#include <string>

#include "ThreadSafeMessaging.h"

using namespace std;

class TestMessenger : public ThreadSafeMessaging
{
public:
	TestMessenger()
	{
		m_messaging = NULL;
	}

	TestMessenger( ThreadSafeMessaging* p_messaging )
	{
		m_messaging = p_messaging;
	}

	~TestMessenger()
	{
	}

	void sendMessage( string p_message )
	{
		m_messaging->putMessage( new ProcessMessage(
			MessageType::TEXT, m_messaging, p_message ) );
	}

	string getMessage()
	{
		ProcessMessage* message = popMessage();

		string outMessage = message->message;

		delete message;

		return outMessage;
	}

private:
	ThreadSafeMessaging* m_messaging;


};

TEST(ThreadSafeMessaging, PutMessage)
{
	ThreadSafeMessaging* A = new TestMessenger();

	TestMessenger* B = new TestMessenger(A);
	string hej = "hej";
	B->sendMessage( hej );

	EXPECT_STREQ( hej.c_str(), static_cast<TestMessenger*>(A)->getMessage().c_str() );
}
{'fraction_non_alphanumeric': 0.11561032863849766, 'fraction_numerical': 0.0, 'mean_word_length': 5.067615658362989, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 14, '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': '5386986', 'n_tokens_mistral': 678, 'n_tokens_neox': 606, 'n_words': 124}