I am working on a c++ unit tester(mostly as practice) and had some questions about my implementation. I wanted to have the ability to overload my custom assertions so I decided to implement them as functions that I wrapped in a namespace.
My current implementation is as follows:
Tester.h
#include <string>
#define INFO __FILE__, __LINE__
namespace Tester
{
void Assert(char const* input, char const* file_path, int line_number, std::string error_message);
...more overloaded Asserts and some Log functions...
}
And when I call the function:
#include "Tester.h"
...code...
Tester::Assert(false, INFO, "Some message");
...code...
This works but I´m not sure that the 'INFO' macro is good practice. I welcome all suggestions and pointers about this implementation, and feel free to tell me if it makes no sense and I should be doing something completely different ;)