Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
expect.h File Reference
#include <iostream>
Include dependency graph for expect.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  RoutingKit
 
namespace  RoutingKit::detail
 

Macros

#define EXPECT(c)    EXPECT2(c, #c, __LINE__)
 
#define EXPECT2(c, c_msg, line)    ((c) ? std::cerr : (expect_failed = true, std::cerr << c_msg <<" failed in line "<<line << std::endl))
 
#define EXPECT_CMP(x, op, y)    EXPECT_CMP2(x, op, y, #x, #op, #y, __LINE__)
 
#define EXPECT_CMP2(x, op, y, x_msg, op_msg, y_msg, line)    (((x) op (y)) ? std::cerr : (expect_failed = true, std::cerr << x_msg << ' ' <<op_msg << ' ' << y_msg << " failed in line "<<line <<"\n"<<x_msg<<" is "<<::RoutingKit::detail::handle_null_ptr(x)<<"\n"<<y_msg<<" is "<<::RoutingKit::detail::handle_null_ptr(y) << std::endl))
 

Functions

const char * RoutingKit::detail::handle_null_ptr (const char *p)
 
const char * RoutingKit::detail::handle_null_ptr (const decltype(nullptr))
 
template<class T >
const T & RoutingKit::detail::handle_null_ptr (const T &t)
 

Macro Definition Documentation

◆ EXPECT

#define EXPECT (   c)     EXPECT2(c, #c, __LINE__)

Definition at line 22 of file expect.h.

◆ EXPECT2

#define EXPECT2 (   c,
  c_msg,
  line 
)     ((c) ? std::cerr : (expect_failed = true, std::cerr << c_msg <<" failed in line "<<line << std::endl))

Definition at line 19 of file expect.h.

◆ EXPECT_CMP

#define EXPECT_CMP (   x,
  op,
 
)     EXPECT_CMP2(x, op, y, #x, #op, #y, __LINE__)

Definition at line 30 of file expect.h.

◆ EXPECT_CMP2

#define EXPECT_CMP2 (   x,
  op,
  y,
  x_msg,
  op_msg,
  y_msg,
  line 
)     (((x) op (y)) ? std::cerr : (expect_failed = true, std::cerr << x_msg << ' ' <<op_msg << ' ' << y_msg << " failed in line "<<line <<"\n"<<x_msg<<" is "<<::RoutingKit::detail::handle_null_ptr(x)<<"\n"<<y_msg<<" is "<<::RoutingKit::detail::handle_null_ptr(y) << std::endl))

Definition at line 27 of file expect.h.