<commit_before>/**
 * @file NaoTHAssert.h
 *
 * This file contains macros for low level debugging.
 * (partly copied from GT07 GTAssert.h)
 *
 * @author <NAME> (GT07)
 * @author <NAME>
 */

#ifndef __NaoTHAssert_h_
#define __NaoTHAssert_h_

#include <assert.h>
#include <iostream>
#include "Trace.h"

#undef ASSERT
#undef VERIFY
#undef THROW

#ifdef DEBUG

/**
 * ASSERT prints a message and stops the programm (!) if cond is false and DEBUG is defined.
 * ASSERT does not evaluate cond if DEBUG is not defined.
 * @param cond The condition to be checked.
 */
// TODO: make it better
#define ASSERT(cond) { if(!(cond)){ GT_TRACE(#cond); Trace::getInstance().dump(); assert(cond); } }

/**
 * VERIFY prints a message if cond is false and DEBUG is defined.
 * VERIFY does evaluate cond even if DEBUG is not defined.
 * @param cond The condition to be checked.
 */
#define VERIFY(cond) ASSERT(cond)

/**
 * Throw a error message and then exit
 * @param msg The debug message
 */
#define THROW(msg) { std::cerr<<msg<<std::endl; ASSERT(false); }

#else //DEBUG
/* ((void)0) - that's a do-nothing statement */
#define ASSERT(cond) ((void)0)
#define VERIFY(cond) ((void)(cond))
#define THROW(msg) { std::cerr<<msg<<std::endl; }
#endif //DEBUG

#endif //__NaoTHAssert_h_<commit_msg>- provide more ASSERT information<commit_after>/**
 * @file NaoTHAssert.h
 *
 * This file contains macros for low level debugging.
 * (partly copied from GT07 GTAssert.h)
 *
 * @author <NAME> (GT07)
 * @author <NAME>
 */

#ifndef __NaoTHAssert_h_
#define __NaoTHAssert_h_

#include <assert.h>
#include <iostream>
#include "Trace.h"

#undef ASSERT
#undef VERIFY
#undef THROW

#ifdef DEBUG

/**
 * ASSERT prints a message and stops the programm (!) if cond is false and DEBUG is defined.
 * ASSERT does not evaluate cond if DEBUG is not defined.
 * @param cond The condition to be checked.
 */
// TODO: make it better
#define ASSERT(cond) { if(!(cond)){ GT_TRACE(#cond); Trace::getInstance().dump(); assert(cond); } }

/**
 * VERIFY prints a message if cond is false and DEBUG is defined.
 * VERIFY does evaluate cond even if DEBUG is not defined.
 * @param cond The condition to be checked.
 */
#define VERIFY(cond) ASSERT(cond)

/**
 * Throw a error message and then exit
 * @param msg The debug message
 */
#define THROW(msg) { std::cerr<<msg<<std::endl; GT_TRACE(msg); Trace::getInstance().dump(); assert(false); }

#else //DEBUG
/* ((void)0) - that's a do-nothing statement */
#define ASSERT(cond) ((void)0)
#define VERIFY(cond) ((void)(cond))
#define THROW(msg) { std::cerr<<msg<<std::endl; }
#endif //DEBUG

#endif //__NaoTHAssert_h_
{'fraction_non_alphanumeric': 0.1447166921898928, 'fraction_numerical': 0.004594180704441042, 'mean_word_length': 4.278787878787878, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 11, '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': '6812635', 'n_tokens_mistral': 861, 'n_tokens_neox': 845, 'n_words': 305}