void Throw_Exception_With_StackTrace(const char* fileName, const int lineNumber) throw(std::runtime_error) { std::string ErrorMsg("Assertion failed in "); ErrorMsg.append(fileName).append(":").append(std::to_string(lineNumber)); throw std::runtime_error(ErrorMsg); } void Throw_Exception_Without_StackTrace(const char* fileName, const int lineNumber) throw(std::runtime_error) { std::string ErrorMsg("Assertion failed in "); ErrorMsg.append(fileName).append(":-").append(std::to_string(lineNumber)); throw std::runtime_error(ErrorMsg); } TEST(Test, WithStackTrace) { Throw_Exception_With_StackTrace(__FILE__, __LINE__); } TEST(Test, WithoutStackTrace) { Throw_Exception_Without_StackTrace(__FILE__, __LINE__); }