<commit_before>/**
 * @file
 *
 * @brief Some common functions in use for testing framework
 *
 * @copyright BSD License (see LICENSE.md or https://www.libelektra.org)
 */

#ifndef KDB_TESTS_HPP
#define KDB_TESTS_HPP

#include <kdb.hpp>
#include <kdbmacros.h>
#include <key.hpp>
#include <keyset.hpp>

#include <cstdlib>
#include <cstring>
#include <exception>
#include <iostream>
#include <string>

#include <gtest/gtest.h>

using namespace std;
using namespace kdb;

#define succeed_if(x, y) ASSERT_TRUE (x) << y

#define exit_if_fail(expression, message)                                                                                                  \
	if (!(expression))                                                                                                                 \
	{                                                                                                                                  \
		cerr << __FILE__ << ":" << __LINE__ << ": Failure" << endl;                                                                \
		cerr << "Value of: " << ELEKTRA_STRINGIFY (expression) << endl;                                                            \
		cerr << "  Actual: false" << endl;                                                                                         \
		cerr << "Expected: true" << endl;                                                                                          \
		cerr << message << endl;                                                                                                   \
		exit (1);                                                                                                                  \
	}                                                                                                                                  \
	SUCCEED () << message;

#define succeed_if_same(x, y, message) ASSERT_EQ (x, y) << message
#define compare_keyset(keySet1, keySet2) ASSERT_EQ (keySet1, keySet2) << "Key sets are not equal"

#endif
<commit_msg>Test: Remove trailing semicolon from macro<commit_after>/**
 * @file
 *
 * @brief Some common functions in use for testing framework
 *
 * @copyright BSD License (see LICENSE.md or https://www.libelektra.org)
 */

#ifndef KDB_TESTS_HPP
#define KDB_TESTS_HPP

#include <kdb.hpp>
#include <kdbmacros.h>
#include <key.hpp>
#include <keyset.hpp>

#include <cstdlib>
#include <cstring>
#include <exception>
#include <iostream>
#include <string>

#include <gtest/gtest.h>

using namespace std;
using namespace kdb;

#define succeed_if(x, y) ASSERT_TRUE (x) << y

#define exit_if_fail(expression, message)                                                                                                  \
	if (!(expression))                                                                                                                 \
	{                                                                                                                                  \
		cerr << __FILE__ << ":" << __LINE__ << ": Failure" << endl;                                                                \
		cerr << "Value of: " << ELEKTRA_STRINGIFY (expression) << endl;                                                            \
		cerr << "  Actual: false" << endl;                                                                                         \
		cerr << "Expected: true" << endl;                                                                                          \
		cerr << message << endl;                                                                                                   \
		exit (1);                                                                                                                  \
	}                                                                                                                                  \
	SUCCEED () << message

#define succeed_if_same(x, y, message) ASSERT_EQ (x, y) << message
#define compare_keyset(keySet1, keySet2) ASSERT_EQ (keySet1, keySet2) << "Key sets are not equal"

#endif

{'fraction_non_alphanumeric': 0.08459657701711491, 'fraction_numerical': 0.0024449877750611247, 'mean_word_length': 0.7320067739204065, 'pattern_counts': {'":': 4, '<': 95, '<?xml version=': 0, '>': 23, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 80, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6938213', 'n_tokens_mistral': 816, 'n_tokens_neox': 795, 'n_words': 215}