<commit_before>/***********************************************************************************************************************
 * TestAssertions.h
 *
 *  Created on: Nov 10, 2010
 *      Author: <NAME>
 **********************************************************************************************************************/

#ifndef TESTASSERTIONS_H_
#define TESTASSERTIONS_H_

/**********************************************************************************************************************/
#define CHECK_GENERIC_EQUAL(expected, actual)																								\
	try																																					\
	{																																						\
		if ( (expected) == (actual) ) testResults.addPassed();																			\
		else																																				\
		{																																					\
			QString message = getName() + "   " + __FILE__ + ":" + QString::number(__LINE__) + "\n";							\
			message += "Actual value is different from expected";																			\
			testResults.addFailed(message);																										\
		}																																					\
	} catch (...)																																		\
	{																																						\
		testResults.addFailed(getName() + "   " + __FILE__ + ":" + QString::number(__LINE__) + "\nUncaught exception");\
	}
/**********************************************************************************************************************/

/**********************************************************************************************************************/
#define CHECK_INT_EQUAL(expected, actual)																										\
	try																																					\
	{																																						\
		if ( (expected) == (actual) ) testResults.addPassed();																			\
		else																																				\
		{																																					\
			QString message = getName() + "   " + __FILE__ + ":" + QString::number(__LINE__) + "\n";							\
			message += "Actual value is different from expected\n";																		\
			message += "Actual    " + QString::number(actual) + "\n";																	\
			message += "Expected  " + QString::number(exptected);																			\
			testResults.addFailed(message);																										\
		}																																					\
	} catch (...)																																		\
	{																																						\
		testResults.addFailed(getName() + "   " + __FILE__ + ":" + QString::number(__LINE__) + "\nUncaught exception");\
	}
/**********************************************************************************************************************/

/**********************************************************************************************************************/
#define CHECK_CONDITION( condition )																											\
	try																																					\
	{																																						\
		if ( (condition) ) testResults.addPassed();																							\
		else																																				\
		{																																					\
			QString message = getName() + "   " + __FILE__ + ":" + QString::number(__LINE__) + "\n";							\
			message += "Condition is false: " #condition;																					\
			testResults.addFailed(message);																										\
		}																																					\
	} catch (...)																																		\
	{																																						\
		testResults.addFailed(getName() + "   " + __FILE__ + ":" + QString::number(__LINE__) + "\nUncaught exception");\
	}
/**********************************************************************************************************************/<commit_msg>Added a Model to the node constructors.<commit_after>/***********************************************************************************************************************
 * TestAssertions.h
 *
 *  Created on: Nov 10, 2010
 *      Author: <NAME>
 **********************************************************************************************************************/

#ifndef TESTASSERTIONS_H_
#define TESTASSERTIONS_H_

/**********************************************************************************************************************/
#define CHECK_GENERIC_EQUAL(expected, actual)																								\
	try																																					\
	{																																						\
		if ( (expected) == (actual) ) testResults.addPassed();																			\
		else																																				\
		{																																					\
			QString message = getName() + "   " + __FILE__ + ":" + QString::number(__LINE__) + "\n";							\
			message += "Actual value is different from expected";																			\
			testResults.addFailed(message);																										\
		}																																					\
	} catch (...)																																		\
	{																																						\
		testResults.addFailed(getName() + "   " + __FILE__ + ":" + QString::number(__LINE__) + "\nUncaught exception");\
	}
/**********************************************************************************************************************/

/**********************************************************************************************************************/
#define CHECK_INT_EQUAL(expected, actual)																										\
	try																																					\
	{																																						\
		if ( (expected) == (actual) ) testResults.addPassed();																			\
		else																																				\
		{																																					\
			QString message = getName() + "   " + __FILE__ + ":" + QString::number(__LINE__) + "\n";							\
			message += "Actual value is different from expected\n";																		\
			message += "Actual    " + QString::number(actual) + "\n";																	\
			message += "Expected  " + QString::number(expected);																			\
			testResults.addFailed(message);																										\
		}																																					\
	} catch (...)																																		\
	{																																						\
		testResults.addFailed(getName() + "   " + __FILE__ + ":" + QString::number(__LINE__) + "\nUncaught exception");\
	}
/**********************************************************************************************************************/

/**********************************************************************************************************************/
#define CHECK_CONDITION( condition )																											\
	try																																					\
	{																																						\
		if ( (condition) ) testResults.addPassed();																							\
		else																																				\
		{																																					\
			QString message = getName() + "   " + __FILE__ + ":" + QString::number(__LINE__) + "\n";							\
			message += "Condition is false: " #condition;																					\
			testResults.addFailed(message);																										\
		}																																					\
	} catch (...)																																		\
	{																																						\
		testResults.addFailed(getName() + "   " + __FILE__ + ":" + QString::number(__LINE__) + "\nUncaught exception");\
	}
/**********************************************************************************************************************/
{'fraction_non_alphanumeric': 0.3449439719184555, 'fraction_numerical': 0.0016200891049007696, 'mean_word_length': 1.4644045242847639, 'pattern_counts': {'":': 12, '<': 5, '<?xml version=': 0, '>': 5, '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': '6020191', 'n_tokens_mistral': 1732, 'n_tokens_neox': 1386, 'n_words': 214}