<commit_before>/**Some common functions in use for testing framework*/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the BSD License (revised).                      *
 *                                                                         *
 ***************************************************************************/

#include <kdb>

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

using namespace std;
using namespace kdb;

extern int nbError;
extern int nbTest;

#define warn_if_fail(x,y) {nbTest++; if (!(x)) { printf("%s:%d: warn in %s: %s\n", __FILE__, __LINE__, __FUNCTION__, y); }}
#define succeed_if(x,y) nbTest++; if (!(x)) { nbError++; printf("%s:%d: error in %s: %s\n", __FILE__, __LINE__, __FUNCTION__, y);}
#define exit_if_fail(x,y) nbTest++; if (!(x)) { printf("%s:%d: fatal in %s: %s\n", __FILE__, __LINE__, __FUNCTION__, y); exit(1); }

<commit_msg>use cout for c++ tests<commit_after>/**Some common functions in use for testing framework*/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the BSD License (revised).                      *
 *                                                                         *
 ***************************************************************************/

#include <kdb>

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

using namespace std;
using namespace kdb;

extern int nbError;
extern int nbTest;

#define warn_if_fail(x,y) {nbTest++; if (!(x)) { cout << __FILE__ << ":" << __LINE__ << " warning in " <<  __FUNCTION__ << ": " << y << endl;}}
#define succeed_if(x,y) {nbTest++; if (!(x)) { cout << __FILE__ << ":" << __LINE__ << " error in " <<  __FUNCTION__ << ": " << y << endl;}}
#define exit_if_fail(x,y) {nbTest++; if (!(x)) { cout << __FILE__ << ":" << __LINE__ << " fatal in " <<  __FUNCTION__ << ": " << y << endl;  exit(1);}}


{'fraction_non_alphanumeric': 0.26815398075240593, 'fraction_numerical': 0.0008748906386701663, 'mean_word_length': 2.5790297339593113, 'pattern_counts': {'":': 6, '<': 61, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1660869', 'n_tokens_mistral': 616, 'n_tokens_neox': 592, 'n_words': 188}