<commit_before>// Copyright since 2016 : <NAME> (github.com/FrankStain/jnipp-test)
// Apache 2.0 License
#include <main.h>
#include <gtest/gtest.h>


<commit_msg>Tests for validity of function handles.<commit_after>// Copyright since 2016 : <NAME> (github.com/FrankStain/jnipp-test)
// Apache 2.0 License
#include <main.h>
#include <gtest/gtest.h>


#define DECLARE_TEST_ENV( NAME, RET, ... )											\
	jnipp::ClassHandle class_handle{ "com/pfs/jnipptest/TestFunctionContainer" };	\
																					\
	jnipp::FunctionHandle<RET, ##__VA_ARGS__>	func{ class_handle, NAME };


TEST( TestFunctionHandle, ValidVoidNoArguments )
{
	DECLARE_TEST_ENV( "VoidNoArguments", void );

	EXPECT_TRUE( func.IsValid() );
	EXPECT_NE( nullptr, *func );
};

TEST( TestFunctionHandle, ValidVoidOneArgument )
{
	DECLARE_TEST_ENV( "VoidOneArgument", void, std::string );

	EXPECT_TRUE( func.IsValid() );
	EXPECT_NE( nullptr, *func );
};

TEST( TestFunctionHandle, ValidVoidTwoArguments )
{
	DECLARE_TEST_ENV( "VoidTwoArguments", void, std::string, std::string );

	EXPECT_TRUE( func.IsValid() );
	EXPECT_NE( nullptr, *func );
};

TEST( TestFunctionHandle, ValidVoidThreeArguments )
{
	DECLARE_TEST_ENV( "VoidThreeArguments", void, std::string, std::string, std::string );

	EXPECT_TRUE( func.IsValid() );
	EXPECT_NE( nullptr, *func );
};

TEST( TestFunctionHandle, ValidStringNoArguments )
{
	DECLARE_TEST_ENV( "StringNoArguments", std::string );

	EXPECT_TRUE( func.IsValid() );
	EXPECT_NE( nullptr, *func );
};

TEST( TestFunctionHandle, ValidStringOneArgument )
{
	DECLARE_TEST_ENV( "StringOneArgument", std::string, std::string );

	EXPECT_TRUE( func.IsValid() );
	EXPECT_NE( nullptr, *func );
};

TEST( TestFunctionHandle, ValidStringTwoArguments )
{
	DECLARE_TEST_ENV( "StringTwoArguments", std::string, std::string, std::string );

	EXPECT_TRUE( func.IsValid() );
	EXPECT_NE( nullptr, *func );
};

TEST( TestFunctionHandle, ValidStringThreeArguments )
{
	DECLARE_TEST_ENV( "StringThreeArguments", std::string, std::string, std::string, std::string );

	EXPECT_TRUE( func.IsValid() );
	EXPECT_NE( nullptr, *func );
};

{'fraction_non_alphanumeric': 0.14292237442922373, 'fraction_numerical': 0.005479452054794521, 'mean_word_length': 4.423267326732673, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, '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': '418111', 'n_tokens_mistral': 772, 'n_tokens_neox': 742, 'n_words': 143}