Commit 4bd9928c authored by Nick Thompson's avatar Nick Thompson
Browse files

The __FILE__ macro is a const char* with the same lifetime as the program.

parent 4df064f3
Pipeline #223796 passed with stage
......@@ -296,10 +296,7 @@ public:
{
public:
template <typename... Ts>
VTKM_CONT TestFailure(const std::string& file,
vtkm::Id line,
const char* func,
Ts&&... messages)
VTKM_CONT TestFailure(const char* file, vtkm::Id line, const char* func, Ts&&... messages)
: File(file)
, Line(line)
, Func(func)
......@@ -309,7 +306,7 @@ public:
this->Message = messageStream.str();
}
VTKM_CONT const std::string& GetFile() const { return this->File; }
VTKM_CONT const char* GetFile() const { return this->File; }
VTKM_CONT vtkm::Id GetLine() const { return this->Line; }
VTKM_CONT const char* GetFunction() const { return this->Func; }
VTKM_CONT const std::string& GetMessage() const { return this->Message; }
......@@ -351,7 +348,7 @@ public:
this->AppendMessages(messageStream, std::forward<Ts>(ms)...);
}
std::string File;
const char* File;
vtkm::Id Line;
const char* Func;
std::string Message;
......@@ -359,7 +356,7 @@ public:
template <typename... Ts>
static VTKM_CONT void Assert(const std::string& conditionString,
const std::string& file,
const char* file,
vtkm::Id line,
const char* func,
bool condition,
......@@ -377,7 +374,7 @@ public:
}
static VTKM_CONT void Assert(const std::string& conditionString,
const std::string& file,
const char* file,
vtkm::Id line,
const char* func,
bool condition)
......@@ -386,7 +383,7 @@ public:
}
static VTKM_CONT void Assert(const std::string& conditionString,
const std::string& file,
const char* file,
vtkm::Id line,
const char* func,
const TestEqualResult& result)
......@@ -395,7 +392,7 @@ public:
}
template <typename... Ts>
static VTKM_CONT void TestFail(const std::string& file,
static VTKM_CONT void TestFail(const char* file,
vtkm::Id line,
const char* func,
Ts&&... messages)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment