<commit_before>#include "stdafx.h"
#include "CppUnitTest.h"
#include "Mock.h"
#include <iostream>

using namespace Microsoft::VisualStudio::CppUnitTestFramework;

namespace stubbing_tests
{
	TEST_CLASS(RemoveConstVolatileTests)
	{
	public:

		struct ConstVolatileFunctions{
			virtual int func1() const = 0;
			virtual int func2() volatile = 0;
			virtual int func3() const volatile = 0;
			virtual const int func4() const volatile = 0;

			virtual void proc1() const = 0;
			virtual void proc2() volatile = 0;
			virtual void proc3() const volatile = 0;
			virtual const void proc4() const volatile = 0;

		};

		TEST_METHOD(TestConstFunctions)
		{
			Mock<ConstVolatileFunctions> mock;
			mock.Stub(&ConstVolatileFunctions::func1);
			mock.Stub(&ConstVolatileFunctions::func2);
			mock.Stub(&ConstVolatileFunctions::func3);
			mock.Stub(&ConstVolatileFunctions::func4);
			mock.Stub(&ConstVolatileFunctions::proc1);
			mock.Stub(&ConstVolatileFunctions::proc2);
			mock.Stub(&ConstVolatileFunctions::proc3);
			mock.Stub(&ConstVolatileFunctions::proc4);
			ConstVolatileFunctions& i = mock.get();
			Assert::AreEqual(0, i.func1());
			Assert::AreEqual(0, i.func2());
			Assert::AreEqual(0, i.func3());
			Assert::AreEqual(0, i.func4());
			i.proc1();
			i.proc2();
			i.proc3();
			i.proc4();
		}

	};
}<commit_msg>add tests<commit_after>#include "stdafx.h"
#include "CppUnitTest.h"
#include "Mock.h"
#include <iostream>

using namespace Microsoft::VisualStudio::CppUnitTestFramework;

namespace stubbing_tests
{
	TEST_CLASS(RemoveConstVolatileTests)
	{
	public:

		struct ConstVolatileFunctions{
			virtual int func1() const = 0;
			virtual int func2() volatile = 0;
			virtual int func3() const volatile = 0;
			virtual const int func4() const volatile = 0;

			virtual void proc1() const = 0;
			virtual void proc2() volatile = 0;
			virtual void proc3() const volatile = 0;
			virtual const void proc4() const volatile = 0;
		};

		TEST_METHOD(TestConstFunctions)
		{
			Mock<ConstVolatileFunctions> mock;
			mock.Stub(&ConstVolatileFunctions::func1);
			mock.Stub(&ConstVolatileFunctions::func2);
			mock.Stub(&ConstVolatileFunctions::func3);
			mock.Stub(&ConstVolatileFunctions::func4);
			mock.Stub(&ConstVolatileFunctions::proc1);
			mock.Stub(&ConstVolatileFunctions::proc2);
			mock.Stub(&ConstVolatileFunctions::proc3);
			mock.Stub(&ConstVolatileFunctions::proc4);
			ConstVolatileFunctions& i = mock.get();
			Assert::AreEqual(0, i.func1());
			Assert::AreEqual(0, i.func2());
			Assert::AreEqual(0, i.func3());
			Assert::AreEqual(0, i.func4());
			i.proc1();
			i.proc2();
			i.proc3();
			i.proc4();
		}

		struct ConstVolatileParameters{
			virtual int func1(const int a, const volatile std::string s) = 0;
		};

		TEST_METHOD(TestConstParameters)
		{
			Mock<ConstVolatileParameters> mock;
			mock.Stub(&ConstVolatileParameters::func1);
			ConstVolatileParameters& i = mock.get();
			Assert::AreEqual(0, i.func1(1,std::string()));
		}
	};
}
{'fraction_non_alphanumeric': 0.14116852414724756, 'fraction_numerical': 0.02634245187436677, 'mean_word_length': 4.900398406374502, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, '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': '118690', 'n_tokens_mistral': 1126, 'n_tokens_neox': 987, 'n_words': 200}