Defines | Variables

check.h File Reference

#include <sstream>
#include <iostream>
#include <string>
#include "dejagnu.h"
Include dependency graph for check.h:

Go to the source code of this file.

Defines

#define HAVE_DEJAGNU_H   1
#define info(x)   note x
#define check_equals_label(label, expr, expected)
#define xcheck_equals_label(label, expr, expected)
#define check_equals(expr, expected)   check_equals_label(std::string(), expr, expected)
#define xcheck_equals(expr, expected)   xcheck_equals_label(std::string(), expr, expected)
#define check(expr)
#define xcheck(expr)

Variables

TestState _runtest

Define Documentation

#define check (   expr  ) 
Value:
{ \
                std::stringstream ss; \
                ss << #expr; \
                ss << " [" << __FILE__ << ":" << __LINE__ << "]"; \
                if ( expr ) { \
                        _runtest.pass(ss.str().c_str()); \
                } else { \
                        _runtest.fail(ss.str().c_str()); \
                } \
        }

Referenced by checkScribbling(), main(), test_mouse_activity(), and testAll().

#define check_equals (   expr,
  expected 
)    check_equals_label(std::string(), expr, expected)
#define check_equals_label (   label,
  expr,
  expected 
)
Value:
{ \
                std::stringstream ss; \
                if ( ! label.empty() ) ss << label << ": "; \
                if ( expr == expected ) \
                { \
                        ss << #expr << " == " << expected; \
                        ss << " [" << __FILE__ << ":" << __LINE__ << "]"; \
                        _runtest.pass(ss.str().c_str()); \
                } \
                else \
                { \
                        ss << #expr << " == '" << expr << "' (expected: " \
                                << expected << ")"; \
                        ss << " [" << __FILE__ << ":" << __LINE__ << "]"; \
                        _runtest.fail(ss.str().c_str()); \
                } \
        }

Referenced by main().

#define HAVE_DEJAGNU_H   1
#define info (   x  )     note x
#define xcheck (   expr  ) 
Value:
{ \
                std::stringstream ss; \
                ss << #expr; \
                ss << " [" << __FILE__ << ":" << __LINE__ << "]"; \
                if ( expr ) { \
                        _runtest.xpass(ss.str().c_str()); \
                } else { \
                        _runtest.xfail(ss.str().c_str()); \
                } \
        }

Referenced by main().

#define xcheck_equals (   expr,
  expected 
)    xcheck_equals_label(std::string(), expr, expected)

Referenced by main().

#define xcheck_equals_label (   label,
  expr,
  expected 
)
Value:
{ \
                std::stringstream ss; \
                if ( label != "" ) ss << label << ": "; \
                if ( expr == expected ) \
                { \
                        ss << #expr << " == " << expected; \
                        ss << " [" << __FILE__ << ":" << __LINE__ << "]"; \
                        _runtest.xpass(ss.str().c_str()); \
                } \
                else \
                { \
                        ss << #expr << " == '" << expr << "' (expected: " \
                                << expected << ")"; \
                        ss << " [" << __FILE__ << ":" << __LINE__ << "]"; \
                        _runtest.xfail(ss.str().c_str()); \
                } \
        }

Variable Documentation

TestState _runtest