Commit 7ead21cb authored by Dridi Boukelmoune's avatar Dridi Boukelmoune

logexpect: Make all legends fit into 5 characters

This way they can all nicely align in the VTC output.

The recently added "end" legend that denotes the end of a transaction
before a match happened for the given VXID conflicted with the end of
the logexpect spec. The latter was renamed to "done".
parent b5d314a6
...@@ -345,17 +345,17 @@ logexp_next(struct logexp *le) ...@@ -345,17 +345,17 @@ logexp_next(struct logexp *le)
logexp_next(le); logexp_next(le);
return; return;
case LE_CLEAR: case LE_CLEAR:
vtc_log(le->vl, 3, "condition| fail clear"); vtc_log(le->vl, 3, "cond | fail clear");
VTAILQ_INIT(&le->fail); VTAILQ_INIT(&le->fail);
logexp_next(le); logexp_next(le);
return; return;
case LE_FAIL: case LE_FAIL:
vtc_log(le->vl, 3, "condition| %s", VSB_data(le->test->str)); vtc_log(le->vl, 3, "cond | %s", VSB_data(le->test->str));
VTAILQ_INSERT_TAIL(&le->fail, le->test, faillist); VTAILQ_INSERT_TAIL(&le->fail, le->test, faillist);
logexp_next(le); logexp_next(le);
return; return;
default: default:
vtc_log(le->vl, 3, "expecting| %s", VSB_data(le->test->str)); vtc_log(le->vl, 3, "test | %s", VSB_data(le->test->str));
} }
} }
...@@ -413,7 +413,7 @@ logexp_match(const struct logexp *le, struct logexp_test *test, ...@@ -413,7 +413,7 @@ logexp_match(const struct logexp *le, struct logexp_test *test,
if (ok) if (ok)
legend = "fail"; legend = "fail";
else if (skip) else if (skip)
legend = "end"; legend = "end", skip = 0;
else if (le->m_arg) else if (le->m_arg)
legend = "fmiss"; legend = "fmiss";
else else
...@@ -445,7 +445,7 @@ logexp_match(const struct logexp *le, struct logexp_test *test, ...@@ -445,7 +445,7 @@ logexp_match(const struct logexp *le, struct logexp_test *test,
vtc_log(le->vl, 3, "alt | %s", VSB_data(test->str)); vtc_log(le->vl, 3, "alt | %s", VSB_data(test->str));
return (logexp_match(le, test, data, vxid, tag, type, len)); return (logexp_match(le, test, data, vxid, tag, type, len));
} }
if (skip && !fail) if (skip)
return (LEM_SKIP); return (LEM_SKIP);
return (LEM_FAIL); return (LEM_FAIL);
} }
...@@ -549,24 +549,24 @@ logexp_thread(void *priv) ...@@ -549,24 +549,24 @@ logexp_thread(void *priv)
AZ(le->test); AZ(le->test);
vtc_log(le->vl, 4, "begin|"); vtc_log(le->vl, 4, "begin|");
if (le->query != NULL) if (le->query != NULL)
vtc_log(le->vl, 4, "qry| %s", le->query); vtc_log(le->vl, 4, "qry | %s", le->query);
logexp_next(le); logexp_next(le);
while (!logexp_done(le) && !vtc_stop && !vtc_error) { while (!logexp_done(le) && !vtc_stop && !vtc_error) {
i = VSLQ_Dispatch(le->vslq, logexp_dispatch, le); i = VSLQ_Dispatch(le->vslq, logexp_dispatch, le);
if (i == 2 && le->err_arg) { if (i == 2 && le->err_arg) {
vtc_log(le->vl, 4, "end| failed as expected"); vtc_log(le->vl, 4, "done | failed as expected");
return (NULL); return (NULL);
} }
if (i == 2) if (i == 2)
vtc_fatal(le->vl, "bad| expectation failed"); vtc_fatal(le->vl, "bad | expectation failed");
else if (i < 0) else if (i < 0)
vtc_fatal(le->vl, "bad| dispatch failed (%d)", i); vtc_fatal(le->vl, "bad | dispatch failed (%d)", i);
else if (i == 0 && ! logexp_done(le)) else if (i == 0 && ! logexp_done(le))
VTIM_sleep(0.01); VTIM_sleep(0.01);
} }
if (!logexp_done(le)) if (!logexp_done(le))
vtc_fatal(le->vl, "bad| outstanding expectations"); vtc_fatal(le->vl, "bad | outstanding expectations");
vtc_log(le->vl, 4, "end|"); vtc_log(le->vl, 4, "done |");
return (NULL); return (NULL);
} }
......
Markdown is supported
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