From 7a93787dfe5cdaba3eed98ed8edd19674186430b Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sat, 26 Apr 2025 19:05:51 +0200 Subject: Add fuzzer assert callback to framework. --- public/common/framework.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'public') diff --git a/public/common/framework.js b/public/common/framework.js index ec9132a..a1601b7 100644 --- a/public/common/framework.js +++ b/public/common/framework.js @@ -7,7 +7,8 @@ const SCENARIOS = [] var G, L, R, V, S = {}, P = {} function on_setup() {} function on_view() {} -function on_query(q) { return null } +function on_query(q) {} +function on_assert() {} */ function log(s) { @@ -193,6 +194,18 @@ exports.query = function (state, role, q) { return result } +exports.assert = function (state) { + if (typeof on_assert === "function") { + G = state + L = G.L + R = null + V = null + _load() + on_assert() + _save() + } +} + function _load() { R = ROLES.indexOf(R) if (Array.isArray(G.active)) -- cgit v1.2.3