Skip to content
Snippets Groups Projects
Commit a2bb483f authored by Nat Goodspeed's avatar Nat Goodspeed
Browse files

Disambiguate a few ensure() calls.

These were of the form ensure(std::string, something convertible to bool). Not
sure what the ambiguity was, but ensure(std::string, bool(something)) works
better.
parent c56036a8
No related branches found
No related tags found
No related merge requests found
......@@ -85,7 +85,7 @@ static std::string readfile(const std::string& pathname, const std::string& desc
}
std::ifstream inf(pathname.c_str());
std::string output;
tut::ensure(STRINGIZE("No output " << use_desc), std::getline(inf, output));
tut::ensure(STRINGIZE("No output " << use_desc), bool(std::getline(inf, output)));
std::string more;
while (std::getline(inf, more))
{
......@@ -154,7 +154,7 @@ struct PythonProcessLauncher
void launch()
{
mPy = LLProcess::create(mParams);
tut::ensure(STRINGIZE("Couldn't launch " << mDesc << " script"), mPy);
tut::ensure(STRINGIZE("Couldn't launch " << mDesc << " script"), bool(mPy));
}
/// Run Python script and wait for it to complete.
......@@ -873,7 +873,7 @@ namespace tut
std::string threw; \
/* Both the following calls should work. */ \
(PROCESS).GETPIPE(VALID); \
ensure(#GETOPTPIPE "(" #VALID ") failed", (PROCESS).GETOPTPIPE(VALID)); \
ensure(#GETOPTPIPE "(" #VALID ") failed", bool((PROCESS).GETOPTPIPE(VALID))); \
/* pass obviously bogus PIPESLOT */ \
CATCH_IN(threw, LLProcess::NoPipe, (PROCESS).GETPIPE(LLProcess::FILESLOT(4))); \
ensure_contains("didn't reject bad slot", threw, "no slot"); \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment