Make unit tests repeatable

This commit is contained in:
seelabs
2017-08-24 14:38:50 -04:00
parent 5fe65c5906
commit 6ff5d3734f
2 changed files with 35 additions and 20 deletions

View File

@@ -58,9 +58,13 @@ public:
// When booted, we just get a null json response
if(jv.isNull())
booted = true;
else
BEAST_EXPECT(jv.isMember(jss::status)
&& (jv[jss::status] == "success"));
else if (!(jv.isMember(jss::status) &&
(jv[jss::status] == "success")))
{
// Don't use BEAST_EXPECT above b/c it will be called a non-deterministic number of times
// and the number of tests run should be deterministic
fail();
}
if(jv.isMember(jss::warning))
warned = jv[jss::warning] == jss::load;