Env::postconditions function for alternate validation.

This commit is contained in:
Edward Hennis
2015-10-05 18:33:06 -04:00
parent 382adcc93c
commit 5707988155
2 changed files with 15 additions and 3 deletions

View File

@@ -346,6 +346,12 @@ public:
void
submit (JTx const& jt);
/** Check expected postconditions
of JTx submission.
*/
void
postconditions(JTx const& jt, TER ter, bool didApply);
/** Apply funclets and submit. */
/** @{ */
template <class JsonValue, class... FN>

View File

@@ -290,9 +290,15 @@ Env::submit (JTx const& jt)
ter_ = temMALFORMED;
didApply = false;
}
if (jt.ter && ! test.expect(ter_ == *jt.ter,
"apply: " + transToken(ter_) +
" (" + transHuman(ter_) + ")"))
return postconditions(jt, ter_, didApply);
}
void
Env::postconditions(JTx const& jt, TER ter, bool didApply)
{
if (jt.ter && ! test.expect(ter == *jt.ter,
"apply: " + transToken(ter) +
" (" + transHuman(ter) + ")"))
{
test.log << pretty(jt.jv);
// Don't check postconditions if