test: make clean checks trustworthy

This commit is contained in:
2026-08-14 22:06:54 +09:00
parent 0471d58dec
commit 77c6dd66ca
4 changed files with 25 additions and 10 deletions

View File

@@ -408,7 +408,7 @@ ximend(Ximfix *f)
}
static Keyreq
nexttrace(struct ct *t, Ximfix *f, int op, Ic *state)
nexttracecap(struct ct *t, Ximfix *f, int op, Ic *owner, int cap)
{
Keyreq req;
@@ -416,12 +416,18 @@ nexttrace(struct ct *t, Ximfix *f, int op, Ic *state)
if(!CT_CHECK(t, channbrecv(f->trace, &req) > 0))
return req;
CT_EQ_INT(t, op, req.op);
CT_EQ_PTR(t, state, req.owner);
CT_EQ_INT(t, state->cap, req.cap);
CT_EQ_PTR(t, owner, req.owner);
CT_EQ_INT(t, cap, req.cap);
CT_EQ_PTR(t, replyc, req.reply);
return req;
}
static Keyreq
nexttrace(struct ct *t, Ximfix *f, int op, Ic *state)
{
return nexttracecap(t, f, op, state, state->cap);
}
static void
notrace(struct ct *t, Ximfix *f)
{
@@ -489,6 +495,7 @@ xim_adapter_release_lifecycle(struct ct *t)
Ximfix f;
Ic a, b, *dead;
Keyres res;
int deadcap;
memset(&a, 0, sizeof a);
memset(&b, 0, sizeof b);
@@ -530,8 +537,9 @@ xim_adapter_release_lifecycle(struct ct *t)
keypress(dead, 'n', 0, &res);
nexttrace(t, &f, Keypress, dead);
CT_EQ_PTR(t, dead, testengineowner());
deadcap = dead->cap;
icfree(dead);
nexttrace(t, &f, Keyrelease, dead);
nexttracecap(t, &f, Keyrelease, dead, deadcap);
dead = nil;
CT_EQ_PTR(t, nil, ics);
CT_EQ_PTR(t, nil, testengineowner());