test(chat): reject negative owner results before checking change flags

This commit is contained in:
evgeny committed 2026-10-27 06:48:29 +01:00
1 parent beac8afba8
commit cce633b5b0
1 file changed
+2 -2
+2 -2
View File
@@ -255,14 +255,14 @@ static void owner_faults(struct UTUN_INSTANCE* inst) {
uint8_t before[32], after[32]; snapshot(reader, before); unsigned count = events;
fault = point; index_number = index; assert(owner_update(inst) < 0 && fault == F_NONE && sqlite3_get_autocommit(inst->topo_sqlite_db));
snapshot(reader, after); assert(!memcmp(before, after, 32) && events == count);
assert((owner_update(inst) & MS_APPLY_CHANGED) && events == count + 1); cases++;
int applied = owner_update(inst); assert(applied >= 0 && (applied & MS_APPLY_CHANGED) && events == count + 1); cases++;
}
}
uint8_t before[32], after[32]; snapshot(reader, before); unsigned count = events;
fault = F_FINALIZE; fail_member_rollback = 1; assert(owner_update(inst) < 0 && fault == F_NONE && !fail_member_rollback);
assert(member_rollback_failed && !releases_after_failure && sqlite3_get_autocommit(inst->topo_sqlite_db));
member_rollback_failed = 0; snapshot(reader, after); assert(!memcmp(before, after, 32) && events == count);
assert(owner_update(inst) & MS_APPLY_CHANGED);
int applied = owner_update(inst); assert(applied >= 0 && (applied & MS_APPLY_CHANGED));
for (int bind = 1; bind <= 2; bind++) {
assert(sqlite3_exec(inst->topo_sqlite_db, "BEGIN", NULL, NULL, NULL) == SQLITE_OK);
fault = F_BIND; index_number = bind;